-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Implement multi-value genres tag #5426
base: master
Are you sure you want to change the base?
Implement multi-value genres tag #5426
Conversation
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. |
4b84406
to
7ef0726
Compare
That makes sense, thanks for the clarification!
…On Friday, September 20, 2024, Rylee ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/test_library.py
<#5426 (comment)>:
> self._assert_dest(b"/base/Pop")
def test_first_skip(self):
- self.i.genres = "Pop; Rock; Classical Crossover"
- self._setf("%first{$genres,1,2}")
+ self.i.sub_genres = "Pop; Rock; Classical Crossover"
+ self._setf("%first{$sub_genres,1,2}")
The tests are testing the %first{} function extracting from a string
split on ; . Genres was the tag used for the tests initially, but now
genres is a MULTI_VALUE_DSV which is separated by null characters instead.
Rather than rewriting the tests both to the full
%first{text,count,skip,sep,join} format to specify the null character
separator, which would be changing whats being tested, the original author
just swapped out the genres tag for a nonexistent sub_genres tag which
would continue to work as a standard string for %first to act on.
—
Reply to this email directly, view it on GitHub
<#5426 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACJFY5YIKQOCKXT67PTHLZXTKQRAVCNFSM6AAAAABOPR74YGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMJZGYZDIOBSHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Christopher Larson
***@***.***, ***@***.***
Principal Software Engineer, Embedded Linux Solutions, Siemens Digital
Industries Software
|
@@ -708,13 +708,13 @@ def test_if_def_false_complete(self): | |||
self._assert_dest(b"/base/not_played") | |||
|
|||
def test_first(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try and test this %first{}
function with the new genres
field, to show how the user may use it to extract the first genre?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the only way to use %first
with these MULTI_VALUE_DSV
fields is this (for the record, that doesn't even work for me and I have to do %first{%first{$albumartists,1,0,␀},1,0,\\}
in my own config) which I think is pretty awful, not documented anywhere and not even confirmed as the intended method.
Without it being confirmed that that is the intended method of use, or a future improvement to the ergonomics, I wouldn't want to encode this in a test as the expected usage. This PR just brings up the genres field to the same state as the artists field, and any work beyond that is out of scope.
7ef0726
to
d4175f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice and tiny PR, thanks @ibrokemypie!
@@ -20,6 +20,7 @@ New features: | |||
* :doc:`plugins/autobpm`: Add new configuration option ``beat_track_kwargs`` | |||
which enables adjusting keyword arguments supplied to librosa's | |||
``beat_track`` function call. | |||
* New multi-value `genres` tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand a bit here, maybe with an example that shows why it's useful? The point of such a tag should be made obvious to end users scrolling through.
Description
Resurrects #4751. Rebased just the genre field changes on to master.
"Adds support for setting the genre tag to be either a single or multi."
To Do
docs/
to describe it.)docs/changelog.rst
to the bottom of one of the lists near the top of the document.)