Skip to content

Commit

Permalink
fix: set_pos RequestTimeout error
Browse files Browse the repository at this point in the history
Catch RequestTimeout as well, not just NotConnected
  • Loading branch information
elibroftw committed Mar 18, 2024
1 parent 555297b commit 2cfb861
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 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.1
- [Fix] Setting position of Chromecast from GUI

5.17.0
- [Feat] Migrated error capturing endpoint from pipedream to under mine (lenerva)

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, 0, 0),
filevers=(5, 17, 0, 0),
prodvers=(5, 17, 1, 0),
filevers=(5, 17, 1, 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.0.0'),
StringStruct('FileVersion', '5.17.1.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.0.0')])
StringStruct('ProductVersion', '5.17.1.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.0"
#define MyAppVersion "5.17.1"
#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.0'
VERSION = latest_version = '5.17.1'
UPDATE_MESSAGE = """
[NEW] Better Error Capturing
[MSG] Language translators wanted
Expand Down
7 changes: 4 additions & 3 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
from pychromecast.error import PyChromecastError, UnsupportedNamespace, NotConnected, RequestTimeout
from pychromecast.config import APP_MEDIA_RECEIVER
from pychromecast import Chromecast
from pychromecast.models import CastInfo
Expand Down Expand Up @@ -2231,9 +2231,10 @@ def set_pos(new_position):
for _ in range(2):
try:
cast.media_controller.seek(new_position)
if playing_status.paused(): cast.media_controller.pause()
if playing_status.paused():
cast.media_controller.pause()
break
except NotConnected:
except (NotConnected, RequestTimeout):
cast.wait()
else:
audio_player.set_pos(new_position)
Expand Down

0 comments on commit 2cfb861

Please sign in to comment.