1
0
Fork 0
mirror of https://github.com/Findus23/RadioStats.git synced 2024-09-19 16:03:48 +02:00

start with id

This commit is contained in:
Lukas Winkler 2018-02-23 21:02:23 +01:00
parent 62e2fd5498
commit 3b80dfc630
No known key found for this signature in database
GPG key ID: 94AFBE7C2656A5B5

View file

@ -17,11 +17,12 @@ else:
limit = 50
query = Song.select().where((Song.show == 0))
if not len(sys.argv) > 2 or sys.argv[2] != "force":
if not len(sys.argv) > 3 or sys.argv[2] != "force":
query = query.where(Song.spotify_data.is_null())
else:
print("fetching empty")
query = query.where(Song.spotify_data == 0)
starting = int(sys.argv[2])
print("fetching empty starting from {id}".format(id=starting))
query = query.where((Song.spotify_data == 0) & (Song.id >= starting))
for song in query.limit(limit):
song.title = song.title.replace("+", " ")
print(song.title)