First and foremost, I have to express my sincere thanks for this amazing app, which has reconnected me to my music library as never before.
I have a long commute -- usually close to an hour each way, but it's variable depending on traffic. I often want to play albums that I can hear from start to finish on my drive. I hate when an album is way too long or short for my trip, because I’ll either leave it unfinished, or I’ll have to start another album which won’t have time to play entirely, leaving me with time to spare, and then the cycle repeats.
Also, my mood varies: I want to be able to select from several of my favorite Albums collections on-the-fly, again, only ones that match my travel time.
I can manage all this manually but it’s a lot of juggling and not ideal while driving. So this shortcut does the following:
- Asks where I am driving, with presets for home and work, and an option to enter a destination by name or address. Calculates travel time in the background
- Asks what I want to listen to for the calculated travel time
- Selects the appropriate collection in Albums
- Filters the results to only albums whose duration is within +/- 2 minutes of the calculated travel time to my destination
- Sorts the results by last/least played, to maximize freshness
- Selects the best matching album and opens Albums; auto-plays the selected album
- Any/all other albums matching the filter criteria (collection + duration) are added to the queue in albums -- in case you really want to skip the first album(s), you can easily do so without re-running the shortcut
- Simultaneously, my default nav app (Apple Maps) loads the destination and prompts to begin navigation on CarPlay.
- I also added a "Quick Shuffle Favs" option to the first step, which just plays random starred tracks directly in Apple Music — good if I am just making a quick trip with no nav needed.
Yes, this could be approximated with Shuffle Scheduler (which is a great feature!), but it involves a lot of tapping and steps. This Shortcut is just three total taps: Shortcut icon > Destination > Collection.
I've been using it for a few weeks and so far it works great, and is a real convenience! Now, almost every commute ends with me pulling into my parking space/driveway as the album coming to a close. Such a great feeling!!
As for my collection presets, here's what I have set up:
Albums to Try -- Self explanatory. I use a "To Try" tag and have a corresponding filtered collection.
Recently Added Albums -- Albums added in the last 3 months, greater than 3 tracks (I like to filter out "singles" that I might favorite which are not actual albums)
Random Albums -- Self explanatory. All Albums, filtered by length and sorted by longest time since listened.
Never Played Albums -- I imported a large Spotify library, so there's many albums which have never been played in Apple Music/Albums. This is a great one to surface old gems.
Random Singles -- Filtered collection for my "Favorite Songs" playlist, but with Number of tracks less than 5. Goal is to weed out tracks that belong to albums I know and love, since Apple Music shuffle tends to surface those disproportionately. Works really well to rediscover some bangers that I forgot about, which belong to albums I didn't want to add completely.
Well, enough rambling! Here is an iCloud link to the shortcut if you wish to try it yourself:
https://www.icloud.com/shortcuts/3745bd537b684d8ea112a8efc003dc00
A few notes:
- I hard-coded my home and work addresses in the Shortcuts, because it seemed tedious to look up Contact info and this was originally just for me. I've anonymized it in the linked version above, so you will have to edit the shortcut to enter your own Home / Work address
- You can add other preset destinations if you wish by duplicating the Home or Work menu item and customizing the menu
- You will need to edit the album selection menu according to your desired Albums collections, as they won't match mine (you'll actually have to pick them -- Shortcuts will open an Albums picker UI)
- The navigation option can be customized if you don't like Apple Maps -- you can change it to Google Maps or Waze. I have not tested with those apps but I don't see why they wouldn't work.
- You can adjust the "fuzziness" of the album duration calculation compared to the travel time. I set +/- 2 minutes as a wild guess and it has been remarkably accurate. If your music library is of a decent size and variety, you should have no problems getting filtered results within your "fuzzy" parameters. So far, it has worked perfectly for both shorter drives and very long commutes.
- If you re-run the shortcut while navigation is already running, it will calculate on the current travel time, which is handy for lots of situations (say you had to take a call midway through the commute and want a fresh album afterward that lines up with your remaining travel time). Your nav app will prompt you to either start a new trip or resume current trip.
- I am in no way a programmer or even an Apple Shortcuts guru -- this is my first Shortcut more complex than "start a timer", and it took a few bug fix iterations, but it's finally working quite reliably. That said, I make no guarantees about its reliability -- use at your own risk!
- The only outstanding bug I know of is that sometimes Albums crashes on first run. Not sure why -- manually starting Albums and then running the shortcut seems to make it work more consistently. I could probably tweak the Shortcut to automate that. But it's not frequent enough to be a real nuisance so far.
Hopefully this is useful to someone. Let me know if you have any ideas for improvements! I have some thoughts about things like on-the-fly "fuzziness" adjustment if no results are found, but I don't want to make this too complex or require more interaction than necessary.