-
Notifications
You must be signed in to change notification settings - Fork 60
Don't use inconsistent albumId
or artistId
#233
Conversation
Codecov Report
@@ Coverage Diff @@
## master #233 +/- ##
==========================================
+ Coverage 59.92% 60.42% +0.50%
==========================================
Files 9 9
Lines 751 748 -3
==========================================
+ Hits 450 452 +2
+ Misses 301 296 -5
Continue to review full report at Codecov.
|
mopidy_gmusic/library.py
Outdated
album_id = create_id(artist.name + name + date) | ||
#album_id = song.get("albumId") | ||
#if album_id is None: | ||
album_id = create_id(artist.name + name + date) |
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.
Assuming that this change is good to go and works with All Access too (I can't confirm, as I don't have a subscription and don't use GMusic), the commented out code should be removed before this is merged.
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 allows for conflicts if the artist, album name, and date are the same. Unlikely, but still possible. One of the reasons I had for sticking to pulling IDs like this from Google if they exist were specifically because of this. One specific example would be for two Various Artists albums with the same name in the same year.
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.
Yeah, I get that there's possibility of conflict. For me though, with only uploaded tracks, this change is way better, and makes the extension work really well, rather than having to wade through all the duplicates.
I don't know how well it works for subscription. I know that, with Spotify, they sometimes have the same album on there multiple times. If gmusic does that, then that could potentially cause problems.
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.
FYI Weezer released two self-titled albums last year. 🙄
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.
Other than that, I think it's extremely unlikely that someone will have uploaded two conflicting albums. And, if they have, this change is still an overall improvement, in my opinion.
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.
I'm not a huge fan of knowingly breaking things, but considering it's broken in other more obvious ways, I can get behind this.
My one request - can you use some sort of separator (like : or |) between the fields? I think it will make it a bit more stable and make the IDs easier to read if we're ever debugging.
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 use some sort of separator (like : or |) between the fields?
Sound like a good idea. I'll do that.
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.
I'll go with the |
as I've got at least one album with :
in the title.
Various Artists|Fat Music, Vol. 5: Live Fat Die Young|2001
mopidy_gmusic/library.py
Outdated
logger.info("Loaded " | ||
f"{len(self.artists)} artists, " | ||
f"{len(self.albums)} albums, " | ||
f"{len(self.tracks)} tracks from Google Play Music") |
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.
I added some logging. Now you get:
INFO 2020-03-09 00:12:42,160 [1:GMusicBackend-6] mopidy_gmusic.session
Logged in to Google Play Music
INFO 2020-03-09 00:12:42,161 [1:Thread-8] mopidy_gmusic.library
Refreshing library
INFO 2020-03-09 00:12:55,224 [1:Thread-8] mopidy_gmusic.library
Loaded 442 artists, 1036 albums, 8439 tracks from Google Play Music
INFO 2020-03-09 00:12:57,881 [1:Thread-9] mopidy_gmusic.playlists
Loaded 5 playlists from Google Play Music
Thank you :-) |
Yep I use AllAccess, and exactly this issue is now happening. |
I've been trying to set up Mopidy with Iris and GMusic to successfully work over my LAN. So far so good except GMusic is acting crazy ! I've successfully logged in and referenced my refresh token. I am successfully listing my GMusic library however, if I try to browse and Artist nothing shows up and when I refresh the page it will come up with an error "Could not find Artist with URI" When I inspect the webcode going on I'm getting a ton of error regarding CORS policy. Could my problem be related to this ? EDIT: I've implemented the changes indicated here to my file, restarted the service and GMusic seems to be behaving properly now, it's listing the the tracks under the artists and albums (although I had only noticed the issue with the Artists) |
@syntax45170 the current release (4.0.0) doesn't work. You need to install the latest code from master. |
Can confirm. I've updated the library.py file with the one in from master and everything seems to be working fine, maybe a little slow (might be caused by the RPi 3B+) but at least it is correctly fetching the info from the Google servers |
Fixes #139
Fixes #206
The
albumId
orartistId
doesn't always exist. They sometimes exists for some tracks in an album, but not others. This causes new IDs to be generated, which means those tracks are shown as being by a separate artist and in a separate album.All I've done here is make it always generate an
artistId
andalbumId
, never using the one that may exist from gmusic.Does anyone know if this is an issue for All Access (called subscription now?)? I'm thinking that the IDs might always be sent back for AA tracks. If that's the case, we should probably do something like: