Skip to content

Commit

Permalink
Add error message for friend heart get
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiko2k committed Aug 25, 2023
1 parent 4dc44f2 commit ef5fbb2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion t_modules/t_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7348,8 +7348,11 @@ def get_friends_love(self):

try:
username = prefs.last_fm_username
print(f"Username is {username}")

if not username:
self.scanning_friends = False
show_message("There was an error, try re-log in")
return

if self.network is None:
Expand Down Expand Up @@ -7396,16 +7399,19 @@ def dl_love(self):
return

if len(username) > 25:
print("abort due to long username")
return

self.scanning_loves = True

print("Connect for friend scan")

try:
if self.network is None:
self.no_user_connect()

self.network.enable_rate_limit()

print("Get user...")
lastfm_user = self.network.get_user(username)
tracks = lastfm_user.get_loved_tracks(limit=None)

Expand Down Expand Up @@ -29101,6 +29107,7 @@ def get_friend_love(self):
return

if not lastfm.scanning_friends and not lastfm.scanning_scrobbles and not lastfm.scanning_loves:
print("Launch friend love thread")
shoot_dl = threading.Thread(target=lastfm.get_friends_love)
shoot_dl.daemon = True
shoot_dl.start()
Expand Down

0 comments on commit ef5fbb2

Please sign in to comment.