Find and replace local versions of Apple Music files in a playlist

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.

UntitledImage

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.

Posted

in

,

Current Spins

Top Albums

Check out my album Set It All Down on your favorite streaming service.


Posts Worth Reading:


Letterboxd


Reading Notes

  • Who profits from our constant state of dissatisfaction? The answer, of course, is painfully obvious. Every industry that sells a solution to a problem you […]
  • the shifts have been in place for awhile. A certain kind of book—say those reviewed in the NYRB—will become like opera, or theater, or ballet, […]
  • • No more struggle: “Whatever arises, train again and again in seeing it for what it is. The innermost essence of mind is without bias. […]
  • The real problem, in my mind, isn’t in the nature of this particular Venture-Capital operation. Because the whole raison-d’etre of Venture Capital is to make […]
  • . The EU invokes a mechanism called the precautionary principle in cases where an innovation, such as GMOs, has not yet been sufficiently researched for […]

Saved Links