A mixed-content library is not scanned #208
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?
A library registered as mixed content is not scanned. Split out of #194, where it was grouped with music videos on the assumption that it was another resolver; it is not.
Why it is a different shape
A mixed library writes
mixed.collection.Enum.TryParse<CollectionType>fails on that string, soCollectionTypeis null for the whole walk — and null is not "no kind", it is the case every resolver has its own branch for:SeriesResolverpromotes a directory holdingtvshow.nfo, or one holding a season folderMovieResolver.ResolveMultipleaborts entirely when it seestvshow.nfoorseason.nfobeside the filesLibraryManager.ResolvePathstries the multi-item resolvers first and falls back to resolving each file on its ownResolverPrioritySo one directory is offered to every resolver in priority order until one claims it. Our
crates/ephyra-app/src/scan/tree/picks a single function per collection kind up front (movies,tv_shows,music,books,home_videos), which has no place to put "ask each in turn". This is a change to how a library's root is walked, not another arm on an existing match.Where to start
upstream/Emby.Server.Implementations/Library/LibraryManager.cs—ResolvePaths,ResolveItem, and theIItemResolver.Priorityordering; then thecollectionType is nullbranch in each ofMovieResolver,SeriesResolver,MusicAlbumResolver,AudioResolver,PhotoAlbumResolver,GenericFolderResolver.Verifying
cargo xtask reference gen-library-kinds(xtask/src/reference/kinds.rs) already lays a tree down, stands up its own container over acp -acopy ofsnapshots/default, registers libraries, scans, and writes upstream's rows and the listing they were resolved from intocrates/ephyra-app/corpus/library-kinds.json;crates/ephyra-app/tests/library_kinds.rsreplays our walk over that listing. It registers four libraries today. Adding amixedone is the natural way to get an answer key here — and a tree holding a film, a series with atvshow.nfo, a loose episode and an album beside each other is what makes the priority order observable.Note
mixedis registerable (it is aCollectionTypeOptionsmember, unlikefolders), soCollection::REGISTERABLEandcrates/ephyra-http/src/routes/library/structure/editing.rsare part of this — andcrates/ephyra-http/tests/virtual_folders.rsnow has a test that posts every registerable kind and reads the configuration back, which will need the new kind added to it.Landed on
main:7f06d454,aeb1197d,ef0a9ef2,7422383b,99f945a3,166ad391.What changed
A mixed library is registerable (
Collection::Mixed, inREGISTERABLE) and walked bycrates/ephyra-app/src/scan/tree/mixed.rs. Becausemixedparses to no collection type, each directory is offered to the resolvers in upstream's priority order: series, then a film or disc rip, then a folder. The loose files are read as films or plain videos, with tracks read last.The upstream details that cost real code, each checked against the pin in review:
Audio, and a book or a picture is no row.MovieResolver.ResolveMultiplepassessupportMultiEditions: falsefor a null type whileFindMoviehard-codestrue, so the folder is weighed with editions grouped and its files are read apart.ResolveMultiplereturns null, so each episode is reached on its own, with no library root and no sibling naming.AudioResolver.cs:114), and.cueis never a track.Verified
Against a real upstream scan.
gen-library-kindsnow registers a fifth,mixedlibrary over a 21-entry tree built to make the priority order decide. Upstream filed 28 rows, anda_mixed_library_resolves_what_upstream_resolvedagrees with all 28.AudioFileProber, which the empty fetchers don't disable. Andseries_nameis filled at write time rather than on the node.Review round. Three defects fixed:
.cuefiled as a track;scan_mixed.rsnow asserts, on every tree in the file, that no node names a parent nothing filed.In the web client (native build, loopback instance): the library opens as
collectionType=mixedin the Folders view, withAn Artistas a folder, the loose episode and the plain film as movies, andSome Seriesas a series. The episode plays with itsS1:E1label resolved.Follow-ups filed
[boxset]/[playlist]directories and the.m3ufamily reach every library kind, and we file neither.