gmusic-playlist
gmusic-playlist copied to clipboard
ImportPlaylist creates playlist with only 1 song
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.
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
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.
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 https://github.com/soulfx/gmusic-playlist/issues/40#issuecomment-176495421 .
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 https://github.com/soulfx/gmusic-playlist/issues/40#issuecomment-176495421 .
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")