Skip to content

Commit

Permalink
fix: seeking catch RequestFailed
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Mar 20, 2024
1 parent 4017e4a commit 0b9bc54
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 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.17.5
- [Fix] Setting position of Chromecast from GUI again

5.17.4
- [Fix] Volume Chromecast

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 @@ -3,8 +3,8 @@
# noinspection PyUnresolvedReferences
VSVersionInfo(
ffi=FixedFileInfo(
prodvers=(5, 17, 4, 0),
filevers=(5, 17, 4, 0),
prodvers=(5, 17, 5, 0),
filevers=(5, 17, 5, 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 @@ -28,12 +28,12 @@ VSVersionInfo(
'000004b0',
[StringStruct('CompanyName', 'Elijah Lopez'),
StringStruct('FileDescription', 'Music Caster'),
StringStruct('FileVersion', '5.17.4.0'),
StringStruct('FileVersion', '5.17.5.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.17.4.0')])
StringStruct('ProductVersion', '5.17.5.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.17.4"
#define MyAppVersion "5.17.5"
#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.17.4'
VERSION = latest_version = '5.17.5'
UPDATE_MESSAGE = """
[NEW] Better Error Capturing
[MSG] Language translators wanted
Expand Down
8 changes: 4 additions & 4 deletions src/music_caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def activate_instance(port=2001, default_timeout=0.5, to_port=2004):
import pychromecast
from pychromecast.controllers.media import MediaStatusListener
from pychromecast.controllers.receiver import CastStatusListener
from pychromecast.error import PyChromecastError, UnsupportedNamespace, NotConnected, RequestTimeout
from pychromecast.error import PyChromecastError, UnsupportedNamespace, NotConnected, RequestTimeout, RequestFailed
from pychromecast.config import APP_MEDIA_RECEIVER
from pychromecast import Chromecast
from pychromecast.models import CastInfo
Expand Down Expand Up @@ -435,7 +435,7 @@ def update_volume(new_vol, _from=''):
with suppress(NameError):
audio_player.set_volume(new_vol)
if cast is not None:
with suppress(NotConnected, RequestTimeout):
with suppress(NotConnected, RequestTimeout, RequestFailed):
cast.set_volume(new_vol)


Expand Down Expand Up @@ -2129,7 +2129,7 @@ def pause(source=''):
mc = cast.media_controller
try:
mc.pause()
except RequestTimeout:
except (RequestTimeout, RequestFailed):
cast.wait()
cast.media_controller.pause()
block_until = time.monotonic() + 5
Expand Down Expand Up @@ -2239,7 +2239,7 @@ def set_pos(new_position):
if playing_status.paused():
cast.media_controller.pause()
break
except (NotConnected, RequestTimeout):
except (NotConnected, RequestTimeout, RequestFailed):
cast.wait()
else:
audio_player.set_pos(new_position)
Expand Down

0 comments on commit 0b9bc54

Please sign in to comment.