mirror of
https://github.com/cooperhammond/irs.git
synced 2025-02-01 08:01:00 +00:00
Added a no results message
This commit is contained in:
parent
af1255df5d
commit
e9477a3101
|
@ -190,6 +190,7 @@ class Manager:
|
||||||
def get_album_contents(self, search):
|
def get_album_contents(self, search):
|
||||||
spotify = spotipy.Spotify()
|
spotify = spotipy.Spotify()
|
||||||
|
|
||||||
|
|
||||||
results = spotify.search(q=search, type='album')
|
results = spotify.search(q=search, type='album')
|
||||||
items = results['albums']['items']
|
items = results['albums']['items']
|
||||||
if len(items) > 0:
|
if len(items) > 0:
|
||||||
|
@ -210,6 +211,9 @@ class Manager:
|
||||||
song = song.split(" - ")[0]
|
song = song.split(" - ")[0]
|
||||||
names.append(song)
|
names.append(song)
|
||||||
return names, album_id
|
return names, album_id
|
||||||
|
else:
|
||||||
|
print (bc.FAIL + "No results were found for your album search." + bc.ENDC)
|
||||||
|
exit(1)
|
||||||
|
|
||||||
def get_album_art(self, artist, album, id=None):
|
def get_album_art(self, artist, album, id=None):
|
||||||
spotify = spotipy.Spotify()
|
spotify = spotipy.Spotify()
|
||||||
|
@ -227,7 +231,9 @@ class Manager:
|
||||||
|
|
||||||
def rip_album(self):
|
def rip_album(self):
|
||||||
search = self.args.artist + " " + self.args.album
|
search = self.args.artist + " " + self.args.album
|
||||||
songs, album_uri = self.get_album_contents(search)
|
print(self.get_album_contents(search))
|
||||||
|
import time
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
if not songs:
|
if not songs:
|
||||||
print (bc.FAIL + "Could not find album." + bc.ENDC)
|
print (bc.FAIL + "Could not find album." + bc.ENDC)
|
||||||
|
|
Loading…
Reference in a new issue