danguilherme / spotivy

:musical_score: Download music videos from Spotify playlists
https://danguilherme.github.io/blog/spotivy
MIT License
85 stars 11 forks source link

Fix download single track JS error #7

Closed lnfnunes closed 7 years ago

lnfnunes commented 7 years ago

This should fix issue #6

As a plus, I've noticed that single file download wasn't writing to .downloaded manifest file, so it always re-download even if the file was already downloaded. I've fixed that too.

Evidences:

danguilherme commented 7 years ago

Great, thanks! I don't have access to a computer right now, tomorrow I'll test it and then we can merge.

Also, I noticed you're downloading tracks as audio. There were an issue with files not playing in certain apps (issue #1). Hopefully it's fixed, but I could not test in a wide range of apps. Feel free to report any issue you may have with them!

lnfnunes commented 7 years ago

Ok! But ATM I've no problem with downloaded audios... Actually in this fix case, I've used audio files to be faster as video. My focus was on download logic only 😛

danguilherme commented 7 years ago

It works perfectly!

Will need just a little change. As the metadata is being saved on every track (on downloadTrack), we don't need it to be saved again when downloading playlists (downloadPlaylist uses downloadTrack). You'd just need to remove the saveMetadata call from it: https://github.com/lnfnunes/spotivy/blob/d1d64c6f55283a89bdbd95fee753fc31587737d0/index.js#L226.

lnfnunes commented 7 years ago

done!

danguilherme commented 7 years ago

Thank you!