Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/remux-dashboard/src/pages/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ pub fn RemuxdbSettingsCard(app_state: AppState) -> Element {
} else {
form { onsubmit: on_submit, style: "display:flex;flex-direction:column;gap:14px",
p { style: "font-size:.8rem;color:var(--text-secondary);line-height:1.5;margin:0",
"RemuxDB is a comprehensive media metadata database for torrents. Instead of relying on file names, it probes the actual files to build accurate stream information."
"RemuxDB is a comprehensive media metadata database for torrents and NZBs. Instead of relying on file names, it probes the actual files to build accurate stream information."
}
p { style: "font-size:.8rem;color:var(--text-secondary);line-height:1.5;margin:0",
"Want to help populate the DB faster? You can run a worker! Join Discord for more info."
Expand All @@ -1665,7 +1665,6 @@ pub fn RemuxdbSettingsCard(app_state: AppState) -> Element {
}
" Enable RemuxDB"
}
p { class: "field-hint", "Submit probe data to RemuxDB after each live probe." }
}
if let Some(err) = error.read().as_ref() {
ErrorAlert { message: err.clone() }
Expand Down
6 changes: 6 additions & 0 deletions crates/remux-server/migrations/202608040002_opendal_music.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Local music: artist/album parsed from the Jellyfin folder layout
-- ({Artist}/{Album}/{Track}, album-only folders, loose tracks) at scan time.
ALTER TABLE opendal_files ADD COLUMN artist TEXT;
ALTER TABLE opendal_files ADD COLUMN album TEXT;
CREATE INDEX IF NOT EXISTS idx_opendal_files_artist_album
ON opendal_files(addon_id, media_kind, artist, album);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Local music: Deezer IDs resolved at scan time (mirroring imdb_id) so catalog
-- rows carry a real provider identity for metadata enrichment and validation.
ALTER TABLE opendal_files ADD COLUMN deezer_track INTEGER;
ALTER TABLE opendal_files ADD COLUMN deezer_album INTEGER;
ALTER TABLE opendal_files ADD COLUMN deezer_artist INTEGER;
45 changes: 45 additions & 0 deletions crates/remux-server/src/addons/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,51 @@ impl AddonService {
.await
.ok();

// Central Deezer ID resolution for music: if a Track/Album has no Deezer
// id, search Deezer by artist + title/album and record the ids (mirroring
// IMDB resolution for movies). This is addon-agnostic — local music, yt-dlp
// imports, anything. Runs before addon dispatch so the Deezer meta addon
// (which requires deezer ids) can then enrich with artwork/genres. The
// artist name is looked up from the parent/grandparent row since it isn't
// preloaded here.
if matches!(media.kind, db::MediaKind::Track | db::MediaKind::Album)
&& (media
.external_ids
.deezer_track
.is_none()
|| media
.external_ids
.deezer_album
.is_none())
{
let artist_row_id = if media.kind == db::MediaKind::Track {
media.grandparent_id
} else {
media.parent_id
};
let artist_name: Option<String> = match artist_row_id {
Some(id) => sqlx::query_scalar("SELECT title FROM media WHERE id = ?")
.bind(id)
.fetch_optional(&ctx.db)
.await
.ok()
.flatten(),
None => media
.external_ids
.artist_name
.clone(),
};
if let Some(name) = artist_name {
// resolve_music_deezer's search query reads the artist from the
// in-memory grandparent stub.
let mut gp = db::Media::default();
gp.title = name;
media.grandparent = Some(Box::new(gp));
}
crate::services::resolve::MediaResolveService::resolve_music_deezer(media)
.await;
}

let applicable = self
.addons_for::<dyn MetaAddon>(media, &ctx.db, None)
.await;
Expand Down
Loading
Loading