From d6a039a10ac3c81d410beb9b648d29524ca1e278 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 30 Apr 2025 11:24:14 +0200 Subject: smaller fixes and remove useless deps --- import/Cargo.toml | 1 - import/src/lib.rs | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'import') diff --git a/import/Cargo.toml b/import/Cargo.toml index 506ed24..112df40 100644 --- a/import/Cargo.toml +++ b/import/Cargo.toml @@ -5,7 +5,6 @@ edition = "2021" [dependencies] jellybase = { path = "../base" } -jellyclient = { path = "../client" } jellyremuxer = { path = "../remuxer" } jellycache = { path = "../cache" } jellyimport-fallback-generator = { path = "fallback_generator" } diff --git a/import/src/lib.rs b/import/src/lib.rs index da339d8..784b717 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -19,14 +19,13 @@ use anyhow::{anyhow, bail, Context, Result}; use infojson::YVideo; use jellybase::{ assetfed::AssetInner, - common::{Chapter, MediaInfo, Node, NodeID, NodeKind, Rating, SourceTrack, SourceTrackKind}, + common::{ + Appearance, Chapter, LocalTrack, MediaInfo, Node, NodeID, NodeKind, ObjectIds, PeopleGroup, + Person, Rating, SourceTrack, SourceTrackKind, TmdbKind, TrackSource, TraktKind, Visibility, + }, database::Database, }; use jellycache::cache_file; -use jellyclient::{ - Appearance, LocalTrack, ObjectIds, PeopleGroup, Person, TmdbKind, TrackSource, TraktKind, - Visibility, -}; use jellyimport_fallback_generator::generate_fallback; use jellyremuxer::metadata::checked_matroska_metadata; use log::info; @@ -39,13 +38,13 @@ use std::{ fs::{read_to_string, File}, io::BufReader, path::{Path, PathBuf}, - sync::LazyLock, + sync::{LazyLock, Mutex}, time::UNIX_EPOCH, }; use tmdb::Tmdb; use tokio::{ runtime::Handle, - sync::{Mutex, RwLock, Semaphore}, + sync::{RwLock, Semaphore}, task::spawn_blocking, }; use trakt::Trakt; @@ -71,12 +70,13 @@ pub struct ApiSecrets { pub trakt: Option, } -pub static CONF_PRELOAD: Mutex> = Mutex::const_new(None); +pub static CONF_PRELOAD: Mutex> = Mutex::new(None); static CONF: LazyLock = LazyLock::new(|| { CONF_PRELOAD - .blocking_lock() + .lock() + .unwrap() .take() - .expect("cache config not preloaded. logic error") + .expect("import config not preloaded. logic error") }); pub const USER_AGENT: &'static str = concat!( -- cgit v1.2.3-70-g09d2