aboutsummaryrefslogtreecommitdiff
path: root/import/src/plugins/misc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'import/src/plugins/misc.rs')
-rw-r--r--import/src/plugins/misc.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/import/src/plugins/misc.rs b/import/src/plugins/misc.rs
index 8a95b97..43bd118 100644
--- a/import/src/plugins/misc.rs
+++ b/import/src/plugins/misc.rs
@@ -6,7 +6,8 @@
use crate::plugins::{ImportContext, ImportPlugin, PluginInfo};
use anyhow::{Context, Result, bail};
use jellycache::{HashKey, cache_store};
-use jellycommon::{Asset, NodeID, NodeKind, PictureSlot, Visibility};
+use jellycommon::{PICT_BACKDROP, PICT_COVER};
+use jellydb::table::RowNum;
use jellyremuxer::matroska::{AttachedFile, Segment};
use log::info;
use regex::Regex;
@@ -26,14 +27,14 @@ impl ImportPlugin for ImageFiles {
..Default::default()
}
}
- fn file(&self, ct: &ImportContext, parent: NodeID, path: &Path) -> Result<()> {
+ fn file(&self, ct: &ImportContext, parent: RowNum, path: &Path) -> Result<()> {
let filename = path.file_name().unwrap().to_string_lossy();
let slot = match filename.as_ref() {
- "poster.jpeg" | "poster.webp" | "poster.png" => PictureSlot::Cover,
- "backdrop.jpeg" | "backdrop.webp" | "backdrop.png" => PictureSlot::Backdrop,
+ "poster.jpeg" | "poster.webp" | "poster.png" => PICT_COVER,
+ "backdrop.jpeg" | "backdrop.webp" | "backdrop.png" => PICT_BACKDROP,
_ => return Ok(()),
};
- info!("import {slot} at {path:?}");
+ info!("import {} at {path:?}", slot);
let asset = Asset(cache_store(
format!("media/literal/{}-{slot}.image", HashKey(path)),
|| {
@@ -141,7 +142,7 @@ impl ImportPlugin for Children {
..Default::default()
}
}
- fn file(&self, ct: &ImportContext, parent: NodeID, path: &Path) -> Result<()> {
+ fn file(&self, ct: &ImportContext, parent: RowNum, path: &Path) -> Result<()> {
let filename = path.file_name().unwrap().to_string_lossy();
if filename.as_ref() == "children" {
info!("import children at {path:?}");
@@ -172,7 +173,7 @@ impl ImportPlugin for EpisodeIndex {
..Default::default()
}
}
- fn media(&self, ct: &ImportContext, node: NodeID, path: &Path, _seg: &Segment) -> Result<()> {
+ fn media(&self, ct: &ImportContext, node: RowNum, path: &Path, _seg: &Segment) -> Result<()> {
let filename = path.file_name().unwrap().to_string_lossy();
if let Some(cap) = RE_EPISODE_FILENAME.captures(&filename) {
if let Some(episode) = cap.name("episode").map(|m| m.as_str()) {