use std::path; use sanitise_file_name::sanitise; pub(crate) const SPEC_FILE: &str = "spec.toml"; pub(crate) const LOCAL_PODCASTS_DIR: &str = "podcasts"; pub(crate) const LOCAL_PLAYLISTS_DIR: &str = "playlists"; pub(crate) const IPOD_PODCASTS_DIR: &str = "/Podcasts"; macro_rules! playlist_ext { () => {"m3u8"}; } pub(crate) const PLAYLIST_EXT: &str = playlist_ext!(); macro_rules! bookmark_ext { () => {"bmark"}; } pub(crate) const BOOKMARK_EXT: &str = bookmark_ext!(); pub(crate) const PLAYLIST_BOOKMARK_EXT: &str = concat!(playlist_ext!(), ".", bookmark_ext!()); pub(crate) const LISTENED_PLAYLIST_PATH: &str = concat!("[PC] (Listened).", playlist_ext!()); pub(crate) const MASTER_PLAYLIST_PATH: &str = concat!("[PC] (Master Feed).", playlist_ext!()); pub(crate) const MASTER_PLAYLIST_NAME: &str = "[PC] (Master Feed)"; pub(crate) const PLAYLIST_PREFIX: &str = "[PC]"; pub(crate) const UNLISTENED_SUFFIX: &str = "(unlistened)"; pub(crate) fn podcast_folder( root: &path::Path, alias: &str, ) -> path::PathBuf { root.join(LOCAL_PODCASTS_DIR).join(sanitise(alias)) } pub(crate) fn spec_path( root: &path::Path, alias: &str, ) -> path::PathBuf { let folder = podcast_folder(root, alias); folder.join(SPEC_FILE) }