All the things

This commit is contained in:
2022-05-26 14:20:13 +02:00
parent ec7cb4ca57
commit e0445f621e
6 changed files with 336 additions and 6 deletions

View File

@@ -7,6 +7,8 @@ from time import sleep
from radiotrack import RadioTrack
from notifications import SongNotification
from top2000 import load_top2000
def get_current_song():
result = requests.get(
@@ -25,9 +27,11 @@ def putchar(char):
if __name__ == "__main__":
top2000 = load_top2000("2021.csv")
un = SongNotification()
previous = None
try:
while True:
try:
@@ -37,9 +41,14 @@ if __name__ == "__main__":
continue
if previous != track:
print(f"\nNew track: {track}")
print(f"\nNew track: {track}", end="")
track.save_image()
un.notify_song(track)
t2000 = top2000.get(track.id)
if t2000:
print(t2000.position)
else:
print()
un.notify_song(track, t2000)
else:
putchar(".")