From e4b7f91b6076496ffc6d3285d61ffa547a55786f Mon Sep 17 00:00:00 2001 From: Disha Girish Date: Sat, 16 Sep 2017 16:17:01 +0530 Subject: [PATCH] Fixed --- song_finder.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/song_finder.py b/song_finder.py index a3040ad..a2c8652 100755 --- a/song_finder.py +++ b/song_finder.py @@ -22,15 +22,21 @@ def searchStringLogic(cursor, search_string): words = search_string.split(' ') for i in range(len(words) - 1): artist = '-'.join(words[0:i]) - song = '-'.join(words[i+1:]) - print('Artist', artist) - print('Song', song) - - artists = getArtists(cursor, song) artist_result = compareArtists(artists, artist) if artist_result is not None: print(artist_result) - return (artist_result, song) + song = '-'.join(words[i+1:]) + + else: + artist = '-'.join(words[i+1:(len(words)-1)]) + artist_result = compareArtists(artists, artist) + print(artist_result) + song = '-'.join(words[0:i]) + + print('Artist', artist) + print('Song', song) + return (artist_result, song) + return (None, None)