aboutsummaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-12-17 20:58:10 +0100
committermetamuffin <metamuffin@disroot.org>2023-12-17 20:58:10 +0100
commit2a26a6030e25127a3967dd5bccba1fb05d485ab1 (patch)
treedb2ecba63bde78804277ec66915dc3b4512a4991 /tool
parente7155ec05458ed00035ce8bc5c087306cfeedbc1 (diff)
downloadjellything-2a26a6030e25127a3967dd5bccba1fb05d485ab1.tar
jellything-2a26a6030e25127a3967dd5bccba1fb05d485ab1.tar.bz2
jellything-2a26a6030e25127a3967dd5bccba1fb05d485ab1.tar.zst
chapters
Diffstat (limited to 'tool')
-rw-r--r--tool/src/import/mod.rs11
-rw-r--r--tool/src/main.rs3
2 files changed, 10 insertions, 4 deletions
diff --git a/tool/src/import/mod.rs b/tool/src/import/mod.rs
index b4e03d6..973629c 100644
--- a/tool/src/import/mod.rs
+++ b/tool/src/import/mod.rs
@@ -37,6 +37,7 @@ pub(crate) fn import(action: Action, dry: bool) -> anyhow::Result<()> {
video,
ignore_metadata,
r#move,
+ title,
skip_existing,
} => {
if std::env::current_dir().unwrap().file_name().unwrap() != "library" {
@@ -131,10 +132,11 @@ pub(crate) fn import(action: Action, dry: bool) -> anyhow::Result<()> {
};
}
- let title = tmdb_details
- .as_ref()
- .map(|d| d.title.clone().or(d.name.clone()))
- .flatten()
+ let title = title
+ .or(tmdb_details
+ .as_ref()
+ .map(|d| d.title.clone().or(d.name.clone()))
+ .flatten())
.or(file_meta.as_ref().map(|m| m.title.clone()).flatten())
.expect("no title detected");
@@ -272,6 +274,7 @@ pub(crate) fn import(action: Action, dry: bool) -> anyhow::Result<()> {
kind,
children: Vec::new(),
media: file_meta.as_ref().map(|m| MediaInfo {
+ chapters: m.chapters.clone(),
duration: m.duration,
tracks: m.tracks.clone(),
}),
diff --git a/tool/src/main.rs b/tool/src/main.rs
index 3744560..31e63b7 100644
--- a/tool/src/main.rs
+++ b/tool/src/main.rs
@@ -74,6 +74,9 @@ enum Action {
/// Skip any action that appears to be run already.
#[arg(long)]
skip_existing: bool,
+ /// Sets the title
+ #[arg(long)]
+ title: Option<String>,
},
Migrate {
database: PathBuf,