Permalink
Browse files

notify.py: show notification only once for the song

Do not show notification on play/pause events if current song hadn't
actually changed.
  • Loading branch information...
1 parent a89f5c8 commit f0f14aa0c893051c0cbe6444884cc71ef29bfb50 Kirill Lashuk committed Aug 31, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 notify.py
View
7 notify.py
@@ -24,6 +24,8 @@
from sonata.library import library_set_data
+cur_songinfo = None
+
# this gets called when the plugin is loaded, enabled, or disabled:
def on_enable(state):
global notify, art_cache, art_location, music_dir
@@ -63,6 +65,11 @@ def on_enable(state):
# this gets called when a new song is playing:
def on_song_change(songinfo):
+ global cur_songinfo
+ if songinfo == cur_songinfo:
+ return
+ else:
+ cur_songinfo = songinfo
if songinfo:
art_folder = ''
summary = "Current song:"

0 comments on commit f0f14aa

Please sign in to comment.