Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when no lyrics found #10

Merged
merged 3 commits into from
Jun 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Overlyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def find_nearest_time(currentProgress, timestampsInSeconds, parsed_lyrics):

elif(time_str == "TypeError" or time_str == [] or parsed_lyrics == {}):
print("Lyrics file error.") if VERBOSE_MODE else None
return "Lyrics file error."
nolyricsfound()
return
else:
# Finds the section of the letter closest to the current time
currentLyricTime = find_nearest_time(currentProgress, timestampsInSeconds, parsed_lyrics) ## format: HH:MM:SS
Expand Down Expand Up @@ -231,6 +232,7 @@ def convert_to_seconds(time_strs):

if (lyrics is None or lyrics.isspace()):
print("Track not found.") if VERBOSE_MODE else None
nolyricsfound()
else:
print("display_lyrics: >>", trackName, "<<") if VERBOSE_MODE else None

Expand Down Expand Up @@ -360,6 +362,12 @@ def PKCE_getAcessToken():

return spAPIManager

def nolyricsfound():
global actualVerse, parsed_lyrics
parsed_lyrics={}
actualVerse='No lyrics found.'
lyrics_verse_event.set()

def noMusicIsPlayingOnSpotify():
global actualVerse
actualVerse = "No song is being heard on Spotify."
Expand Down