refactor: merge media-server parsers, move poster sync and event payload
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "image-converter"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
config = { workspace = true }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "jellyfin"
|
||||
name = "media-server"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
|
||||
@@ -60,5 +60,5 @@ struct JellyfinPayload {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "tests/lib.rs"]
|
||||
#[path = "tests/jellyfin.rs"]
|
||||
mod tests;
|
||||
5
crates/adapters/media-server/src/lib.rs
Normal file
5
crates/adapters/media-server/src/lib.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
mod jellyfin;
|
||||
mod plex;
|
||||
|
||||
pub use jellyfin::JellyfinParser;
|
||||
pub use plex::PlexParser;
|
||||
@@ -70,5 +70,5 @@ struct PlexGuid {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "tests/lib.rs"]
|
||||
#[path = "tests/plex.rs"]
|
||||
mod tests;
|
||||
@@ -1,9 +0,0 @@
|
||||
[package]
|
||||
name = "plex"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
domain = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "poster-fetcher"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
config = { workspace = true }
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
[package]
|
||||
name = "poster-sync"
|
||||
version = "0.1.0"
|
||||
edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
domain = { workspace = true }
|
||||
async-trait = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
tokio = { workspace = true }
|
||||
@@ -6,6 +6,7 @@ pub mod event_handler;
|
||||
pub mod get_movie_profile;
|
||||
pub mod get_movies;
|
||||
pub mod merge_duplicates;
|
||||
pub mod poster_sync;
|
||||
pub mod queries;
|
||||
pub mod reindex_search;
|
||||
pub mod request_enrichment;
|
||||
|
||||
@@ -22,14 +22,12 @@ auth = { workspace = true }
|
||||
metadata = { workspace = true }
|
||||
poster-fetcher = { workspace = true }
|
||||
object-storage = { workspace = true }
|
||||
poster-sync = { workspace = true }
|
||||
tmdb-enrichment = { workspace = true }
|
||||
image-converter = { workspace = true }
|
||||
export = { workspace = true }
|
||||
importer = { workspace = true }
|
||||
rss = { workspace = true }
|
||||
jellyfin = { workspace = true }
|
||||
plex = { workspace = true }
|
||||
media-server = { workspace = true }
|
||||
sqlite = { workspace = true }
|
||||
sqlx = { workspace = true }
|
||||
anyhow = { workspace = true }
|
||||
|
||||
@@ -210,8 +210,8 @@ pub fn build_deps(
|
||||
revoke_webhook_token: RevokeWebhookTokenDeps {
|
||||
webhook_token: repos.webhook_token.clone(),
|
||||
},
|
||||
jellyfin_parser: std::sync::Arc::new(jellyfin::JellyfinParser),
|
||||
plex_parser: std::sync::Arc::new(plex::PlexParser),
|
||||
jellyfin_parser: std::sync::Arc::new(media_server::JellyfinParser),
|
||||
plex_parser: std::sync::Arc::new(media_server::PlexParser),
|
||||
},
|
||||
movies: MoviesGroup {
|
||||
sync_poster: SyncPosterDeps {
|
||||
|
||||
@@ -167,7 +167,7 @@ pub async fn build_worker(config: &config::AppConfig) -> anyhow::Result<WorkerAp
|
||||
// ── Event handlers ────────────────────────────────────────────────────────
|
||||
|
||||
let handlers: Vec<Arc<dyn EventHandler>> = {
|
||||
let poster = Arc::new(poster_sync::PosterSyncHandler::new(
|
||||
let poster = Arc::new(application::movies::poster_sync::PosterSyncHandler::new(
|
||||
Arc::clone(&movie_command),
|
||||
Arc::clone(&movie_query),
|
||||
Arc::clone(&metadata),
|
||||
|
||||
Reference in New Issue
Block a user