Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatDamon committed Feb 10, 2024
1 parent c50b2f5 commit 709ab42
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def audioInfoUpdate():
logging.info("Audio cover loaded")
else:
audioCoverBase64 = None
audioCover.src_base64 = None
audioCover.src = './asset/track.png'
logging.info("Placeholder cover loaded")
audioCover.update()
Expand All @@ -157,6 +158,9 @@ def audioInfoUpdate():
if audioTag.album != None:
audioAlbumText = audioTag.album
logging.info("Find audio album and loaded: " + audioAlbumText)
else:
audioAlbumText = None
logging.info("Clean audioAlbumText")
global audioInfo
audioInfo = "Album: " + str(audioTag.album) + "\nAlbumist: " + str(audioTag.albumartist) + "\nArtist: " + str(audioTag.artist) + "\nAudio Offset: " + str(audioTag.audio_offset) + "\nBitrate: " + str(audioTag.bitrate) + "\nBitdepth: " + str(audioTag.bitdepth) + "\nChannels: " + str(audioTag.channels) + "\nComment: " + str(audioTag.comment)+ "\nComposer: " + str(audioTag.composer) + "\nDisc: " + str(audioTag.disc) + "\nDisc Total: " + str(audioTag.disc_total) + "\nDuration: " + str(audioTag.duration) + "\nFilesize: " + str(audioTag.filesize) + "\nGenre: " + str(audioTag.genre) + "\nSamplerate: " + str(audioTag.samplerate) + "\nTitle: " + str(audioTag.title) + "\nTrack: " + str(audioTag.track) + "\nTrack Total: " + str(audioTag.track_total) + "\nYear: " + str(audioTag.year)
logging.info("Set audio info")
Expand Down Expand Up @@ -317,12 +321,12 @@ def enableOrDisableLoop(e):
if loopOpen == False:
loopOpen = True
playAudio.release_mode = ft.audio.ReleaseMode.LOOP
playInLoop_btn.icon = ft.icons.STOP_CIRCLE_OUTLINED
playInLoop_btn.icon = ft.icons.REPEAT_ONE_ON
logging.info("Loop enabled")
elif loopOpen == True:
loopOpen = False
playAudio.release_mode = ft.audio.ReleaseMode.RELEASE
playInLoop_btn.icon = ft.icons.LOOP_OUTLINED
playInLoop_btn.icon = ft.icons.REPEAT_ONE
logging.info("Loop disabled")
page.update()
logging.info("Page updated")
Expand Down Expand Up @@ -612,7 +616,7 @@ def balanceMiddle(e):
)

playInLoop_btn = ft.IconButton(
icon = ft.icons.LOOP_OUTLINED,
icon = ft.icons.REPEAT_ONE_OUTLINED,
tooltip = lang.tooltips["playInLoop"],
icon_size = 20,
on_click = enableOrDisableLoop
Expand Down

0 comments on commit 709ab42

Please sign in to comment.