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

ImportPlaylist creates playlist with only 1 song #40

Open
sjhayman opened this issue Jan 23, 2016 · 5 comments
Open

ImportPlaylist creates playlist with only 1 song #40

sjhayman opened this issue Jan 23, 2016 · 5 comments
Labels

Comments

@sjhayman
Copy link

When I run ImportPlaylist, a new Google Music playlist is created with only 1 song in it, even though the log file says that 4 songs were matched.

I've tried this with both the recommended and head versions of the Google Play Music API.

I've also tried this with a CSV file created by ExportPlaylist, with the same result.

test1_20160123180542.log.zip

@sjhayman
Copy link
Author

In another case, ImportPlaylist creates a playlist with only 3 songs. CSV file was created by ExportPlaylist and contained 22 songs.
test3_20160123181453.log.zip

@soulfx
Copy link
Owner

soulfx commented Jan 29, 2016

hi hayman,

from the logs it appears like you don't have an all access subscription, but that should be okay.

i have a suspicion that it is grabbing the wrong id after it finds the result in the personal library. while putting together the javascript version i discovered that google music likes to use a different track id for uploaded songs and if I try to use the google store id for those songs they won't show up in the playlist. i probably need to backport that functionality into this python version.

for the second log, it didn't do any searches because the ids were already in the csv file, but most likely they are the wrong ids.

there are some fixes, functionality, and features from the javascript version I would like to port back to this version, but until then if you can maybe try the javascript version and see if that works for you.

@soulfx soulfx added the bug label Jan 29, 2016
@sjhayman
Copy link
Author

Hi John,

I tried importing test1 using the javascript version, with no luck. It
seems like it doesn't like the end-of-line character(s) in that file, as
demonstrated by the fact that it treated the whole file as a single song.
Once I edited the file with vi and replaced the end-of-line character with
a vi recognized end-of-line, and added the header line, it imported
perfectly.

Importing test3.csv worked perfectly, which means that porting the fixes
and functionality you added to the Javascript version will likely fix (or
at least improve) the python version.

Thanks very much for looking into this for me!

Cheers,
Scott

On Thu, Jan 28, 2016 at 7:27 PM John Elkins [email protected]
wrote:

hi hayman,

from the logs it appears like you don't have an all access subscription,
but that should be okay.

i have a suspicion that it is grabbing the wrong id after it finds the
result in the personal library. while putting together the javascript
version https://github.com/soulfx/gmusic-playlist.js i discovered that
google music likes to use a different track id for uploaded songs and if I
try to use the google store id for those songs they won't show up in the
playlist. i probably need to backport that functionality into this python
version.

for the second log, it didn't do any searches because the ids were already
in the csv file, but most likely they are the wrong ids.

there are some fixes, functionality, and features from the javascript
version I would like to port back to this version, but until then if you
can maybe try the javascript version and see if that works for you.


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

@sjhayman
Copy link
Author

One more piece of information - I tried importing the updated test1.csv
that worked with the Javascript version of import and it did not work with
the python version.

On Thu, Jan 28, 2016 at 10:00 PM Scott Hayman [email protected] wrote:

Hi John,

I tried importing test1 using the javascript version, with no luck. It
seems like it doesn't like the end-of-line character(s) in that file, as
demonstrated by the fact that it treated the whole file as a single song.
Once I edited the file with vi and replaced the end-of-line character with
a vi recognized end-of-line, and added the header line, it imported
perfectly.

Importing test3.csv worked perfectly, which means that porting the fixes
and functionality you added to the Javascript version will likely fix (or
at least improve) the python version.

Thanks very much for looking into this for me!

Cheers,
Scott

On Thu, Jan 28, 2016 at 7:27 PM John Elkins [email protected]
wrote:

hi hayman,

from the logs it appears like you don't have an all access subscription,
but that should be okay.

i have a suspicion that it is grabbing the wrong id after it finds the
result in the personal library. while putting together the javascript
version https://github.com/soulfx/gmusic-playlist.js i discovered that
google music likes to use a different track id for uploaded songs and if I
try to use the google store id for those songs they won't show up in the
playlist. i probably need to backport that functionality into this python
version.

for the second log, it didn't do any searches because the ids were
already in the csv file, but most likely they are the wrong ids.

there are some fixes, functionality, and features from the javascript
version I would like to port back to this version, but until then if you
can maybe try the javascript version and see if that works for you.


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

@raffraffraff
Copy link

raffraffraff commented Feb 8, 2018

If it's any help... I have the same issue. They Python version uses 'songid' first, and falls back ti 'id' if it does not find a songid.
I guess the reason it uses songid first is that it makes playlists shareable. But if you're not subscribing, then (1) you don't care about sharing and (2) it totally breaks things, giving you partial (or empty) playlists.

Luckily, all you need to do is edit common.py and change the 'create_result_details' function around line 104 of common.py:

# creates result details from the given track
def create_result_details(track):
    result_details = {}
    for key, value in track.iteritems():
        result_details[key] = value
    result_details['songid'] = track.get('id')
    return result_details

I'm not going to send a patch, because for people who have a subscription it'll have a negative effect. I think that the order should be based on a preference (eg: "library_only = True")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants