All the things
This commit is contained in:
@@ -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(".")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user