initial code for tag stripping and m3u generation
This commit is contained in:
16
src/main.rs
16
src/main.rs
@@ -1,5 +1,6 @@
|
||||
mod rss;
|
||||
mod input;
|
||||
mod tagging;
|
||||
mod download;
|
||||
|
||||
use input::{Command, ListenStatus};
|
||||
@@ -28,7 +29,6 @@ fn main() -> anyhow::Result<()> {
|
||||
anyhow::bail!("could not get parent of configuration path for root directory")
|
||||
};
|
||||
|
||||
|
||||
match args.command {
|
||||
Command::Download { podcast } => {
|
||||
// Updating single podcast
|
||||
@@ -77,10 +77,18 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
spec.write_to(&spec_file)?;
|
||||
},
|
||||
Command::Tag { podcast } => {
|
||||
if let Some(alias) = podcast {
|
||||
tagging::generate_m3u(alias.as_str(), root)?;
|
||||
tagging::strip_tags(alias.as_str(), root)?;
|
||||
} else {
|
||||
for (alias, _) in config.podcasts {
|
||||
tagging::generate_m3u(alias.as_str(), root)?;
|
||||
tagging::strip_tags(alias.as_str(), root)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user