move podcasts to within nested podcasts folder (significant breaking change)

This commit is contained in:
Aaron Manning
2025-08-29 21:46:22 +10:00
parent cb47ff0cb8
commit 07b43ba2dc
6 changed files with 65 additions and 51 deletions

View File

@@ -2,58 +2,58 @@ use std::path;
use std::collections::HashMap;
#[derive(clap::Parser)]
pub (crate) struct Args {
pub(crate) struct Args {
/// Path to the configuration file listing podcast RSS feeds.
#[arg(default_value = "./podcasts.toml")]
pub (crate) config : path::PathBuf,
pub(crate) config: path::PathBuf,
#[command(subcommand)]
pub (crate) command : Command,
pub(crate) command: Command,
}
#[derive(clap::ValueEnum, Copy, Clone, Debug,PartialEq, Eq, PartialOrd, Ord)]
pub (crate) enum ListenStatus {
pub(crate) enum ListenStatus {
Listened,
Unlistened,
}
#[derive(clap::Subcommand)]
pub (crate) enum Command {
pub(crate) enum Command {
/// Updates feed and downloads latest episodes.
Download {
/// The podcast to update. Updates all in configuration file if unspecified.
#[arg(long, short)]
podcast : Option<String>,
podcast: Option<String>,
},
/// Lists the episodes for a given podcast, filtered based on if it has been listened or not.
List {
/// Filter for if episodes have been listened to or not.
#[arg(long, short)]
status : Option<ListenStatus>,
status: Option<ListenStatus>,
/// The podcast to list episodes for.
#[arg(long, short)]
podcast : String,
podcast: String,
},
/// Marks an entire podcast's history of episodes as played or unplayed.
Mark {
/// The new listen status for the episodes.
#[arg(long, short)]
status : ListenStatus,
status: ListenStatus,
/// The podcast to change the listen status of.
#[arg(long, short)]
podcast : String,
podcast: String,
},
/// Tags files and generates playlists ready for use with an iPod.
Tag {
/// The podcast to tag and generate playlists for.
#[arg(long, short)]
podcast : Option<String>,
podcast: Option<String>,
},
}
/// Struct modelling configuration file format.
#[derive(serde::Deserialize)]
pub (crate) struct Config {
pub(crate) struct Config {
/// Map from podcast alias to RSS feed either as a url (prefix: http) or file path.
pub (crate) podcasts : HashMap<String, String>,
pub(crate) podcasts: HashMap<String, String>,
}