I have a bunch of playlists that I’ve crafted over the years and when I moved to Apple Music I was disappointed to see my local library copies of those files replaced with Apple Music’s versions. It seemed to be totally arbitrary and, importantly, the play count, rating, etc. was different on my local library copies then it was on the Apple Music versions of those songs.
In the above, I know that I have a copy of Can’t get There from Here in my local library, so not sure why the Apple Music one was substituted in my playlist. Anyway, I want my local version in there so I can track stats, etc.
I poked around the venerable Doug’s Scripts for a while but couldn’t quite find what I needed so I wrote this script which:
Select/start playing a song in the playlist you want to work with
Creates a new playlist called “$playlistname Local Files.”
Checks each song in the active playlist to see if it’s local or Apple Music
If it’s not Apple Music, it just adds it to the Local Files version of the playlist
If it is Apple Music, it checks to see if there is a song in your library with the same Artist and Song name
It then copies the tracks that result from that search to the Local Files version of the playlist
If it can’t find a local copy, it adds the Apple Music version to the “Local Files” copy of the playlist
The search is really loose so it will find multiple local copies if you have them which is a bit of a pain in the butt. SO you need to go to the new playlist and remove the local versions (live! Remix!, etc.) from the playlist.
I’ve run this on a few big playlists with ~1000 songs and it runs just fine. It might be helpful for a few folks so I’m putting it up here but that said, I wouldn’t download and run this unless you know what the code is doing.
The Alison is a real gem that I found digging through Bandcamp. I’m withholding judgment a bit on Epic’s takeover of Bandcamp. I hope it doesn’t destroy the product/community and/or turn it into an onboarding platform for musicians to sell NFTs.
There are a lot of strange ones on the list, too, because I’ve found this Apple Music Playlist called Sleep Cycles that has a bunch of really excellent ambient drone stuff that I use to sleep on the couch when family obligations force me up at 4:30AM. So if you’re listening and wondering why those tracks are on there, it means I was up early so many times that some of the tracks got repeated, a bunch. Not entirely sure how or if to filter them out.
Anyway, The Weather Station was another gem of a find. So suggestive of Kate Bush but the band is also crackling with quiet intensity which I love.
There are a few key variables in the shortcut, most are defined through menus as you run the shortcut. The only two you need to explicitly add to the top of the shortcut are username and APIKEY. You can get a last.fm API key here.
Username: the name of the user to use for a data source. I run this with my own username but also run it every once in a while with my musical neighbors’ usernames to create discovery-type playlists
Period: overall | 7day | 1month | 3month | 6month | 12month – The time period over which to retrieve top tracks for. You’ll select this from a menu when you run the shortcut.
Threshold (e.g. only include songs that have been listened to more than x times): the rationale for this variable is sometimes when creating a playlist you only want to include tracks that you (or whatever username you’re querying) has listened to multiple times. You’ll select this threshold from a menu when you run the shortcut.
Limit: the number of tracks to pull (note that if you select 50 tracks here but set the # of times listened threshold to a high number the playlist will only include the tracks that meet that threshold so may include less than 50 tracks).
This has been working pretty reliably for me for the past week or so, so I’m sending v 1.0 out into the world, hope you enjoy and find it useful. You can download it here.