Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Not all albums listed #63

Closed
lcvisser opened this issue Sep 9, 2014 · 11 comments
Closed

Not all albums listed #63

lcvisser opened this issue Sep 9, 2014 · 11 comments
Labels
C-bug Category: This is a bug

Comments

@lcvisser
Copy link

lcvisser commented Sep 9, 2014

In response to this: #47

The contents of the Google Music folder doesn't seem to match my library, nor does it seem to be consistent between folders. E.g., the folder Google Music/SomeArtist/Albums and the folder Google Music/Albums don't match up.
Example:

$ mpc ls Google\ Music/Artists/The\ Ben\ Miller\ Band
Google Music/Artists/The Ben Miller Band/All Tracks
Google Music/Artists/The Ben Miller Band/Ben Miller Band - Any Way, Shape Or Form
Google Music/Artists/The Ben Miller Band/The Ben Miller Band - Heavy Load
$ mpc ls Google\ Music/Albums
Google Music/Albums/Creedence Clearwater Revival - The Ultimate Creedence Clearwater Revival [Disc 1]
Google Music/Albums/Creedence Clearwater Revival - The Ultimate Creedence Clearwater Revival [Disc 2]
Google Music/Albums/Elvis Presley - Legendary Elvis Presley [Disc 1]
Google Music/Albums/Johnny Cash - Complete Live At San Quentin
Google Music/Albums/Michael Jackson - Bad
Google Music/Albums/Michael Jackson - Blood On The Dance Floor: HIStory In The Mix
Google Music/Albums/Michael Jackson - Dangerous
Google Music/Albums/Michael Jackson - HIStory: Greatest Hits, Vol. 1 [Disc 1]
Google Music/Albums/Michael Jackson - Off The Wall
Google Music/Albums/Muddy Waters - Take A Walk With Me
Google Music/Albums/Phil Collins - Hits
Google Music/Albums/Phil Collins - Hits [2]
Google Music/Albums/Red Hot Chili Peppers - Californication
Google Music/Albums/The Allman Brothers Band - At Fillmore East [Disc 1]
Google Music/Albums/ZZ Top - Tres Hombres
Google Music/Albums/Zucchero - All The Best

The ls of Google\ Music/Albums given above is all that I get: I get only 16 albums, none of which are of The Ben Miller Band.

@fusenuk
Copy link

fusenuk commented Jun 6, 2015

I'm seeing this as well when I choose 'Browse' then select 'Google Music'. My actual Google Music Library has 1291 albums where as Mopidy is showing roughly 500.

@elrosti
Copy link

elrosti commented Aug 4, 2015

I'm seeing this behavior too.

@elrosti
Copy link

elrosti commented Aug 7, 2015

I fix this modifying the file library.py and adding the line

 self.albums[album.uri] = album

This is the portion of code:

        try:
            album = self._aa_to_mopidy_album(song)
            self.albums[album.uri] = album
            return album
        except KeyError:

I then found the problem that songs from same album have a diferent albumId, so I comment those lines and just use the key "artist.name + album name". Here is my complete method rewrite.

    def _to_mopidy_album(self, song):
        # First try to process the album as an aa album
        # (Difference being that non aa albums don't have albumId)
        #try:
        #    album = self._aa_to_mopidy_album(song)
        #    self.albums[album.uri] = album
        #    return album
        #except KeyError:
        name = song['album']
        artist = self._to_mopidy_album_artist(song)
        date = unicode(song.get('year', 0))
        uri = 'gmusic:album:' + self._create_id(artist.name + name)
        images = self._get_images(song)
        album = Album(
            uri=uri,
            name=name,
            artists=[artist],
            num_tracks=song.get('totalTrackCount', 1),
            num_discs=song.get(
                'totalDiscCount', song.get('discNumber', 1)),
            date=date,
            images=images)
        self.albums[uri] = album
        return album

@fusenuk
Copy link

fusenuk commented Aug 7, 2015

thanks elrosti, I've applied your proposed changes and it appears to be
working!

Regards
Mickey

On 7 August 2015 at 16:14, elrosti notifications@github.com wrote:

I fix this modifying the file library.py and adding the line

self.albums[album.uri] = album

This is the portion of code:

    try:
        album = self._aa_to_mopidy_album(song)
        self.albums[album.uri] = album
        return album
    except KeyError:

I then found the problem that songs from same album have a diferent
albumId, so I comment those lines and just use the key "artist.name +
album name". Here is my complete method rewrite.

def _to_mopidy_album(self, song):
    # First try to process the album as an aa album
    # (Difference being that non aa albums don't have albumId)
    #try:
    #    album = self._aa_to_mopidy_album(song)
    #    self.albums[album.uri] = album
    #    return album
    #except KeyError:
    name = song['album']
    artist = self._to_mopidy_album_artist(song)
    date = unicode(song.get('year', 0))
    uri = 'gmusic:album:' + self._create_id(artist.name + name)
    images = self._get_images(song)
    album = Album(
        uri=uri,
        name=name,
        artists=[artist],
        num_tracks=song.get('totalTrackCount', 1),
        num_discs=song.get(
            'totalDiscCount', song.get('discNumber', 1)),
        date=date,
        images=images)
    self.albums[uri] = album
    return album


Reply to this email directly or view it on GitHub
#63 (comment)
.

@jodal jodal added the C-bug Category: This is a bug label Sep 25, 2015
@ikogan
Copy link

ikogan commented Feb 22, 2016

This PR also fixed an issue I had with the same album showing up multiple times but only one with the correct ID (and thus only one actually being able to load it's contents) as well as some albums being completely unable to load for the same reason.

@jjok
Copy link
Contributor

jjok commented Jun 26, 2016

Does the code above fix the issue? Was there a PR?

@lcvisser
Copy link
Author

The raspberry pi that I had mopidy running on is kind of out of service, so I can't verify if the issue is resolved. It seems @fusenuk has reproduced the bug and verified that the fix proposed by @elrosti works, so I guess the issue can be closed...

@jjok
Copy link
Contributor

jjok commented Jun 27, 2016

I'm still experiencing the issue. As far as I can tell, there wasn't ever a PR. The potential fix was just added above.

@jjok
Copy link
Contributor

jjok commented Jun 27, 2016

@elrosti Could you open a pull request, if you have a fix, please?

@ikogan
Copy link

ikogan commented Jun 27, 2016

I'm sorry, I misspoke, the code in this issue from @elrosti fixed the issue for me. I could setup a PR but it'll take a bit as I'm a bit busy at the moment.

@belak
Copy link
Contributor

belak commented Jul 2, 2016

The fix above isn't a complete fix. There's definitely some issues with the local cache, but I'm fairly certain the above code breaks with All Access tracks.

EDIT: I've got a re-working of the internal caching going into a PR soon. It should fix this. As far as I can tell, uploaded tracks count towards the albums list, but All Access albums never get cached, so they never show up in the albums list.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

7 participants