Add label aliases (#100)#164
Merged
Merged
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #100 (label aliases) as the direct analogue of the existing artist aliases feature, for record labels. A parent label can declare sublabel aliases; navigating/searching by the parent label then transitively surfaces releases tagged with any of its (transitive) aliases, exactly like artists.
New config key, mirroring
artist_aliases:This parses into two
Configmaps mirroring the artist ones:label_aliases_map: parent label -> sublabelslabel_aliases_parents_map: sublabel -> parent labelsAlias expansion is applied wherever labels are filtered/queried, mirroring
_get_all_artist_aliases:So
label_exists("Warp")andfilter_releases(label_filter="Warp")now match releases tagged"Warp Records"/"Arbeit", and transitively through chained aliases. The VFS Labels view and CLI label dump go through these functions, so alias navigation works there with no view-specific changes (identical to how the Artists view relies onlist_artists+artist_exists+filter_releases).Design note: one deliberate divergence from artists
Artists are
Artist(name, alias)objects, so_unpack_artistsinjects the canonical parent identities into a release'sArtistMappingasalias=Trueentries (hidden byartistsarrayfmt, but present in JSON dumps). Labels are plainlist[str]with no per-entry alias marker, so there is nowhere to attach an "alias" flag. To honor the issue's "searchable/navigable but do not duplicate the displayed canonical label" requirement, label aliases are not injected into a release's displayedlabelslist — they only affect filtering / existence / navigation. Consequentlytemplates.py,cached_release_from_view,virtualfs.py, anddump.pyneed no changes (the dump snapshot is unchanged), and label display/tagging behavior is untouched. Everything else (case sensitivity, transitivity) is identical to artist aliases.Tests
Mirrors the existing artist-alias tests:
config_test.py: parsing oflabel_aliasesinto both maps, plus the full set of validation-error cases (must be a list of { label = str, aliases = list[str] } records).cache_test.py:test_label_exists_with_alias,test_label_exists_with_alias_transient, andtest_filter_releases_applies_label_aliases(transitive expansion in filtering).mypy .,ruff format --check ., andruff check .pass.pytestpasses except for the FUSE-mount VFS/CLI tests, which fail identically on cleanmasterin this sandbox because/dev/fuseis unavailable ("fuse: device not found") — unrelated to this change; CI runs them under Nix with FUSE.Link to Devin session: https://app.devin.ai/sessions/7649ed43811b4c2ea016444b6dd1031d
Requested by: @azuline