Skip to content

Commit

Permalink
Fixed bug with local music playing
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Jul 18, 2019
1 parent 227a54d commit 843dc9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Installer Script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Music Caster"
#define MyAppVersion "2.2.0"
#define MyAppVersion "2.2.1"
#define MyAppPublisher "Elijah Lopez"
#define MyAppURL "https://elijahlopez.herokuapp.com/"
#define MyAppExeName "Music Caster.exe"
Expand Down
17 changes: 8 additions & 9 deletions music_caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
SCREEN_WIDTH, SCREEN_HEIGHT = user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)
sg.ChangeLookAndFeel('Black')
home_music_dir = str(Path.home()).replace('\\', '/') + '/Music'
CURRENT_VERSION = '2.2.0'
CURRENT_VERSION = '2.2.1'
settings = { # default settings
'previous device': None,
'comments': ['Edit only the variables below', 'Restart the program after editing this file!'],
Expand Down Expand Up @@ -188,6 +188,13 @@ def save_json():
def play_file(filename, position=0):
global mc, song_start, song_end, playing_status, song_length, song_position
song_position = position
title = artist = 'Unknown'
song_length = MP3(filename).info.length
with suppress(Exception):
title = EasyID3(filename)['title'][0]
artist = EasyID3(filename)['artist']
artist = ', '.join(artist)
# album = EasyID3(filename)['album']
if cast is None:
mc = None
song_length = MP3(filename).info.length
Expand All @@ -199,14 +206,6 @@ def play_file(filename, position=0):
song_end = song_start + song_length - position
playing_status = 'PLAYING'
else:
title = artist = 'Unknown'
song_length = MP3(filename).info.length
with suppress(Exception):
title = EasyID3(filename)['title'][0]
artist = EasyID3(filename)['artist']
artist = ', '.join(artist)
# album = EasyID3(filename)['album']

uri_safe = Path(filename).as_uri()[11:]
url = f'http://192.168.2.17:{PORT}/{uri_safe}'
cast.wait()
Expand Down

0 comments on commit 843dc9f

Please sign in to comment.