Skip to content

Commit

Permalink
Merge pull request #7 from sonofevil/patch-2
Browse files Browse the repository at this point in the history
Updated property names
  • Loading branch information
ther0n committed May 14, 2024
2 parents 2f2e0c6 + d647895 commit 8382dc4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions beefweb_mpris/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from math import log
from mpris_server import MetadataObj, ValidMetadata
from mpris_server.adapters import MprisAdapter
from mpris_server.base import Microseconds, PlayState, DbusObj, DEFAULT_RATE, RateDecimal, VolumeDecimal, Track, \
from mpris_server.base import Microseconds, PlayState, DbusObj, DEFAULT_RATE, Rate, Volume, Track, \
DEFAULT_TRACK_ID
from mpris_server.mpris.compat import get_track_id
from gi.repository import GLib
Expand Down Expand Up @@ -113,22 +113,22 @@ def set_loop_status(self, val: str):
elif val == "Playlist":
self.beefweb.client.set_player_state(playback_mode=1)

def get_rate(self) -> RateDecimal:
def get_rate(self) -> Rate:
return DEFAULT_RATE

def set_rate(self, val: RateDecimal):
def set_rate(self, val: Rate):
pass

def set_minimum_rate(self, val: RateDecimal):
def set_minimum_rate(self, val: Rate):
pass

def set_maximum_rate(self, val: RateDecimal):
def set_maximum_rate(self, val: Rate):
pass

def get_minimum_rate(self) -> RateDecimal:
def get_minimum_rate(self) -> Rate:
pass

def get_maximum_rate(self) -> RateDecimal:
def get_maximum_rate(self) -> Rate:
pass

def get_shuffle(self) -> bool:
Expand All @@ -150,14 +150,14 @@ def get_art_url(self, track: int) -> str:
self.beefweb.download_art()
return f'file:https://{GLib.get_user_cache_dir()}/beefweb_mpris/{self.beefweb.active_item.columns.album}'

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

def set_volume(self, val: VolumeDecimal):
def set_volume(self, val: Volume):
# I don't know what im doing but it works kinda
new_vol = 0 - (100 ** (1 - val))
print(new_vol)
Expand Down

0 comments on commit 8382dc4

Please sign in to comment.