Automation with Music Library Tracker
With the release of iOS 12 and Music Library Tracker v1.6.0, it is now possible to perform some automation whilst monitoring your music library. For example, you can perform searches across date ranges or specific dates to find out the number of tracks that have been added, deleted, or changed. Music Library Tracker exposes data via the x-callback-url mechanic allowing for integration with the Shortcuts app along with Siri (i.e. "Hey Siri, how many songs have been deleted in the past week?")
To get this to work, you'll need to download the free Shortcuts app from Apple (previously "Workflow"). You can then use one of the example Shortcuts below or use the following x-callback-url schema:
Updates for today
Updates for a specific date
Updates for a date range
When specifying a date, it should be in reverse syntax:
yyyy-MM-dd. For example, 31st December 2017 would be
2017-12-31 whereas the 14th February 2018 would be
2018-02-14. You can get dates into this format within the Shortcuts app by using the format string
yyyy-MM-dd within the Format Date action:
Once you have your URL, you can then use the Open X-Callback URL action to open it followed by Get Variable with
X-Callback Result and Get Dictionary from Input to produce a dictionary containing the following keys:
added: The total number of tracks added to your library
changed: The total number of tracks with any changes to them
deleted: The total number of tracks which have been removed from your library
date: A string that shows the date or date range used for the above results
Once a Shortcut has been created, you can set up a voice recording with Siri. This enables you to perform such actions as "Hey Siri, how many songs have been deleted today".
The links below will open the Shortcuts app on your device (if installed). Please ensure you have Music Library Tracker v1.6.0 or higher (you can see which version you have within the settings screen in the app).
- Changes to music library today
- Changes to music library yesterday
- Changes to music library in the past week
- Number of songs that have been deleted in the past week
Frequently Asked Questions
Why have you added automation via x-callback-url rather than a Siri Intent?
Good question! Whilst Apple have added support for custom Siri Intents with iOS 12, they are unfortunately fairly limited in what they can do. Whilst they can be called from the Shortcuts app they can't be passed data nor can they return data so their use is really more for displaying something within their own UI. For example, we'd need to build some custom UI into the Music Library Tracker app to let you specify a date range at which point you could save it as a Siri Shortcut; tapping that would give you a response but you wouldn't be able to do anything with that number nor would you be able to dynamically send new dates or ranges to the shortcut with the Shortcuts app.
Can you add a shortcut for monitoring your library?
I did look into this but unfortunately the memory constraints were such that this didn't work reliably enough in the background to be of much use. Whilst I could add a basic shortcut that opens the app to the scanning page (similar to the 3D Touch action on the app icon) this didn't seem like it would be that useful to most people. Please let me know if you'd like this for some reason although we'd always recommend enabling push notifications for automatic tracking as this is far more reliable.
Are you planning on adding further automation?
I may add extra automation in future such as track metadata but this will be guided by feedback. If you'd like to see something specific, please get in touch.
What if you haven't answered my question here?
If your question isn't answered here, please contact us.