Skip to content

Add label aliases (#100)#164

Merged
azuline merged 1 commit into
masterfrom
devin/1784154040-label-aliases
Jul 15, 2026
Merged

Add label aliases (#100)#164
azuline merged 1 commit into
masterfrom
devin/1784154040-label-aliases

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

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:

label_aliases = [
  { label = "Anjunabeats", aliases = ["Anjunadeep"] },
  { label = "Warp", aliases = ["Warp Records", "Arbeit"] },
]

This parses into two Config maps mirroring the artist ones:

  • label_aliases_map: parent label -> sublabels
  • label_aliases_parents_map: sublabel -> parent labels

Alias expansion is applied wherever labels are filtered/queried, mirroring _get_all_artist_aliases:

def _get_all_label_aliases(c, x):  # transitive, follows label_aliases_map
    ...

# filter_releases / filter_tracks label_filter, and label_exists:
labels = [label_filter, *_get_all_label_aliases(c, label_filter)]
WHERE label IN (?, ?, ...)

So label_exists("Warp") and filter_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 on list_artists + artist_exists + filter_releases).

Design note: one deliberate divergence from artists

Artists are Artist(name, alias) objects, so _unpack_artists injects the canonical parent identities into a release's ArtistMapping as alias=True entries (hidden by artistsarrayfmt, but present in JSON dumps). Labels are plain list[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 displayed labels list — they only affect filtering / existence / navigation. Consequently templates.py, cached_release_from_view, virtualfs.py, and dump.py need 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 of label_aliases into 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, and test_filter_releases_applies_label_aliases (transitive expansion in filtering).

mypy ., ruff format --check ., and ruff check . pass. pytest passes except for the FUSE-mount VFS/CLI tests, which fail identically on clean master in this sandbox because /dev/fuse is 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

@azuline azuline self-assigned this Jul 15, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@azuline
azuline merged commit 78df5b7 into master Jul 15, 2026
1 check passed
@azuline
azuline deleted the devin/1784154040-label-aliases branch July 15, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant