diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-19 14:29:03 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-19 14:29:03 +0100 |
| commit | 41e8ff64585b7a3b77acd027d95e3e7f651d9e0e (patch) | |
| tree | 7226e1ae6d6dfd7e111ff0364889089ca5b07cd9 /import/src/plugins/trakt.rs | |
| parent | dc4fa1995c9a341fe3027774c52a0760a00c6387 (diff) | |
| download | jellything-41e8ff64585b7a3b77acd027d95e3e7f651d9e0e.tar jellything-41e8ff64585b7a3b77acd027d95e3e7f651d9e0e.tar.bz2 jellything-41e8ff64585b7a3b77acd027d95e3e7f651d9e0e.tar.zst | |
migrate musicbrainz importer
Diffstat (limited to 'import/src/plugins/trakt.rs')
| -rw-r--r-- | import/src/plugins/trakt.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/import/src/plugins/trakt.rs b/import/src/plugins/trakt.rs index 9b7ed99..021ffe9 100644 --- a/import/src/plugins/trakt.rs +++ b/import/src/plugins/trakt.rs @@ -5,15 +5,16 @@ */ use crate::{ USER_AGENT, + helpers::get_or_insert_slug, plugins::{ImportPlugin, PluginContext, PluginInfo}, }; use anyhow::{Context, Result, anyhow, bail}; use jellycache::{Cache, HashKey}; use jellycommon::{ - jellyobject::{ObjectBuffer, Path, Tag}, + jellyobject::{ObjectBuffer, Tag}, *, }; -use jellydb::{Filter, Query, RowNum, Sort}; +use jellydb::RowNum; use log::info; use reqwest::{ Client, ClientBuilder, @@ -516,15 +517,7 @@ impl Trakt { .collect::<Vec<String>>() .join(", "); - let row = match txn.query_single(Query { - filter: Filter::Match(Path(vec![NO_SLUG.0]), slug.as_str().into()), - sort: Sort::None, - })? { - Some(r) => r, - None => { - txn.insert(ObjectBuffer::new(&mut [(NO_SLUG.0, &slug.as_str())]))? - } - }; + let row = get_or_insert_slug(txn, &slug)?; let mut c = txn.get(row)?.unwrap(); c = c.as_object().insert(NO_KIND, KIND_PERSON); |