beets icon indicating copy to clipboard operation
beets copied to clipboard

Move queries and types to respective modules

Open snejus opened this issue 7 months ago • 1 comments

This PR moves query and type definitions away from library.py to dbcore to improve modularity and organization.

Key Changes:

  • Query and Type Relocation:
    • PathQuery and SingletonQuery moved from beets.library to beets.dbcore.query.
    • DateType, PathType (and its variants NullPathType), MusicalKey, and DurationType moved from beets.library to beets.dbcore.types.
    • The BLOB_TYPE definition was moved from beets.library to beets.dbcore.query and then referenced in beets.dbcore.types.
    • The human_seconds_short utility function was moved from beets.ui to beets.util due to circular dependency.
  • Test Modernization:
    • The PathQueryTest class in test/test_query.py has been rewritten to use pytest.mark.parametrize for more concise and readable test cases.
  • Import Updates: All internal references to these moved classes and functions have been updated across the codebase.

snejus avatar May 11 '25 18:05 snejus

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

github-actions[bot] avatar May 11 '25 18:05 github-actions[bot]

Thank you for the PR! I really appreciate it, this will make our lives much easier in the long run!

semohr avatar Jul 06 '25 13:07 semohr