-
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
Add customisable disambiguation strings for importer #4547
Conversation
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Let's keep this alive, please! |
Sorry I've been really busy as my semester gets into gear. I need to sit down and go through a bunch of these PRs. |
Oh yes, thanks for stopping the close @sampsyo, I also came across this feature draft and thought it's very useful and I wished for something like that. Currently I have a distantly related thing going on. Some tiny improvements to the disambiguation string when importing singletons: https://github.com/beetbox/beets/pull/4717/files#diff-e324b20657a7d6b43b8b7aeb5754b96774f5062294b5ba7f1e3062845e9e7044R215-R220 and probably that made me find this PR. Awesome idea @Serene-Arc ! The questions you raise are good one's. My two cents:
|
Some context. This is how the string is presented in the new UI idea and I thought that for example the catalognumber which for me is one of the most important one's I look at when decidingwhich album to choose, I wished to be the first or second field from the left:
With the current UI it looks lik this and I could also imagine that having catalog right after the album name could help:
But actually I have to admit: I changed everything back after my experiments and am happily using the default ordering, since I'm so used to it actually ;-) This all is just my personal ideas and shouldn't stop you from realising a slightly less advanced idea. We could always move on from your change if we want it / if someone would refactor this again. So, just a little brainstorming here and HTH. |
Hi @Serene-Arc, since I finally merged a PR that changes the disambiguation string for singletons I kind of feel motivated to review and brainstorm around this feature idea :-) This is how the thing looks like atm: Lines 187 to 228 in c03bd26
In short we could say that I added prefixes to the actual data being added to the disambiguation string for singletons. What do you think of addressing your bullet point here:
by adding another config option that allows to set a prefix for each value in the list of disambiguation strings. If you think that sounds like a clumsy approach, we could brainstorm about a better form of describing a "pair" of prefix+value in yaml. |
Actually, a solution that I found for a similar problem in the beets-audible project might work! We can link all of the keys to callback functions. So if someone uses the key 'medium', we can have a specific function that calls up the processing needed. Keys that don't require any pre-processing can be transparently passed through. Of course, this will require a lot of work if there are many keys that need custom functions but these can be added piecemeal if needed. Since there isn't any functionality so far for any other keys in the disambiguation, users shouldn't notice the lack if we want to take our time. Is this similar to what you had in mind with the prefixes (what I presume i'm calling keys)? |
Hi @Serene-Arc thanks for getting back on this. With "prefix" I rather mean a user-customizable string written before the actual value of the field. I think your idea is to automatically pollute these prefixes with the keys of the actual beets fields. Did I understand correctly? Let's take an example then it is easier to talk about it. have alook on the new features I merged for singleton imports: #4854 (comment) So I was thinking that the Now with your proposed solution we would get this:
Did I understand correctly that this would be the outcome of your idea? I do understand that for disc-number and medium parsing there is now way around functions that "do the magic". maybe as a first step we keep those in place and focus on the other disambig fields only? Most of them do not have prefixes and with albums I never had a problem with that (album and catalog number being the most important for my personal taste) but now with this advanced singleton+album features I had the need to add "prefixes" to make it better readable. |
I think we're talking about two different parts of the program. Mine is for the disambiguation field which is the part when you're choosing a candidate with the information such as the year, the publisher, and so on. It wouldn't impact the part you posted.
In the above example, the disambiguation string is the part |
Thanks for clarifying. Have a look again at the code I posted above: #4547 (comment) The cli output example I posted is coming from exactly the same function. You are talking about the disambiguation string for albums (starting at line 187) and I am talking about the disambiguation string for singletons (starting at line 218). The information that is useful in either of those strings is somewhat different. So do you think this should be split out into two different functions - one for albums and one for singletons? |
What do you think of that suggestion: You go ahead with your idea proposed before, focusing on the album-disambiguation string. We leave out changing the part for singletons in this PR entirely. Maybe we find out that some parts of your code is useful for the singleton disambiguation-string as well and we then work from there in a new PR. |
c5a634f
to
5cab810
Compare
@JOJ0 I did end up changing the singleton processing in this section. Now they both follow the same logic, but if the default configurations aren't changed, there should be no noticeable effect on the end user. I just need to update the documentation but take a look and see what you think. This should make it pretty easy to add further computed fields if required as well. |
That is an awesome solution. I like it! Thanks |
@JOJ0 great! If you approve, I'll write the documentation and then this can be merged. |
@JOJ0 I believe you wrote the |
Get rid of it please! Dont forget to also remove the docs for it. I'm sure I left some somewhere. Thanks 😊 |
Great, will do. |
@JOJ0 Do you agree that this is ready for merging? |
Description
This adds configurable disambiguation strings when importing. The defaults I've provided are what is currently in place but there are a number of limitations.
beets-audible
plugin, sometimes there are 'None' values that are printed, I haven't managed to narrow down the cause of that yet, but it may be limited to something that that plugin does.If you have any solutions for these, I'd love to hear them! I'll leave it as a draft PR for now since this is very much a work in progress.
To Do
docs/
to describe it.)docs/changelog.rst
near the top of the document.)