aboutsummaryrefslogtreecommitdiff
path: root/import/src/plugins/tmdb.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-01-16 04:21:10 +0100
committermetamuffin <metamuffin@disroot.org>2026-01-16 04:21:10 +0100
commit30e13399fa9f815cd1884fe87914cdb22d1985af (patch)
treeea5b22431b73264c120fcb06560ff158c08ed8a4 /import/src/plugins/tmdb.rs
parent9b5d11a2a39e0030ce4eeab8905972f9472c7d27 (diff)
downloadjellything-30e13399fa9f815cd1884fe87914cdb22d1985af.tar
jellything-30e13399fa9f815cd1884fe87914cdb22d1985af.tar.bz2
jellything-30e13399fa9f815cd1884fe87914cdb22d1985af.tar.zst
begin refactor import
Diffstat (limited to 'import/src/plugins/tmdb.rs')
-rw-r--r--import/src/plugins/tmdb.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/import/src/plugins/tmdb.rs b/import/src/plugins/tmdb.rs
index ce9ae59..206781b 100644
--- a/import/src/plugins/tmdb.rs
+++ b/import/src/plugins/tmdb.rs
@@ -4,11 +4,12 @@
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
use crate::{
- USER_AGENT,
+ NodeID, USER_AGENT,
plugins::{ImportContext, ImportPlugin, PluginInfo},
};
use anyhow::{Context, Result, anyhow, bail};
use jellycache::{EscapeKey, HashKey, cache_memory, cache_store};
+use jellycommon::jellyobject::Object;
use log::info;
use reqwest::{
Client, ClientBuilder,
@@ -160,14 +161,14 @@ impl ImportPlugin for Tmdb {
..Default::default()
}
}
- fn process(&self, ct: &ImportContext, node: NodeID, data: &Node) -> Result<()> {
+ fn process(&self, ct: &ImportContext, node: NodeID, data: Object) -> Result<()> {
self.process_primary(ct, node, data)?;
self.process_episode(ct, node, data)?;
Ok(())
}
}
impl Tmdb {
- fn process_primary(&self, ct: &ImportContext, node: NodeID, data: &Node) -> Result<()> {
+ fn process_primary(&self, ct: &ImportContext, node: NodeID, data: Object) -> Result<()> {
let (tmdb_kind, tmdb_id): (_, u64) =
if let Some(id) = data.identifiers.get(&IdentifierType::TmdbSeries) {
(TmdbKind::Tv, id.parse()?)
@@ -199,7 +200,7 @@ impl Tmdb {
.transpose()?
.flatten();
- ct.db.update_node_init(node, |node| {
+ ct.dba.update_node_by_nodeid(node, |node| {
node.title = details.title.clone().or(node.title.clone());
node.tagline = details.tagline.clone().or(node.tagline.clone());
node.description = Some(details.overview.clone());