diff --git a/README.md b/README.md index 789a27e..5cb4b2b 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,15 @@ Issues and pull-requests are not synced. ### Features (Implemented & Planned) -| Feature | Description | State | -|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------| -| Playlists | You can create and load `.m3u` playlists, edit them and they will get stored on the disk automatically. | Implemented | -| Background Job Monitor | A QDockWidget where background processes are listed. | Implemented | -| MPRIS Integration | Basic MPRIS integration (Partial Metadata, Play, Pause, Stop, Next, Previous) | Partially Implemented | -| Audio effects | Audio effects like normalizing and an equalizer. This can be implemented pretty easily because Wobuzz uses [Pydub](https://pydub.com/), which has these effects built in. | Not Implemented | -| Soundcloud downloader | A simple Soundcloud-downloader like maybe integrating [SCDL](https://pypi.org/project/scdl/) would be really cool. | Not Implemented | -| Synchronisation between devices | This should be pretty hard to implement and idk. if i will ever make it, but synchronisation could be pretty practical e.g. if you have multiple audio systems in different rooms. | Not Implemented | -| Audio visualization | Firstly, rather simple audio visualization like an oscilloscope would be cool, also something more complicated like [ProjectM](https://github.com/projectM-visualizer/projectm) could be integrated. | Not Implemented | +| Feature | Description | State | +|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------| +| Playlists | You can create and load `.m3u` playlists, edit them and they will get stored on the disk automatically. | Implemented | +| Background Job Monitor | A QDockWidget where background processes are listed. | Implemented | +| MPRIS Integration | The player is controllable by any MPRIS client and sends the metadata to MPRIS clients. | Implemented | +| Audio effects | Audio effects like normalizing and an equalizer. This can be implemented pretty easily because Wobuzz uses [Pydub](https://pydub.com/), which has these effects built in. | Not Implemented | +| Soundcloud downloader | A simple Soundcloud-downloader like maybe integrating [SCDL](https://pypi.org/project/scdl/) would be really cool. | Not Implemented | +| Synchronisation between devices | This should be pretty hard to implement and idk. if i will ever make it, but synchronisation could be pretty practical e.g. if you have multiple audio systems in different rooms. | Not Implemented | +| Audio visualization | Firstly, rather simple audio visualization like an oscilloscope would be cool, also something more complicated like [ProjectM](https://github.com/projectM-visualizer/projectm) could be integrated. | Not Implemented | ### Performance diff --git a/wobuzz/mpris/mpris_player.py b/wobuzz/mpris/mpris_player.py index 594722f..f5fbdf4 100644 --- a/wobuzz/mpris/mpris_player.py +++ b/wobuzz/mpris/mpris_player.py @@ -13,7 +13,7 @@ class MPRISPlayer(DBusInterface): self.metadata = { "mpris:trackid": ("o", "/org/bla/gubber"), # random junk, no functionality "mpris:length": ("x", 0), - "xesam:title": ("s", "Huggenburgl") + "mpris:artUrl": ("s", "file://" + self.server.app.utils.wobuzz_location + "/icon.svg"), } self.volume = 1.0 diff --git a/wobuzz/mpris/server.py b/wobuzz/mpris/server.py index 9067282..f6fe0ff 100644 --- a/wobuzz/mpris/server.py +++ b/wobuzz/mpris/server.py @@ -69,13 +69,33 @@ class MPRISServer: if current_playlist is not None and current_playlist.current_track is not None: current_track = current_playlist.current_track + metadata = current_track.metadata art_path = self.app.utils.tmp_path + "/cover_cache/" + current_track.metadata.path.split("/")[-1][:-4] # metadata milli to microseconds --↓ self.player_interface.metadata["mpris:length"] = ("x", current_track.duration * 1000) self.player_interface.metadata["mpris:artUrl"] = ("s", "file://" + art_path) - self.player_interface.metadata["xesam:title"] = ("s", current_track.metadata.title) + self.player_interface.metadata["xesam:title"] = ("s", metadata.title) + + if metadata.artist is None: + self.player_interface.metadata["xesam:artist"] = ("as", ["Unknown Artist"]) + + else: + self.player_interface.metadata["xesam:artist"] = ("as", [metadata.artist]) + + if metadata.album is None: + self.player_interface.metadata["xesam:album"] = ("s", metadata.title + " (single)") + + else: + self.player_interface.metadata["xesam:album"] = ("s", current_track.metadata.album) + + if metadata.genre is None: + self.player_interface.metadata["xesam:genre"] = ("as", ["Unknown Genre"]) + + else: + self.player_interface.metadata["xesam:genre"] = ("as", [metadata.genre]) + self.properties_interface.properties_changed(MPRIS_PLAYER_INTERFACE, "Metadata") if player.playing: