Skip to content

Comments

feat(genres): Genre frontend implementation#1459

Open
jozefKruszynski wants to merge 12 commits intomainfrom
feat/genres-v2-implementation
Open

feat(genres): Genre frontend implementation#1459
jozefKruszynski wants to merge 12 commits intomainfrom
feat/genres-v2-implementation

Conversation

@jozefKruszynski
Copy link
Contributor

@jozefKruszynski jozefKruszynski commented Feb 14, 2026

PR: Genre V2 Frontend Implementation

Branch: feat/genres-v2-implementation
Base: main
Build: Passes
Lint: Passes


Summary

Complete frontend implementation for the Genre V2 system. Introduces first-class genre and alias management with the relational model: Genre -> Aliases -> Media Items.

  • Genre library view with search, filtering, sorting, and view modes
  • Genre detail page with overview rows and alias management (admin)
  • Full CRUD API integration for genres and aliases
  • Genre-based filtering across all media library views
  • Global search integration
  • Genre management settings page with default restore/reset
  • 59 pre-translated genre display names
  • Self-alias protection and alias-to-genre promotion

New Files

src/views/GenreDetails.vue

Genre detail page:

  • Overview rows from getGenreOverviewRows — artists, albums, tracks, etc. with "see all" navigation to filtered library views
  • Alias management (admin only):
    • Link existing alias (autocomplete search dialog)
    • Create and link new alias
    • Unlink alias (no confirmation, reversible)
    • Delete alias (confirmation dialog, permanent)
    • Promote alias to standalone genre (confirmation, navigates to new genre)
  • Self-alias protection — aliases matching an existing genre name hide promote/delete buttons
  • Alias chips in header with overflow popover
  • Fallback to radio base tracks if no overview data

src/views/LibraryGenres.vue

Genre library listing:

  • Standard ItemsListing integration (list/panel/compact view modes)
  • Alias-aware search — also queries aliases, includes parent genres in results (deduplicated)
  • Sort: name, sort_name, timestamp_added, play_count (asc/desc)
  • Provider and favorites filtering
  • Admin menu: add genre, add alias
  • Auto-refresh on MEDIA_ITEM_ADDED events

src/components/AddGenreAliasDialog.vue

Reusable dialog for creating genres or aliases:

  • type prop: MediaType.GENRE or MediaType.GENRE_ALIAS
  • Fields: name, sort_name, description

src/views/settings/GenreManagement.vue

Genre management settings page (admin only):

  • Header card with icon and description
  • Genre statistics (total count)
  • Restore Missing Defaults — adds missing default genres without affecting existing data (single confirmation)
  • Full Restore (Reset All) — deletes all genres/aliases and recreates defaults (double confirmation)
  • "View All Genres" navigation to library

API Layer (src/plugins/api/index.ts)

Genre Endpoints

Method Endpoint Description
getLibraryGenresCount() music/genres/count Total genre count
getLibraryGenres() music/genres/library_items List with search/filter/pagination
getGenre() music/genres/get Get by ID + provider
addGenreToLibrary() music/genres/add Create genre
removeGenreFromLibrary() music/genres/remove Delete genre
getGenreOverviewRows() music/genres/overview Recommendation folders
getGenreRadioBaseTracks() music/genres/radio_mode_base_tracks Radio tracks
restoreGenreDefaults() music/genres/restore_defaults Restore default genres

Alias Endpoints

Method Endpoint Description
getLibraryAliases() music/aliases/library_items List with search/filter
addAliasToLibrary() music/aliases/add Create alias
removeAliasFromLibrary() music/aliases/remove Delete alias

Relationship Endpoints

Method Endpoint Description
addAliasToGenre() music/genres/add_alias_mapping Link alias to genre
removeAliasFromGenre() music/genres/remove_alias_mapping Unlink alias from genre
promoteAliasToGenre() music/aliases/promote_to_genre Promote alias to genre

Genre Filtering on Existing Endpoints

Added genre_ids parameter to: getLibraryArtists, getLibraryAlbums, getLibraryTracks, getLibraryPlaylists, getLibraryRadios, getLibraryAudiobooks, getLibraryPodcasts.

Copy link
Contributor

@stvncode stvncode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really awesome! Sorry for all my comments, they are mainly for ui lib, toast error and file refactor, otherwise, nothing to say 😃
Don't hesitate to ping me for some changes, happy to help if needed!

@jozefKruszynski
Copy link
Contributor Author

I'll do some refactoring 😃

@jozefKruszynski
Copy link
Contributor Author

@stvncode I refactored into smaller components and migrated all code to shadcn-vue.

@stvncode
Copy link
Contributor

stvncode commented Feb 17, 2026

@jozefKruszynski Ok done. I replaced ui components, refactored some comps that were a bit big and also make the genre list refresh after a delete or an addition.
Regarding the code, i have nothing to say anymore (you can have a look at my change for the ui if they are good for you).
One more thing, regarding the action to create an alias in the genre page, do you think it's useful ? We already have the action in genre details and creating an alias in the genre page feels weird as a user since nothing is happening on the screen, this is just a suggestion ofc 😃

@jozefKruszynski
Copy link
Contributor Author

Thanks for putting in the time
I think you're right about adding an alias on the genres page, we should remove that as it actually serves to confuse things.

@stvncode stvncode force-pushed the feat/genres-v2-implementation branch from d47f205 to 6fafc66 Compare February 17, 2026 16:07
@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
npm/@vueuse/core 14.2.0 🟢 5.2
Details
CheckScoreReason
Code-Review🟢 8Found 24/30 approved changesets -- score normalized to 8
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 1030 commit(s) and 12 issue activity found in the last 90 days -- score normalized to 10
Packaging⚠️ -1packaging workflow not detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Binary-Artifacts🟢 10no binaries found in the repo
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • yarn.lock

stvncode
stvncode previously approved these changes Feb 17, 2026
Copy link
Contributor

@stvncode stvncode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is good ✅
@marcelveldt @MarvinSchenkel, if you want to double check the ui/ux

@stvncode stvncode marked this pull request as ready for review February 17, 2026 16:10
@jozefKruszynski
Copy link
Contributor Author

@stvncode Please could you give this another once over as there have been some quite significant changes. I think I also might have screwed up the immediate refresh of some things, either that or my browser cache is just being particularly stubborn

Copy link
Contributor

@stvncode stvncode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed some any but except for that, it's really nice! One thing, when arriving in a track page, i have this error:

Image

Also, i don't see the genre menu button in the sidebar 🤔

@jozefKruszynski
Copy link
Contributor Author

jozefKruszynski commented Feb 22, 2026

I removed some any but except for that, it's really nice! One thing, when arriving in a track page, i have this error:

Image

I'll double check, sorry about that.

EDIT: Looks like my rebase didn't actually get pushed 🤦‍♂️

@stvncode stvncode force-pushed the feat/genres-v2-implementation branch from da622f9 to 53605dd Compare February 22, 2026 13:52
@jozefKruszynski jozefKruszynski force-pushed the feat/genres-v2-implementation branch from 53605dd to c888cb8 Compare February 22, 2026 13:58
@jozefKruszynski
Copy link
Contributor Author

@stvncode
I just pushed the rebased version. FYI backend was already merged into dev so if you pull the latest server code dev branch and then pull the latest changes from this branch, things should then all work as expected.

@stvncode
Copy link
Contributor

@jozefKruszynski ok thanks, i had just pulled your be pr but on dev it works better! But i still have two errors on link alias and add alias:
Screenshot 2026-02-22 at 15 14 26
Screenshot 2026-02-22 at 15 14 37

@jozefKruszynski
Copy link
Contributor Author

I'll get right on it

@jozefKruszynski
Copy link
Contributor Author

jozefKruszynski commented Feb 22, 2026

Both actions work fine for me, perhaps the DB migratio did not complete properly in the backend

@jozefKruszynski
Copy link
Contributor Author

jozefKruszynski commented Feb 22, 2026

Which in itself is not good, do you have a backup of your .music_assistant folder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants