mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
show release date in window title and notification
This commit is contained in:
parent
fdb6ee714a
commit
710e186741
@ -2970,11 +2970,15 @@ class MainWindow(Gtk.ApplicationWindow):
|
|||||||
|
|
||||||
def on_file_changed(self, *args):
|
def on_file_changed(self, *args):
|
||||||
try:
|
try:
|
||||||
song=self.client.song_to_str_dict(self.client.currentsong())
|
song=self.client.extend_song_for_display(self.client.song_to_str_dict(self.client.currentsong()))
|
||||||
self.set_title(song["artist"]+" - "+song["title"]+" - "+song["album"])
|
if song["date"] != "":
|
||||||
|
date=" ("+song["date"]+")"
|
||||||
|
else:
|
||||||
|
date=""
|
||||||
|
self.set_title(song["artist"]+" - "+song["title"]+" - "+song["album"]+date)
|
||||||
if self.settings.get_boolean("send-notify"):
|
if self.settings.get_boolean("send-notify"):
|
||||||
if not self.is_active() and self.client.status()["state"] == "play":
|
if not self.is_active() and self.client.status()["state"] == "play":
|
||||||
notify=Notify.Notification.new(song["title"], song["artist"]+"\n"+song["album"])
|
notify=Notify.Notification.new(song["title"], song["artist"]+"\n"+song["album"]+date)
|
||||||
pixbuf=Cover(lib_path=self.settings.get_value("paths")[self.settings.get_int("active-profile")], song_file=song["file"]).get_pixbuf(400)
|
pixbuf=Cover(lib_path=self.settings.get_value("paths")[self.settings.get_int("active-profile")], song_file=song["file"]).get_pixbuf(400)
|
||||||
notify.set_image_from_pixbuf(pixbuf)
|
notify.set_image_from_pixbuf(pixbuf)
|
||||||
notify.show()
|
notify.show()
|
||||||
|
Loading…
Reference in New Issue
Block a user