Add script for reviewing previous years’ activities

master
trémeur 3 months ago
parent 3d283da0f7
commit e6043132f8

@ -0,0 +1,19 @@
import datetime,os
year = int(datetime.datetime.strftime(datetime.datetime.today(),"%Y"))
monthstring = datetime.datetime.strftime(datetime.datetime.today(),"%m")
datestring = datetime.datetime.strftime(datetime.datetime.today(),"%d")
fileplace = "/home/mdd/Documents/drive/org/journal/"
thisyear = year
while year > 1993:
year -= 1
target = fileplace + str(year) + "/" + monthstring + "/" + str(year) + "-" + monthstring + "-" + datestring + ".org"
if os.path.exists(target):
if year < thisyear -1:
print("Press enter to continue")
input()
print(open(target,"r").read())

@ -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…
Cancel
Save