spolyrics 1.2.3__tar.gz → 1.2.4__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.3
3
+ Version: 1.2.4
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.3"
18
+ CURRENT_VERSION = "1.2.4"
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)
@@ -94,6 +94,10 @@ def get_exe_path():
94
94
  script_exe = os.path.join(sys.prefix, 'Scripts', 'spolyrics.exe')
95
95
  if os.path.exists(script_exe):
96
96
  return script_exe
97
+
98
+ pythonw = os.path.join(sys.prefix, 'pythonw.exe')
99
+ if os.path.exists(pythonw):
100
+ return (pythonw, os.path.abspath(__file__))
97
101
  return sys.executable
98
102
 
99
103
  def set_auto_start(enable, force_update=False):
@@ -104,7 +108,11 @@ def set_auto_start(enable, force_update=False):
104
108
  exe_path = get_exe_path()
105
109
  if exe_path and os.path.exists(icon_path):
106
110
  if force_update or not os.path.exists(STARTUP_SHORTCUT):
107
- ps_script = f"$s=(New-Object -COM WScript.Shell).CreateShortcut('{STARTUP_SHORTCUT}');$s.TargetPath='{exe_path}';$s.IconLocation='{icon_path}';$s.Save()"
111
+ if isinstance(exe_path, tuple):
112
+ target, args = exe_path
113
+ ps_script = f"$s=(New-Object -COM WScript.Shell).CreateShortcut('{STARTUP_SHORTCUT}');$s.TargetPath='{target}';$s.Arguments='\"{args}\"';$s.IconLocation='{icon_path}';$s.Save()"
114
+ else:
115
+ ps_script = f"$s=(New-Object -COM WScript.Shell).CreateShortcut('{STARTUP_SHORTCUT}');$s.TargetPath='{exe_path}';$s.IconLocation='{icon_path}';$s.Save()"
108
116
  subprocess.run(["powershell", "-Command", ps_script], creationflags=0x08000000)
109
117
  else:
110
118
  if os.path.exists(STARTUP_SHORTCUT):
@@ -790,14 +798,24 @@ class MiniLyrics:
790
798
  import tempfile
791
799
  bat_path = os.path.join(tempfile.gettempdir(), "update_spolyrics.bat")
792
800
  exe_path = get_exe_path()
801
+
802
+ # Extract arguments if get_exe_path returns pythonw.exe + main.py
803
+ exe_cmd = f'"{exe_path}"'
804
+ if isinstance(exe_path, tuple):
805
+ exe_cmd = f'"{exe_path[0]}" "{exe_path[1]}"'
806
+
793
807
  with open(bat_path, 'w') as f:
794
808
  f.write('@echo off\n')
795
809
  f.write('echo Updating SpoLyrics...\n')
796
810
  f.write('ping 127.0.0.1 -n 3 > nul\n')
797
- f.write('python -m pip install --upgrade spolyrics\n')
798
- f.write(f'start "" "{exe_path}"\n')
811
+ import sys
812
+ f.write(f'"{sys.executable}" -m pip install --upgrade --no-cache-dir spolyrics\n')
813
+ f.write(f'start "" {exe_cmd}\n')
799
814
  f.write('del "%~f0"\n')
800
- subprocess.Popen(['cmd.exe', '/c', bat_path], creationflags=16)
815
+
816
+ # Run bat silently without creating a window
817
+ import subprocess
818
+ subprocess.Popen(['cmd.exe', '/c', bat_path], creationflags=0x08000000)
801
819
  if getattr(self, 'tray_icon', None):
802
820
  self.tray_icon.stop()
803
821
  self.root.quit()
@@ -829,15 +847,19 @@ def create_shortcut():
829
847
  with open(path_file, 'r') as f:
830
848
  saved_path = f.read().strip()
831
849
 
832
- if saved_path != exe_path:
850
+ if saved_path != str(exe_path):
833
851
  needs_update = True
834
852
  path_changed = True
835
853
  with open(path_file, 'w') as f:
836
- f.write(exe_path)
854
+ f.write(str(exe_path))
837
855
 
838
856
  if needs_update:
839
857
  if exe_path:
840
- ps_script = f"$s=(New-Object -COM WScript.Shell).CreateShortcut('{shortcut_path}');$s.TargetPath='{exe_path}';$s.IconLocation='{icon_path}';$s.Save()"
858
+ if isinstance(exe_path, tuple):
859
+ target, args = exe_path
860
+ ps_script = f"$s=(New-Object -COM WScript.Shell).CreateShortcut('{shortcut_path}');$s.TargetPath='{target}';$s.Arguments='\"{args}\"';$s.IconLocation='{icon_path}';$s.Save()"
861
+ else:
862
+ ps_script = f"$s=(New-Object -COM WScript.Shell).CreateShortcut('{shortcut_path}');$s.TargetPath='{exe_path}';$s.IconLocation='{icon_path}';$s.Save()"
841
863
  subprocess.run(["powershell", "-Command", ps_script], creationflags=0x08000000)
842
864
  except Exception as e:
843
865
  logging.error("Failed to create shortcut", exc_info=e)
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='spolyrics',
5
- version='1.2.3',
5
+ version='1.2.4',
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.3
3
+ Version: 1.2.4
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