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

add composer_sort and arranger_sort fields #2519

Closed
dosoe opened this issue Apr 15, 2017 · 13 comments
Closed

add composer_sort and arranger_sort fields #2519

dosoe opened this issue Apr 15, 2017 · 13 comments
Labels
feature features we would like to implement

Comments

@dosoe
Copy link
Contributor

dosoe commented Apr 15, 2017

Hi!
Could it be possible to add a composer_sort and arranger_sort field corresponding to the composer and arranger fields? I am trying to understand the code to add it myself but I'm not really a programmer so I'm a bit lost in all this code.
Thanks for this awesome music tagger!
Dorian

@sampsyo
Copy link
Member

sampsyo commented Apr 15, 2017

Thanks for the request! This is most closely related to #2333.

@sampsyo sampsyo added the feature features we would like to implement label Apr 15, 2017
@dosoe
Copy link
Contributor Author

dosoe commented Apr 15, 2017

I think that most generally each time there is an artist name there should be the corresponding _sort name, if it doesn't add substantial work.

@sampsyo
Copy link
Member

sampsyo commented Apr 15, 2017

Yep! It's just a matter of someone doing the coding. 😃

@dosoe
Copy link
Contributor Author

dosoe commented Apr 15, 2017

I would be interested, but I don't understand the code so far... I pulled it but I have to try around before pushing anything. Discovered git 2 weeks ago.

@sampsyo
Copy link
Member

sampsyo commented Apr 15, 2017

Great. Please let us know if there's anything in the code we can help clarify. One good place to start is the Hacking page in the wiki.

@dosoe
Copy link
Contributor Author

dosoe commented Apr 15, 2017

Well I have a big music collection that could be used for benchmarking, for example concerning this guy: #2487

@dosoe
Copy link
Contributor Author

dosoe commented May 11, 2017

Hi! I'm trying to understand who does what in the code of beets, but I don't really succeed. Since what I'm interested in involves fetching metadata and tagging (and not matching), could you please tell me where in the code this is done? I have another question as well: on this tag mapping https://picard.musicbrainz.org/docs/mappings/ there are a number of tags, but if i want to add more tags (like arranger_sort for example) , can it be done and if yes, how? I did a try adding a composer_sort tag (#2529), but it didn't pass the tests. What are these tests doing, how can I correct the code?
I'm new to beets and to programming anything that's not a numerical simulation, so maybe I'm asking stupid questions or making stupid mistakes.

@sampsyo
Copy link
Member

sampsyo commented May 11, 2017

I'm interested in involves fetching metadata and tagging (and not matching), could you please tell me where in the code this is done?

That would be in the beets.autotag.mb module, where we interface with the MusicBrainz API, and in the apply_metadata/apply_item_metadata functions in beets.autotag, where we transfer those results onto files.

It actually looks like you got most of the way there in #2529—the CI is now just suggesting style edits. You can read about the style guide in the Hacking page I linked to above (and even run flake8 locally). In that particular case, it's just one line that's slightly too long: https://travis-ci.org/beetbox/beets/jobs/227173206#L882

@dosoe
Copy link
Contributor Author

dosoe commented May 12, 2017

That one was rather easy because I just had to transpose #2333 on a new tag and composer_sort is in picard's tag mapping. How do I do it if I want to add tags that are not in the mapping?

@sampsyo
Copy link
Member

sampsyo commented May 12, 2017

Ah, I see! To summarize, the challenge is actually that there is no standard (even a de facto standard) for what the tag should be in each format, right? I guess the thing to do then is to have a discussion here—propose some tag names based on the existing ones, and then we can all weigh in and try to find existing software that we might want to try to be compatible with.

@dosoe
Copy link
Contributor Author

dosoe commented May 12, 2017

Yes, pretty much. Now in the command "beet info" there is this option "l" (shows library fields instead of tags according to beet info -h), what is this? Is this the info that doesn't fit into tags? As far as I can tell there are more library fields than tags.
And by the way is there somewhere a list of programms that are beets-compatible (i. e. can read the tags or even better the library)?
I just played around to add arranger_sort and lyricist_sort and so far I had to modify beets.autotag.init.py , beets.autotag.mb.py and beets.library.py . The tags get set in beets.mediafile.py , which I did modify to add composer_sort but don't know how to modify for arranger_sort and lyricist_sort.
Please tell me if I forgot something.
I use beets only for organizing my music so it's not a problem if these tags are not written into the files but just into some library file, but other people might be interested.

@dosoe
Copy link
Contributor Author

dosoe commented May 12, 2017

By the way, when I do beet import -W (don't write tags to files), the tags are just stored in the database file right?

@sampsyo
Copy link
Member

sampsyo commented May 13, 2017

Yes! Beets uses a library database that's separate from the metadata. In fact, you can store anything you like in the library—not just the fixed set of attributes that files support. This capability is called flexible attributes, and it might be the right choice for the new data you've mentioned. If you just do item.foo = 'bar', you implicitly create a new flexible attribute called foo—no setup required.

And yes, that's exactly what -W does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature features we would like to implement
Projects
None yet
Development

No branches or pull requests

2 participants