Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi genres / only "genres" field wip #5606

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Multi genres / only "genres" field wip #5606

wants to merge 1 commit into from

Conversation

snejus
Copy link
Member

@snejus snejus commented Jan 27, 2025

No description provided.

@snejus snejus self-assigned this Jan 27, 2025
@snejus snejus requested review from JOJ0 and wisp3rwind January 27, 2025 11:38
@snejus snejus marked this pull request as draft January 27, 2025 11:39
@snejus snejus removed request for JOJ0 and wisp3rwind January 27, 2025 11:40
@snejus snejus mentioned this pull request Jan 27, 2025
3 tasks
@JOJ0 JOJ0 mentioned this pull request Jan 31, 2025
3 tasks
@snejus snejus requested a review from Copilot March 20, 2025 21:33

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request migrates genre handling by replacing the singular "genre" field with the plural "genres" field across the codebase. Key changes include:

  • Introducing a new property "genre" that wraps the underlying "genres" field in LibModel.
  • Updating getter functions and field definitions in Item, Album, and related modules to use "genres".
  • Adjusting tests and autotag hooks to reflect the new "genres" field format.

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
beets/dbcore/db.py Changed field update methods to use setattr instead of dict-style assignment and updated setattr logic.
beets/library.py Added a property for genre and updated _getters as well as field definitions for Item and Album.
beets/dbcore/types.py Modified DelimitedString type by introducing a normalize method before serializing to SQL.
beets/autotag/mb.py Replaced usage of "genre" with "genres" in metadata construction.
beets/autotag/hooks.py Adjusted TrackInfo initialization to set genres from genre, ensuring a list is stored.
beets/autotag/init.py Updated field assignment from dict-style to attribute assignment using setattr.
test/test_library.py Updated tests to handle changed field names from "genre" to "genres".
test/test_sort.py Modified sorting tests to validate on label changes instead of genre.
test/test_ui.py Adjusted update tests to target the "genres" field.
Files not reviewed (1)
  • docs/changelog.rst: Language not supported
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