-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix album art on GNOME by caching in $HOME/.cache/beefweb_mpris/{al…
…bum art}, directory is cleared when exiting - Other fixes like volume control and shuffle/repeat
- Loading branch information
Theron Tjapkes
committed
Aug 26, 2021
1 parent
4e5ba30
commit 8b6370e
Showing
6 changed files
with
105 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from typing import Optional | ||
|
||
from mpris_server.adapters import MprisAdapter | ||
from mpris_server.events import EventAdapter | ||
from mpris_server.server import Server | ||
from pyfoobeef.models import PlayerState | ||
from beefweb_mpris.beefweb import Beefweb | ||
|
||
|
||
class BeefwebEventHandler(EventAdapter): | ||
def __init__( | ||
self, | ||
beefweb: Beefweb, | ||
server: Server, | ||
adapter: Optional[MprisAdapter] = None | ||
): | ||
self.beefweb = beefweb | ||
self.server = server | ||
self.adapter = adapter | ||
super().__init__(self.server.player, self.server.root) | ||
|
||
def new_player_state(self, state: PlayerState): | ||
self.on_player_all() | ||
|
||
|
||
def register_event_handler( | ||
beefweb: Beefweb, | ||
server: Server, | ||
adapter: MprisAdapter | ||
): | ||
event_handler = BeefwebEventHandler(beefweb, server, adapter) | ||
beefweb.register_event_handler(event_handler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ mpris_server | |
pyfoobeef | ||
pyyaml | ||
pygobject | ||
pygobject-stubs | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters