MPRIS: Added basic missing metadata and marked the MPRIS server as complete in the README.md
This commit is contained in:
parent
1f149a25a3
commit
ec2713d98d
3 changed files with 31 additions and 11 deletions
18
README.md
18
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. | <input type="checkbox" disabled checked /> Implemented |
|
||||
| Background Job Monitor | A QDockWidget where background processes are listed. | <input type="checkbox" disabled checked /> Implemented |
|
||||
| MPRIS Integration | Basic MPRIS integration (Partial Metadata, Play, Pause, Stop, Next, Previous) | <input type="checkbox" disabled /> 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. | <input type="checkbox" disabled /> Not Implemented |
|
||||
| Soundcloud downloader | A simple Soundcloud-downloader like maybe integrating [SCDL](https://pypi.org/project/scdl/) would be really cool. | <input type="checkbox" disabled /> 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. | <input type="checkbox" disabled /> 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. | <input type="checkbox" disabled /> Not Implemented |
|
||||
| Feature | Description | State |
|
||||
|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
|
||||
| Playlists | You can create and load `.m3u` playlists, edit them and they will get stored on the disk automatically. | <input type="checkbox" disabled checked /> Implemented |
|
||||
| Background Job Monitor | A QDockWidget where background processes are listed. | <input type="checkbox" disabled checked /> Implemented |
|
||||
| MPRIS Integration | The player is controllable by any MPRIS client and sends the metadata to MPRIS clients. | <input type="checkbox" disabled checked /> 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. | <input type="checkbox" disabled /> Not Implemented |
|
||||
| Soundcloud downloader | A simple Soundcloud-downloader like maybe integrating [SCDL](https://pypi.org/project/scdl/) would be really cool. | <input type="checkbox" disabled /> 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. | <input type="checkbox" disabled /> 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. | <input type="checkbox" disabled /> Not Implemented |
|
||||
|
||||
### Performance
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue