Add script for reviewing previous years’ activities
This commit is contained in:
parent
3d283da0f7
commit
e6043132f8
2 changed files with 28 additions and 5 deletions
14
scrobble.py
14
scrobble.py
|
@ -8,9 +8,9 @@ thealbums = sorted(albums.albums,key=lambda d: d["name"])
|
|||
|
||||
def countdown(t): # https://stackoverflow.com/a/25189629
|
||||
while t:
|
||||
mins, secs = divmod(t, 60)
|
||||
timeformat = '{:02d}:{:02d}'.format(mins, secs)
|
||||
print(timeformat, end='\r')
|
||||
mins, secs = divmod(t,60)
|
||||
timeformat = '{:02d}:{:02d}'.format(mins,secs)
|
||||
print("> " + timeformat,end='\r')
|
||||
time.sleep(1)
|
||||
t -= 1
|
||||
|
||||
|
@ -30,8 +30,12 @@ def scrobble(thealbum):
|
|||
if theartist == "noscrob":
|
||||
print("Skipped " + thetrack)
|
||||
else:
|
||||
last_api_call = network.scrobble(theartist,thetrack,int(time.time()))
|
||||
print("Scrobbled " + item)
|
||||
if tracklist[item] > 29:
|
||||
last_api_call = network.scrobble(theartist,thetrack,int(time.time()))
|
||||
print("Scrobbled " + thetrack)
|
||||
else:
|
||||
print("Skipped " + thetrack)
|
||||
last_api_call = network.update_now_playing(theartist,thetrack,duration=tracklist[item])
|
||||
countdown(tracklist[item])
|
||||
if i < len(album["tracks"]):
|
||||
input("Press enter after changing side")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue