Skip to content

Commit

Permalink
Fix RecursionError in cast_monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Apr 20, 2024
1 parent 6da01ed commit 52b9a04
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Music Caster by Elijah Lopez Changelog

5.19.3
- [Fix] Cast syncing

5.19.2
- [Fix] Update from GUI

Expand Down
8 changes: 4 additions & 4 deletions build_files/mc_version_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# For more details about fixed file info 'ffi' see: http://msdn.microsoft.com/en-us/library/ms646997.aspx
VSVersionInfo(
ffi=FixedFileInfo(
prodvers=(5, 19, 2, 0),
filevers=(5, 19, 2, 0),
prodvers=(5, 19, 3, 0),
filevers=(5, 19, 3, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x17,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand All @@ -27,12 +27,12 @@ VSVersionInfo(
'000004b0',
[StringStruct('CompanyName', 'Elijah Lopez'),
StringStruct('FileDescription', 'Music Caster'),
StringStruct('FileVersion', '5.19.2.0'),
StringStruct('FileVersion', '5.19.3.0'),
StringStruct('InternalName', 'Music Caster'),
StringStruct('LegalCopyright', 'Copyright (c) 2019 - 2024, Elijah Lopez'),
StringStruct('OriginalFilename', 'Music Caster.exe'),
StringStruct('ProductName', 'Music Caster'),
StringStruct('ProductVersion', '5.19.2.0')])
StringStruct('ProductVersion', '5.19.3.0')])
]),
VarFileInfo([VarStruct('Translation', [0, 1200])])
]
Expand Down
2 changes: 1 addition & 1 deletion build_files/setup_script.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "Music Caster"
#define MyAppVersion "5.19.2"
#define MyAppVersion "5.19.3"
#define MyAppPublisher "Elijah Lopez"
#define MyAppURL "https://elijahlopez.ca/software#music-caster"
#define MyAppExeName "Music Caster.exe"
Expand Down
2 changes: 1 addition & 1 deletion src/meta.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = latest_version = '5.19.2'
VERSION = latest_version = '5.19.3'
UPDATE_MESSAGE = """
[NEW] Better Error Capturing
[MSG] Language translators wanted
Expand Down
9 changes: 7 additions & 2 deletions src/music_caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -3751,7 +3751,7 @@ def auto_update():
State.installing_update = False


def cast_monitor(sent: bool = True, msg: dict = None):
def cast_monitor(sent: bool = True, msg: dict = None, is_callback=True):
global track_position, track_start, track_end, OLD_CAST_VOLUME, OLD_CAST_POS
if cast is None:
return
Expand All @@ -3760,6 +3760,11 @@ def cast_monitor(sent: bool = True, msg: dict = None):
try:
if msg is None and playing_status.busy():
# block/monitor in background thread
if is_callback:
# avoid recursion error
if playing_status.playing():
raise NotConnected
return
return cast.media_controller.update_status(callback_function=cast_monitor)
except AttributeError:
# don't need to monitor if device switched randomly
Expand Down Expand Up @@ -4035,7 +4040,7 @@ def handle_action(action):
update_settings('on_battery_res', get_initial_res())
tray_notify(t('ERROR') + ': ' + t('Could not set resolution'))
if cast is not None:
cast_monitor()
cast_monitor(is_callback=False)
if not gui_window.was_closed():
read_main_window()
else:
Expand Down

0 comments on commit 52b9a04

Please sign in to comment.