Skip to content

Commit

Permalink
Merge pull request #1 from TheTimeWalker/fix-print-crash
Browse files Browse the repository at this point in the history
Default to disc/track no. 1 if beefweb does not return number and move print volume into try
  • Loading branch information
ther0n committed Apr 14, 2022
2 parents 8b6370e + 8e14377 commit 92e9aaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions beefweb_mpris/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def metadata(self) -> ValidMetadata:
artists=[columns.artists],
album=columns.album,
album_artists=[columns.album_artist],
disc_no=int(columns.disc_no),
track_no=int(columns.track_no)
disc_no=int(columns.disc_no) if columns.disc_no.isdigit() else 1,
track_no=int(columns.track_no) if columns.track_no.isdigit() else 1
)
except AttributeError as e:
return MetadataObj(
Expand Down Expand Up @@ -151,8 +151,8 @@ def get_art_url(self, track: int) -> str:
return f'file:https://{GLib.get_user_cache_dir()}/beefweb_mpris/{self.beefweb.active_item.columns.album}'

def get_volume(self) -> VolumeDecimal:
print("returning volume: ", self.beefweb.state.volume.value)
try:
print("returning volume: ", self.beefweb.state.volume.value)
return self.beefweb.state.volume.value + 100.0
except AttributeError:
return 100
Expand Down

0 comments on commit 92e9aaa

Please sign in to comment.