mytunes-pro 2.0.1__py3-none-any.whl → 2.0.2__py3-none-any.whl

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.
mytunes/app.py CHANGED
@@ -32,7 +32,7 @@ MPV_SOCKET = "/tmp/mpv_socket"
32
32
  LOG_FILE = "/tmp/mytunes_mpv.log"
33
33
  PID_FILE = "/tmp/mytunes_mpv.pid"
34
34
  APP_NAME = "MyTunes Pro"
35
- APP_VERSION = "2.0.1"
35
+ APP_VERSION = "2.0.2"
36
36
 
37
37
  # === [Strings & Localization] ===
38
38
  STRINGS = {
@@ -660,12 +660,10 @@ class MyTunesApp:
660
660
  rel_x = mx - branding_x
661
661
  if rel_x < 15:
662
662
  url = "https://mytunes-pro.com"
663
- self.status_msg = f"🌐 Opening {url}..."
664
- threading.Thread(target=webbrowser.open, args=(url,), daemon=True).start()
663
+ self.open_browser(url)
665
664
  elif rel_x > 15:
666
665
  url = "https://postgresql.co.kr"
667
- self.status_msg = f"🌐 Opening {url}..."
668
- threading.Thread(target=webbrowser.open, args=(url,), daemon=True).start()
666
+ self.open_browser(url)
669
667
  except:
670
668
  pass
671
669
  return
@@ -864,18 +862,16 @@ class MyTunesApp:
864
862
  if self.is_remote():
865
863
  self.show_copy_dialog("YouTube", url)
866
864
  else:
867
- # v1.8.4 - Use standard webbrowser library for maximum stability on F7
868
- self.status_msg = "🌐 Opening YouTube in Browser..."
869
- threading.Thread(target=webbrowser.open, args=(url,), daemon=True).start()
865
+ self.open_browser(url)
870
866
 
867
+ # Open Live Station: F8
871
868
  elif key == curses.KEY_F8:
872
869
  homepage_url = "https://mytunes-pro.com"
873
870
  if self.is_remote():
874
871
  self.show_copy_dialog("MyTunes Home", homepage_url)
875
872
  return
876
873
 
877
- self.status_msg = "🌐 Opening MyTunes Home..."
878
- threading.Thread(target=webbrowser.open, args=(homepage_url,), daemon=True).start()
874
+ self.open_browser(homepage_url, app_mode=True)
879
875
 
880
876
  # Delete Item: DEL, d
881
877
  elif key == curses.KEY_DC or k_char in ['d']:
@@ -977,7 +973,62 @@ class MyTunesApp:
977
973
  return res
978
974
 
979
975
  def is_remote(self):
980
- return 'SSH_CONNECTION' in os.environ or 'SSH_CLIENT' in os.environ
976
+ """Check if running in a remote SSH session (excluding local WSL)."""
977
+ if 'WSL_DISTRO_NAME' in os.environ or 'WSL_INTEROP' in os.environ:
978
+ return False
979
+ return 'SSH_CONNECTION' in os.environ or 'SSH_CLIENT' in os.environ or 'SSH_TTY' in os.environ
980
+
981
+ def open_browser(self, url, app_mode=False):
982
+ """Open browser using detached subprocess to prevent TUI freezing."""
983
+ self.status_msg = f"🌐 Opening Link: {url[:30]}..."
984
+
985
+ def run_open():
986
+ try:
987
+ # Prepare DEVNULL for fire-and-forget
988
+ devnull = os.open(os.devnull, os.O_RDWR)
989
+ popen_kwargs = {
990
+ 'stdin': devnull,
991
+ 'stdout': devnull,
992
+ 'stderr': devnull,
993
+ 'close_fds': True
994
+ }
995
+
996
+ # Use start_new_session for process group detachment (if possible)
997
+ if hasattr(os, 'setsid') or sys.platform != 'win32':
998
+ popen_kwargs['start_new_session'] = True
999
+
1000
+ if sys.platform == 'darwin':
1001
+ if app_mode:
1002
+ # Attempt "App Mode" for Chrome/Brave on macOS
1003
+ launched = False
1004
+ browsers = [
1005
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
1006
+ "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
1007
+ ]
1008
+ for b_path in browsers:
1009
+ if os.path.exists(b_path):
1010
+ try:
1011
+ subprocess.Popen([b_path, f"--app={url}", "--window-size=600,800"], **popen_kwargs)
1012
+ launched = True
1013
+ break
1014
+ except: pass
1015
+ if not launched:
1016
+ subprocess.Popen(['open', url], **popen_kwargs)
1017
+ else:
1018
+ subprocess.Popen(['open', url], **popen_kwargs)
1019
+ elif self.is_wsl():
1020
+ # For WSL, we usually use cmd.exe /c start
1021
+ subprocess.Popen(['cmd.exe', '/c', 'start', url], **popen_kwargs)
1022
+ else:
1023
+ # Linux or others
1024
+ subprocess.Popen(['xdg-open', url], **popen_kwargs)
1025
+ except Exception as e:
1026
+ # Log error silently to TUI status
1027
+ self.status_msg = f"❌ Browser Error: {str(e)[:20]}"
1028
+
1029
+ # Still execute Popen in a thread to be extra safe,
1030
+ # but Popen itself is now detached and redirected.
1031
+ threading.Thread(target=run_open, daemon=True).start()
981
1032
 
982
1033
  def is_wsl(self):
983
1034
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mytunes-pro
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: A lightweight, keyboard-centric terminal player for streaming YouTube music.
5
5
  Author-email: loxo <loxo5432@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/postgresql-co-kr/mytunes
@@ -19,7 +19,7 @@ Dynamic: license-file
19
19
 
20
20
  # 🎵 MyTunes Pro (Korean)
21
21
 
22
- ## 🚀 Professional TUI Music Player v2.0.1
22
+ ## 🚀 Professional TUI Music Player v2.0.2
23
23
 
24
24
  MyTunes Pro는 **Context7**의 심층 리서치를 기반으로 제작된 **Premium CLI Music Player**입니다.
25
25
  Python `curses` 라이브러리를 사용하여 터미널 환경에서도 **GUI급의 유려한 UX**를 제공하며,
@@ -212,7 +212,7 @@ Windows 환경에서 한글 검색이 안 되거나 설치가 어려운 분들
212
212
 
213
213
  # 🎵 MyTunes Pro (English)
214
214
 
215
- **Modern CLI YouTube Music Player (v2.0.1)**
215
+ **Modern CLI YouTube Music Player (v2.0.2)**
216
216
  A lightweight, keyboard-centric terminal player for streaming YouTube music.
217
217
 
218
218
  ---
@@ -301,6 +301,12 @@ sudo apt install mpv python3 python3-pip pipx python3-venv -y
301
301
 
302
302
  ## 🔄 Changelog
303
303
 
304
+ ### v2.0.2 (Stability & Browser Optimization)
305
+
306
+ - **Browser Launch**: Switched to fully decoupled `subprocess.Popen` logic for browser opening. This eliminates occasional TUI freezes when launching YouTube (F7) or Live Station (F8) by bypassing `webbrowser` library limitations.
307
+ - **App Mode Restore**: Fixed and improved Chrome/Brave App Mode (Popup) for the Live Station on macOS.
308
+ - **Improved Remote Detection**: Refined SSH/WSL detection to ensure local browser features are correctly enabled where possible.
309
+
304
310
  ### v2.0.1 (Keymap Refinement & Version Sync)
305
311
 
306
312
  - **Navigation**: Added browser-style Forward navigation (`L` / `Right Arrow`).
@@ -0,0 +1,8 @@
1
+ mytunes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ mytunes/app.py,sha256=KlwbzDtBQ2lNg9KC4jhBXi5A-L4j5WkiJ67AatiGo9w,63780
3
+ mytunes_pro-2.0.2.dist-info/licenses/LICENSE,sha256=lOrP0EIjxcgJia__W3f3PVDZkRd2oRzFkyH2g3LRRCg,1063
4
+ mytunes_pro-2.0.2.dist-info/METADATA,sha256=u8SH6WZ5WKRf3ARn8M3TkPad0h5A91Yz3sdiHzTmlck,22830
5
+ mytunes_pro-2.0.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
+ mytunes_pro-2.0.2.dist-info/entry_points.txt,sha256=6-MsC13nIgzLvrREaGotc32FgxHx_Iuu1z2qCzJs1_4,65
7
+ mytunes_pro-2.0.2.dist-info/top_level.txt,sha256=KWzdFyNNG_sO7GT83-sN5fYArP4_DL5I8HYIwgazXyY,8
8
+ mytunes_pro-2.0.2.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- mytunes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mytunes/app.py,sha256=i6G_1_8guGJqc_EvzlVzMpYfPSSZL1jB7_Nb30qX1T4,61619
3
- mytunes_pro-2.0.1.dist-info/licenses/LICENSE,sha256=lOrP0EIjxcgJia__W3f3PVDZkRd2oRzFkyH2g3LRRCg,1063
4
- mytunes_pro-2.0.1.dist-info/METADATA,sha256=fqpGMPvQnZxzvgaViPMVrvNPEy29yHV0mH3zT59hyKY,22317
5
- mytunes_pro-2.0.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
- mytunes_pro-2.0.1.dist-info/entry_points.txt,sha256=6-MsC13nIgzLvrREaGotc32FgxHx_Iuu1z2qCzJs1_4,65
7
- mytunes_pro-2.0.1.dist-info/top_level.txt,sha256=KWzdFyNNG_sO7GT83-sN5fYArP4_DL5I8HYIwgazXyY,8
8
- mytunes_pro-2.0.1.dist-info/RECORD,,