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

Feature/extra tags #559

Merged
merged 14 commits into from
Nov 14, 2013
Merged

Feature/extra tags #559

merged 14 commits into from
Nov 14, 2013

Conversation

ZenithDK
Copy link
Contributor

@ZenithDK ZenithDK commented Nov 2, 2013

Add support for the genre, composer, and performer tags into mopidy.
Added tests as well.

@ZenithDK ZenithDK mentioned this pull request Nov 2, 2013
@txomon
Copy link
Member

txomon commented Nov 2, 2013

I created #507 in order to avoid having to extend the model infinitelly for such cases, thought it is quite uncomplete and needs maturing, if we add all the fields we need to map into the models, we will end up with lots of parameters undefined for a great buch of backends.

@ZenithDK
Copy link
Contributor Author

ZenithDK commented Nov 2, 2013

@txomon I think I get the idea of #507, but what I have implemented with this, and also albumartist, is just to cover the basics supported by MPD: http://mpd.wikia.com/wiki/MusicPlayerDaemonCommands#Scope_specifiers

I think the list MPD supports is here: http://git.musicpd.org/cgit/master/mpd.git/tree/src/tag.h?h=v0.17.x
All that is missing now is the _SORT versions of artist and albumartist (if we want them) and then "comment".

If this goes in, I plan to get comment done - and them I think I am happy.

Should I understand the metadata support to be the best way forward to querying for tags not common to all the backends? I definitely see the idea in that.

@txomon
Copy link
Member

txomon commented Nov 2, 2013

Yeah, my idea was mainly to release the models from the most possible fields, so that we could have very tiny objects, and that each frontend could select what did he actually required.

I say this because for example, on the mpd frontend, for the playlistinfo command, you just can say 3 or 4 things, not really anything about albumartist, etc. On the other side, on the http frontend, you might require all of the fields.

In this way, we could also put per-backend metadata, so that if a frontend is developed for a backend, it could also get the extra information on an standard way.

@ZenithDK
Copy link
Contributor Author

ZenithDK commented Nov 2, 2013

That makes a lot of sense....darn! :)
This means a lot more work, but I agree it is much more maintainable going forward and less complexity.

@jodal
Copy link
Member

jodal commented Nov 2, 2013

I'm interested in merging this now and maybe extract some of it from the models again when we have a better generic metadata system.

@ZenithDK Can you merge in develop and resolve the conflicts?

@ZenithDK
Copy link
Contributor Author

ZenithDK commented Nov 2, 2013

@jodal - yes, no worries.
Merging the test cases are going to be a big bother, but here goes...

Oh, will you handle these new tags in mopidy-spotify as you also did for albumartist?

@jodal
Copy link
Member

jodal commented Nov 2, 2013

I don't think there's anything to change in mopidy-spotify as libspotify doesn't expose any of these new fields.

@ZenithDK
Copy link
Contributor Author

ZenithDK commented Nov 2, 2013

I just saw that you mapped albumartist to artist for the spotify backend I believe? I may be mistaken...

@jodal
Copy link
Member

jodal commented Nov 2, 2013

Yes, I did. Spotify does have a concept about albums and the artist of the album. Though, Spotify does not have a concept about genre, composer, or performer, so I don't think there's anything to do in mopidy-spotify for this change.

@ZenithDK
Copy link
Contributor Author

ZenithDK commented Nov 3, 2013

I've made it possible to use the comment tag for searching also - that seems to be a common work-around when people want extra tags not in ID3v2 - them dump it in the comment tag instead.

@ZenithDK
Copy link
Contributor Author

ZenithDK commented Nov 3, 2013

Very unfortunate that all the tests can pass, even though I had some missing regexps :-S
Not much we can do about that except either manual testing or going a lot more crazy with the tests in music_db_test.py - will ponder this more...now for sleeping...

@ZenithDK
Copy link
Contributor Author

ZenithDK commented Nov 7, 2013

When this is merged, we should update the documentation similar to what @kingosticks mentions in #543

result_tracks += [_artist_as_track(a) for a in _get_artists(results)]
if 'album' not in query:
if 'album' not in query and 'genre' not in query:
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you want albums in the result when genre is in the search query?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I guess I don't need to filter really - but my thinking was along the lines of albums not having genres?
The genre relates to the track, right?
So in reality we will never get a hit on an album?

@@ -21,7 +21,6 @@ def test_currentsong(self):
self.assertInResponse('Title: ')
self.assertInResponse('Album: ')
self.assertInResponse('Track: 0')
self.assertInResponse('Date: ')
Copy link
Member

Choose a reason for hiding this comment

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

Maybe keep it, but change to assertNotInResponse?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted.

@jodal
Copy link
Member

jodal commented Nov 11, 2013

+1, with comments

@ZenithDK
Copy link
Contributor Author

There's only one thing left for the tags now - that's to see if anyone has some multi-genre tracks.
I've seen tracks tagged with multiple genres, but using a non ID3v2 tag - so the scanner didn't pick it up.

I would like to do that work in a separate PR though, if okay.

@jodal jodal merged commit f5e94d8 into mopidy:develop Nov 14, 2013
@ZenithDK ZenithDK deleted the feature/extra_tags branch November 16, 2013 00:17
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.

None yet

3 participants