diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..db39576 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index abab8bc..a221f36 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,7 +30,7 @@ android { minSdk 24 targetSdk 33 versionCode 1 - versionName "1.1" + versionName "1.1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/python/.cache b/app/src/main/python/.cache new file mode 100644 index 0000000..e1a93d4 --- /dev/null +++ b/app/src/main/python/.cache @@ -0,0 +1 @@ +{"access_token": "BQA3-FzI11P2iRxeFtdkzQnX45frJyIpJKnRSMVejj7LyEKF5GffE2TrUFCWy1Z2mVALXeakMrte_vtSvejiuCkt6lBMWyPdA4GaNR6s7WSOCzUNM1WE", "token_type": "Bearer", "expires_in": 3600, "expires_at": 1680794006} \ No newline at end of file diff --git a/app/src/main/python/__pycache__/SpotifyApiCredentials.cpython-310.pyc b/app/src/main/python/__pycache__/SpotifyApiCredentials.cpython-310.pyc new file mode 100644 index 0000000..09d6c69 Binary files /dev/null and b/app/src/main/python/__pycache__/SpotifyApiCredentials.cpython-310.pyc differ diff --git a/app/src/main/python/main.py b/app/src/main/python/main.py index 232ca01..e9afc27 100644 --- a/app/src/main/python/main.py +++ b/app/src/main/python/main.py @@ -28,7 +28,7 @@ def songSearchSpotifyPlaylist(albumLink): offset = 0 songs = [] try: - tracks = sp.album_tracks(album_id=albumLink, offset=offset) + tracks = sp.playlist_tracks(playlist_id=albumLink, offset=offset) except requests.exceptions.ConnectionError: success = 1 print("Unable to connect to the internet") @@ -38,16 +38,16 @@ def songSearchSpotifyPlaylist(albumLink): if success == 0: for key in tracks['items']: - songs.append(f"{key['name']} {key['artists'][0]['name']}") + songs.append(f"{key['track']['name']} {key['track']['artists'][0]['name']}") while done: if len(songs) == offset + 100: try: - tracks = sp.album_tracks(album_id=playlistLink, offset=offset) + tracks = sp.playlist_tracks(playlist_id=playlistLink, offset=offset) except requests.exceptions.ConnectionError: success = 1 print("unable to connect to the internet") for key in tracks['items']: - songs.append(f"{key['name']} {key['artists'][0]['name']}") + songs.append(f"{key['track']['name']} {key['track']['artists'][0]['name']}") offset += 100 if len(songs) < offset + 100: done = False @@ -66,7 +66,7 @@ def songSearchSpotifyAlbum(playlistLink): offset = 0 songs = [] try: - tracks = sp.playlist_items(playlist_id=playlistLink, offset=offset) + tracks = sp.album_tracks(album_id=playlistLink, offset=offset) except requests.exceptions.ConnectionError: success = 1 print("Unable to connect to the internet") @@ -76,16 +76,16 @@ def songSearchSpotifyAlbum(playlistLink): if success == 0: for key in tracks['items']: - songs.append(f"{key['track']['name']} {key['track']['artists'][0]['name']}") + songs.append(f"{key['name']} {key['artists'][0]['name']}") while done: if len(songs) == offset + 100: try: - tracks = sp.playlist_items(playlist_id=playlistLink, offset=offset) + tracks = sp.album_tracks(album_id=playlistLink, offset=offset) except requests.exceptions.ConnectionError: success = 1 print("unable to connect to the internet") for key in tracks['items']: - songs.append(f"{key['track']['name']} {key['track']['artists'][0]['name']}") + songs.append(f"{key['name']} {key['artists'][0]['name']}") offset += 100 if len(songs) < offset + 100: done = False