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())

@ -10,7 +10,7 @@ def countdown(t): # https://stackoverflow.com/a/25189629
while t: while t:
mins, secs = divmod(t,60) mins, secs = divmod(t,60)
timeformat = '{:02d}:{:02d}'.format(mins,secs) timeformat = '{:02d}:{:02d}'.format(mins,secs)
print(timeformat, end='\r') print("> " + timeformat,end='\r')
time.sleep(1) time.sleep(1)
t -= 1 t -= 1
@ -30,8 +30,12 @@ def scrobble(thealbum):
if theartist == "noscrob": if theartist == "noscrob":
print("Skipped " + thetrack) print("Skipped " + thetrack)
else: else:
if tracklist[item] > 29:
last_api_call = network.scrobble(theartist,thetrack,int(time.time())) last_api_call = network.scrobble(theartist,thetrack,int(time.time()))
print("Scrobbled " + item) print("Scrobbled " + thetrack)
else:
print("Skipped " + thetrack)
last_api_call = network.update_now_playing(theartist,thetrack,duration=tracklist[item])
countdown(tracklist[item]) countdown(tracklist[item])
if i < len(album["tracks"]): if i < len(album["tracks"]):
input("Press enter after changing side") input("Press enter after changing side")

Loading…
Cancel
Save