|
a/src/mediaserver/cdplugins/gmusic/session.py |
|
b/src/mediaserver/cdplugins/gmusic/session.py |
|
... |
|
... |
94 |
|
94 |
|
95 |
def get_user_playlist_tracks(self, playlist_id):
|
95 |
def get_user_playlist_tracks(self, playlist_id):
|
96 |
self._get_user_library()
|
96 |
self._get_user_library()
|
97 |
data = self.api.get_all_user_playlist_contents()
|
97 |
data = self.api.get_all_user_playlist_contents()
|
98 |
#self.dmpdata("user_playlist_content", data)
|
98 |
#self.dmpdata("user_playlist_content", data)
|
99 |
trkl = [item['tracks']
|
99 |
entries = []
|
|
|
100 |
for item in data:
|
100 |
for item in data if item['id'] == playlist_id]
|
101 |
if item['id'] == playlist_id:
|
|
|
102 |
entries = item['tracks']
|
|
|
103 |
break
|
101 |
if not trkl:
|
104 |
if not entries:
|
102 |
return []
|
105 |
return []
|
103 |
try:
|
106 |
tracks = []
|
104 |
return [self.lib_tracks[track['trackId']] for track in trkl[0]]
|
107 |
for entry in entries:
|
105 |
except:
|
108 |
if entry['deleted']:
|
106 |
return []
|
109 |
continue
|
107 |
|
110 |
if entry['source'] == u'1':
|
|
|
111 |
tracks.append(self.lib_tracks[entry['trackId']])
|
|
|
112 |
else:
|
|
|
113 |
tracks.append(_parse_track(entry['track']) )
|
|
|
114 |
return tracks
|
|
|
115 |
|
108 |
def create_station_for_genre(self, genre_id):
|
116 |
def create_station_for_genre(self, genre_id):
|
109 |
id = self.api.create_station("station"+genre_id, genre_id=genre_id)
|
117 |
id = self.api.create_station("station"+genre_id, genre_id=genre_id)
|
110 |
return id
|
118 |
return id
|
111 |
|
119 |
|
112 |
def get_user_stations(self):
|
120 |
def get_user_stations(self):
|