Replace swap with separate display_artist storage#20
Conversation
Instead of swapping ALBUMARTIST/ALBUMARTISTS tag values before processing, store display strings in dedicated columns and let plural tags feed contributor creation directly. Schema: add display_artist columns to albums and tracks tables. Scanner: capture ALBUMARTIST/ARTIST as display strings before _preCheckAttributes defers them. Both create and update paths. Queries: COALESCE(display_artist, contributors.name) for the artist field. UTF-8 decode for both columns. Preference: usePluralArtistTags gates plural-replaces-singular in _mergeAndCreateContributors. Off by default. Search: display_artist added to fulltext index. Removes the swap, the albums.label placeholder, the commented-out contributor_display tables, and the debug logError. Signed-off-by: Rouzax <GitHub@mgdn.nl>
dab7d73 to
8032221
Compare
|
I've implemented the full 3nf schema changes in the branch, otherwise it's confusing. Would you mind recreating PRs for the functional changes with that as the base? |
|
Thanks for implementing the schema. I will look into rebasing, but just want to flag that it is not a straightforward find-and-replace. Our changes store flat strings directly into columns. Your schema stores integer IDs that reference the contributor_display table, which means every place that captures or stores a display string needs the lookup/insert/get-ID flow. The rescan fix, preference gate, fallback, and track-level population all need to work with IDs instead of strings. I will work through it but it may take a bit. |
|
In that case maybe it is best if you wait until I implement trackartist and n&c scanning according to my design. It won't be today. |
I said I needed to look at it in more detail, not that it was not possible 😉 |
|
Superseded by #21 which ports these changes onto your 3NF contributor_display schema. |
Summary
Replaces the tag-swap mechanism with dedicated
display_artistcolumns on albums and tracks. Stores ALBUMARTIST/ARTIST tag values directly as display strings. When the opt-in preference is enabled, ALBUMARTISTS/ARTISTS plural tags are used as the sole contributor source.Changes
display_artistcolumns on albums and tracks (schema_27_up.sql). Replacesalbums.labelplaceholder._preCheckAttributes, stores in columns. Both create and update paths handled (fixes the rescan bug).COALESCE(display_artist, contributors.name)for theatag artist field.display_artistreturned alongside existing fields. UTF-8 decode added. No breaking API changes.usePluralArtistTagsin Settings > Behavior. Off by default. When on, plural tags replace singular for contributor creation.display_artistadded to fulltext index.albums.labelusage, commented-outcontributor_displaytables, debuglogError.Why replace the swap
_newTrack, not update path)Flat columns match the Navidrome/OpenSubsonic model where
displayArtistis a simple string field.Testing
Verified with 52 automated tests covering fresh install, schema upgrade (26 to 27), album rescan after retagging, preference toggle, regression on 18 existing fixture patterns, and API contract validation.
What is kept from your branch
display_artistfield name in the APIshow_artist_listpopup concept (Material PR to follow)