An album's genres lead with a different track than upstream's #46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One album's genres are in a different order from upstream's, though every track
in it agrees with upstream exactly.
Enigma/Seven Lives Many Faces (2008): upstream's album row startsAmbient|…|New Age|…, this server's startsNew Age|…. Same genres, differentfirst track.
An album takes its genres from its tracks, in the order the tracks are folded
in. The album spans sub-folders whose tracks carry different genre lists, so
which track is folded first decides which genres lead. That is a question about
the order a folder's children are walked and summarised
(
crates/jellyfin-app/src/scan/summary.rs), not about reading tags.Measured after #44: 1 row of 329 albums. It is the last genre difference in the
music library — tracks are at 0.
An album folds its tracks in the order its folder lists them, and that list is
read once — before any tag is read.
The rule, from upstream:
AlbumMetadataService.GetChildrenForMetadataUpdatestakesGetRecursiveChildren(i => i is Audio), andUpdateGenres(
MetadataService.cs:547) isSelectMany(i => i.Genres).Distinct(...)— firstappearance wins, so the child order is the answer.
Folder.AddChildrenToListwalks depth-first, a folder's contents standingwhere the folder does.
Folder.Childrenis materialised once (_children ??= LoadChildren()) and thequery carries no
OrderBy, soApplyOrderfalls through toSortName.track's name is its file stem (
ResolverHelper.cs:96) andAudio.CreateSortNameis disc + track + name with both numbers still null.So a track is placed by its file stem exactly as written, and a folder by the
folded form of its directory name. For
Seven Lives Many Faces,Encounterssorts before
cd 02because a track keeps its case and a folder does not — whichis why the ten-genre root tracks lead and
New Agedoes not.GenresGenresAll 329 albums now agree with upstream.
Worth recording: the first implementation used the stored
SortName, whichis the post-tag spelling. It fixed this album and broke two others — 2 differing
where we started with 1. It was caught only by rescanning the whole library
rather than the one album in the issue. Of the orderings tried against all 329,
the pre-tag rule is the only one that reproduces every row: stored sort name
missed 2, path order 1, readdir order 1, insertion order 4.
Not touched: 119 tracks still differ from upstream on
SortNameitself. Thefold order no longer reads that column, so the two are independent.