Closed Reiszecke closed 1 year ago
Updating this, the action has triggered and it did actually save the non-discover-weekly playlist 🎉🎉
So the MULTIPLE_PLAYLIST_CONFIG
seems to work in this PR. I'm very confident the legacy functionality will also trigger fine on Monday (tested it previously by hardcoding the day to the current day to verify) so from my side it's ready to merge.
Will update the README.md accordingly once you've commented what way you'd like it to be included.
Hey! Nice one! Thanks for your PR, this looks good. 👍
I'm away for a few weeks, but when I get back I'll remove the default functionality as well since the multi-week playlist config can cover this now. As for the readme, if you could update the repo's introduction & "Initial Set Up" section that would be great, but I can do that too when I get back (it's a bit awkward for me to do it from phone). I'll also rename the repository from "spotify-save-discover-weekly" to "spotify-save-playlists-cron" or something similar.🙂
I've now removed the old code using DISCOVER_WEEKLY_IDs and updated the readme with new usage instructions.
Bro I hope you're doing well - I wanted to comment on whether you really want to introduce a breaking change (since forks won't get notified that their old WEEKLY parameter doesn't work anymore) and then you caught me a bit off guard when "can you do this in a few weeks" turned into "4 days" haha
Thank you for your work man, will try your upstream commits soon
Hey man, first of all tysm for the repo! I’ve wasted so much time with "offline mode" workarounds to recover invalidated playlists that I took a minute to extend your repo’s functionality a bit.
There are a few other playlists that Spotify delivers to you on a weekly (or even daily) basis. One example is each user's Release Radar. I didn’t want to hardcode more env variables to your project so I extended it by another option: Passing an array of playlists to include in the sync.
Noteworthy changes:
Your token verification in the
main()
was broken - if the token doesn’t exist, it crashes much earlier. It likely worked at some point until you’ve added thestrip()
calls (cannot strip on typeNone
). I have added a helper function that only strips on non-None values.Changed the yaml to run EVERY day, but in order to maintain backward-compatibility I made
process_discover_weekly_playlist()
(your existing logic forDISCOVER_WEEKLY_ID
andSAVE_TO_ID
) only proceed on Monday.Added a
process_multiple_playlists()
function.process_multiple_playlists()
parses a JSON from theMULTIPLE_PLAYLIST_CONFIG
env variable. You can find some info on the JSON’s structure inmulti_playlist_builder.py
. For each playlist in there, you can set source and target along with a weekday to run at which makes sense for every playlist that doesn’t update on Monday.~Haven’t tested the GitLab Actions cronjob configuration yet, let’s see if it triggers and works tomorrow (Release Radar).~ Works perfectly :)