CLI utility to ingest embedded json metadata from yt-dlp downloads to a SQLite database file
yt-dlp
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: Refactor inputs to allow for arbitrary database location

0xBA5E64 f21a4b38 d4e4715a

+7 -3
+7 -3
src/main.rs
··· 8 8 #[command(version, about, long_about = None)] 9 9 struct Args { 10 10 /// Location of file/files to rename 11 + #[arg(default_value = ".")] 11 12 path: PathBuf, 13 + 14 + /// Where the db is 15 + #[arg(long, default_value = "./db.sqlite")] 16 + db: PathBuf, 12 17 } 13 18 14 19 #[tokio::main] 15 20 async fn main() -> anyhow::Result<()> { 16 21 let args = Args::parse(); 17 - let dir: PathBuf = args.path; 18 22 19 23 let db_pool = SqlitePoolOptions::new() 20 24 .max_connections(32) 21 25 .connect_with( 22 26 SqliteConnectOptions::new() 23 - .filename("db.sqlite") 27 + .filename(args.db) 24 28 .create_if_missing(true) 25 29 .auto_vacuum(SqliteAutoVacuum::Incremental), 26 30 ) ··· 32 36 .await 33 37 .expect("Failed to apply database migrations"); 34 38 35 - index_videos(dir, &db_pool).await?; 39 + index_videos(args.path, &db_pool).await?; 36 40 Ok(()) 37 41 }