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

fix limit

This commit is contained in:
Lukas Winkler 2018-02-15 21:07:26 +01:00
parent 507b12c62d
commit bb7f221004
No known key found for this signature in database
GPG key ID: 94AFBE7C2656A5B5

View file

@ -1,7 +1,7 @@
import sys
from time import sleep
import spotipy
import sys
from spotipy.oauth2 import SpotifyClientCredentials
from config import spotify
@ -10,10 +10,12 @@ from models import *
crm = SpotifyClientCredentials(**spotify)
sp = spotipy.Spotify(client_credentials_manager=crm)
if len(sys.argv) >1:
limit=sys.argv[1]
if len(sys.argv) > 1:
limit = sys.argv[1]
else:
limit = 50
for song in Song.select().where((Song.spotify_data.is_null()) & (Song.show == 0)).limit(50):
for song in Song.select().where((Song.spotify_data.is_null()) & (Song.show == 0)).limit(limit):
print(song.title)
if song.artist.isupper():
song.artist = song.artist.title()