diff --git a/CHANGELOG.md b/CHANGELOG.md index e3efa1a..858ac28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +##3.0.1 + +Remove accidental print statement in search3 return path, fix song parsing + ##3.0.0 Use new media.Playlist object for interacting with playlists. All status only returns now return True on success. diff --git a/src/libopensonic/connection.py b/src/libopensonic/connection.py index d2d991e..953e603 100644 --- a/src/libopensonic/connection.py +++ b/src/libopensonic/connection.py @@ -538,7 +538,6 @@ def search3(self, query, artistCount=20, artistOffset=0, albumCount=20, res = self._doInfoReq(req) self._checkStatus(res) found = {'artists': [], 'albums': [], 'songs': []} - print(str(res)) if 'artist' in res['searchResult3']: for entry in res['searchResult3']['artist']: found['artists'].append(Artist(entry)) diff --git a/src/libopensonic/media/song.py b/src/libopensonic/media/song.py index 38d2ca8..9b8b23a 100644 --- a/src/libopensonic/media/song.py +++ b/src/libopensonic/media/song.py @@ -38,14 +38,14 @@ def __init__(self, info): self._album_artists.append(artist.Artist(entry)) self._is_dir = get_key(info, 'isDir') self._created = get_key(info, 'created') - self._duration = get_key(info, 'duration') + self._duration = int(info['duration']) if 'duration' in info else 0 self._bit_rate = get_key(info, 'bitRate') self._size = get_key(info, 'size') self._suffix = get_key(info, 'suffix') self._content_type = get_key(info, 'contentType') self._is_video = get_key(info, 'isVideo') self._path = get_key(info, 'path') - self._track = get_key(info, 'track') + self._track = int(info['track']) if 'track' in info else 1 self._type = get_key(info, 'type') self._year = get_key(info, 'year') super().__init__(info)