Skip to content

Commit

Permalink
Fix song parsing and remove accidental print in search3 return
Browse files Browse the repository at this point in the history
Signed-off-by: Eric B Munson <[email protected]>
  • Loading branch information
khers committed Jan 15, 2024
1 parent 066557a commit c32814e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/libopensonic/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions src/libopensonic/media/song.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c32814e

Please sign in to comment.