spolyrics 1.2.2__tar.gz → 1.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spolyrics
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: A minimalist, borderless, zero-delay synced lyrics miniplayer for Spotify on Windows.
5
5
  Author: SpoLyrics Team
6
6
  Requires-Python: >=3.8
@@ -15,7 +15,7 @@ from assets import ICON_B64
15
15
  from tkinter import messagebox
16
16
  from winsdk.windows.media.control import GlobalSystemMediaTransportControlsSessionManager as MediaManager
17
17
 
18
- CURRENT_VERSION = "1.2.2"
18
+ CURRENT_VERSION = "1.2.3"
19
19
  CONFIG_PATH = os.path.join(os.environ.get("APPDATA", ""), "SpoLyrics", "config.json")
20
20
  APP_DIR = os.path.join(os.environ.get("APPDATA", ""), "SpoLyrics")
21
21
  os.makedirs(APP_DIR, exist_ok=True)
@@ -186,6 +186,20 @@ class MiniLyrics:
186
186
  self.render_lyrics()
187
187
  threading.Thread(target=self.poll_song, daemon=True).start()
188
188
 
189
+ def get_tray_menu(self):
190
+ import pystray
191
+ items = [
192
+ pystray.MenuItem("Shortcuts & Info", self.tray_callbacks['on_info']),
193
+ pystray.MenuItem("Settings", self.tray_callbacks['on_settings']),
194
+ pystray.MenuItem("Toggle Visibility", self.tray_callbacks['on_toggle_lyrics']),
195
+ pystray.MenuItem("Quit", self.tray_callbacks['on_quit']),
196
+ pystray.MenuItem(f"v{CURRENT_VERSION}", lambda: None, enabled=False)
197
+ ]
198
+ if getattr(self, 'update_available', False):
199
+ items.insert(0, pystray.MenuItem("🔥 Update Available!", lambda: self.root.after(0, self.prompt_update)))
200
+ return pystray.Menu(*items)
201
+
202
+
189
203
  def render_lyrics(self):
190
204
  if self.synced_lyrics:
191
205
  pos = self.base_pos
@@ -769,7 +783,7 @@ class MiniLyrics:
769
783
  def show_update_prompt(self, latest):
770
784
  self.update_available = latest
771
785
  if getattr(self, 'tray_icon', None):
772
- self.tray_icon.update_menu()
786
+ self.tray_icon.menu = self.get_tray_menu()
773
787
 
774
788
  res = messagebox.askyesno("Update Available", f"A new version of SpoLyrics (v{latest}) is available!\n\nYou are currently on v{CURRENT_VERSION}.\nWould you like to update now?")
775
789
  if res:
@@ -835,8 +849,7 @@ def setup_tray(app):
835
849
  from PIL import Image
836
850
 
837
851
  def on_quit(icon, item):
838
- icon.stop()
839
- app.root.quit()
852
+ app.root.after(0, app.root.quit)
840
853
 
841
854
  def on_settings(icon, item):
842
855
  app.root.after(0, app.open_settings)
@@ -856,19 +869,23 @@ def setup_tray(app):
856
869
  logging.error("Failed to open tray icon image, using fallback", exc_info=e)
857
870
  image = Image.new('RGB', (64, 64), color = (29, 185, 84))
858
871
 
859
- def get_menu():
860
- items = [
861
- pystray.MenuItem("Shortcuts & Info", on_info),
862
- pystray.MenuItem("Settings", on_settings),
863
- pystray.MenuItem("Toggle Visibility", on_toggle_lyrics),
864
- pystray.MenuItem("Quit", on_quit),
865
- pystray.MenuItem(f"v{CURRENT_VERSION}", lambda: None, enabled=False)
866
- ]
867
- if getattr(app, 'update_available', False):
868
- items.insert(0, pystray.MenuItem("🔥 Update Available!", lambda: app.root.after(0, app.prompt_update)))
869
- return pystray.Menu(*items)
870
-
871
- icon = pystray.Icon("SpoLyrics", image, "SpoLyrics", menu=get_menu)
872
+ app.tray_callbacks = {
873
+ 'on_quit': on_quit,
874
+ 'on_settings': on_settings,
875
+ 'on_toggle_lyrics': on_toggle_lyrics,
876
+ 'on_info': on_info
877
+ }
878
+
879
+ app_dir = os.path.join(os.environ.get("APPDATA", ""), "SpoLyrics")
880
+ icon_path = os.path.join(app_dir, 'icon.ico')
881
+
882
+ try:
883
+ image = Image.open(icon_path)
884
+ except Exception as e:
885
+ logging.error("Failed to open tray icon image, using fallback", exc_info=e)
886
+ image = Image.new('RGB', (64, 64), color = (29, 185, 84))
887
+
888
+ icon = pystray.Icon("SpoLyrics", image, "SpoLyrics", menu=app.get_tray_menu())
872
889
  app.tray_icon = icon
873
890
  threading.Thread(target=icon.run, daemon=True).start()
874
891
  except Exception as e:
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='spolyrics',
5
- version='1.2.2',
5
+ version='1.2.3',
6
6
  description='A minimalist, borderless, zero-delay synced lyrics miniplayer for Spotify on Windows.',
7
7
  long_description=open('README.md', 'r', encoding='utf-8').read(),
8
8
  long_description_content_type='text/markdown',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spolyrics
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: A minimalist, borderless, zero-delay synced lyrics miniplayer for Spotify on Windows.
5
5
  Author: SpoLyrics Team
6
6
  Requires-Python: >=3.8
File without changes
File without changes
File without changes
File without changes