From 6eafafe5297c54aa5cb38790c45ba189b47d755e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 1 Aug 2023 21:52:53 +0200 Subject: remote downloa --- tools/src/bin/import.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tools/src') diff --git a/tools/src/bin/import.rs b/tools/src/bin/import.rs index 863e107..12cd161 100644 --- a/tools/src/bin/import.rs +++ b/tools/src/bin/import.rs @@ -5,7 +5,7 @@ Copyright (C) 2023 metamuffin */ use anyhow::Context; use clap::{Parser, Subcommand}; -use jellycommon::{MediaInfo, Node, NodeKind, NodePrivate, NodePublic}; +use jellycommon::{config::GlobalConfig, MediaInfo, Node, NodeKind, NodePrivate, NodePublic}; use jellymatroska::read::EbmlReader; use jellyremuxer::import::import_read; use jellytools::tmdb::{tmdb_details, tmdb_image, tmdb_search}; @@ -32,6 +32,13 @@ enum Action { #[arg(short, long)] series: bool, }, + Remote { + config: PathBuf, + host: String, + #[arg(short, long)] + remote_id: Option, + id: String, + }, Set { #[arg(short = 'I', long)] item: PathBuf, @@ -195,6 +202,19 @@ fn main() -> anyhow::Result<()> { Ok(()) } + Action::Remote { + host, + config, + remote_id, + id, + } => { + let config: GlobalConfig = + serde_json::from_reader(File::open(config).unwrap()).unwrap(); + + let (username, password, tls) = &config.remote_credentials[&id]; + + Ok(()) + } Action::Set { .. } => { // let mut iteminfo: ItemInfo = match File::open(item.clone()) { // Ok(f) => serde_json::from_reader(f)?, -- cgit v1.2.3-70-g09d2