aboutsummaryrefslogtreecommitdiff
path: root/import
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-04-30 11:24:14 +0200
committermetamuffin <metamuffin@disroot.org>2025-04-30 11:24:14 +0200
commitd6a039a10ac3c81d410beb9b648d29524ca1e278 (patch)
treefa521277e3ea94f796e21071f4d2b372c5b9830c /import
parenta2ef3f6ec4c830611fde1a2e935588ccbbc61c03 (diff)
downloadjellything-d6a039a10ac3c81d410beb9b648d29524ca1e278.tar
jellything-d6a039a10ac3c81d410beb9b648d29524ca1e278.tar.bz2
jellything-d6a039a10ac3c81d410beb9b648d29524ca1e278.tar.zst
smaller fixes and remove useless deps
Diffstat (limited to 'import')
-rw-r--r--import/Cargo.toml1
-rw-r--r--import/src/lib.rs20
2 files changed, 10 insertions, 11 deletions
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<String>,
}
-pub static CONF_PRELOAD: Mutex<Option<Config>> = Mutex::const_new(None);
+pub static CONF_PRELOAD: Mutex<Option<Config>> = Mutex::new(None);
static CONF: LazyLock<Config> = 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!(