Skip to content

Commit

Permalink
Update README.md and fix number of ids for saved tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
shifoc committed May 11, 2024
1 parent ad7945b commit b33b216
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
This script facilitates the migration of your Anghami playlists to Spotify playlists by logging into both platforms.

## Installation
This script runs on Node.js. If you haven't already, you can install it by following the instructions on the Node.js website.
This script runs on Node.js. If you haven't already, you can install it by following the instructions on the [Node.js website](https://nodejs.org/).

## Using Your Own Credentials
### Spotify:
Register your app and obtain your credentials from the Spotify for Developers Dashboard.
Create a new app in the dashboard and add http://localhost:3000/callback to the app's redirect URL list.
After creating your app, update the .env file with the client ID and client secret obtained from the app settings in the dashboard.
After creating your app, update the .env file with the client ID and client secret obtained from the app settings in the [dashboard](https://developer.spotify.com/dashboard). You should also add the user to the app's list of users in the dashboard's settings.
```env
SPOTIFY_CLIENT_ID="YOUR_CLIENT_ID"
SPOTIFY_CLIENT_SECRET="YOUR_CLIENT_SECRET"
Expand Down
4 changes: 2 additions & 2 deletions src/spotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const saveTracks = async (tracks) => {
continue;
}
}
const batchSize = 100;
const batchSize = 50;
const totalTracks = spotifyTracksIds.length;
for (let i = 0; i < totalTracks; i += batchSize) {
const batch = spotifyTracksIds.slice(i, i + batchSize);
Expand All @@ -85,7 +85,7 @@ const uploadToSpotify = async () => {
return;
}
console.log('Filtering out playlists not created by you...');
anghamiPlaylists = anghamiPlaylists.filter(playlist => playlist.ownerID === playlist.userID && playlist.playlistName !== '$1234567890DOWNLOADED#');
anghamiPlaylists = anghamiPlaylists.filter(playlist => playlist.ownerID === playlist.userID && playlist.playlistName !== '$1234567890DOWNLOADED#' && playlist.playlistName !== '$1234567890ACRED#');
console.log(`Uploading ${anghamiPlaylists.length} playlists to Spotify...`);
// Create a Spotify playlist for each Anghami playlist
for (const anghamiPlaylist of anghamiPlaylists) {
Expand Down

0 comments on commit b33b216

Please sign in to comment.