Playlist Maker Deprecated

Turns the songs I have favorited into playlists, and rebuilds only the playlists it made itself.

Deprecated. No further development is planned. The code and its tests stay as they are.Nothing new is coming. The code stays as it is.

[write-playlists] no library read on this path: the grouping is checked against its own songs, so a song missing from the saved file cannot be detected here
[write-playlists] validated: 3 proposed -> 3 playlists of 2-6 songs (0 repairs; bounds: 2-30 songs, at most 6 playlists)
[write-playlists] DRY RUN: nothing was changed. This is what would happen:
[write-playlists]
[write-playlists]   WOULD CREATE Sunday Morning Coffee: 2 songs, as "✦ Sunday Morning Coffee" in Music
[write-playlists]       + Paper Kites by June Ashworth (from Rainy Day Static)
[write-playlists]       + Nightswimming Pool by The Ordinary Hours (from Late Night, No Rush)
[write-playlists]
[write-playlists]   WOULD UPDATE Warehouse Hours: 6 songs after (+2, description)
[write-playlists]       + Strobe Alley by Cassette Rituals (from Late Night, No Rush)
[write-playlists]       + Still Early Yet by The Ordinary Hours (from Rainy Day Static)
[write-playlists]
[write-playlists]   WOULD UPDATE Late Night, No Rush: 4 songs after (+1, -2, description)
[write-playlists]       + Coffee And Rain by June Ashworth
[write-playlists]       - Nightswimming Pool by The Ordinary Hours (to Sunday Morning Coffee)
[write-playlists]       - Strobe Alley by Cassette Rituals (to Warehouse Hours)
[write-playlists]
[write-playlists]   WOULD DELETE Rainy Day Static: 2 songs, no longer in the grouping
[write-playlists]       - Paper Kites by June Ashworth (to Sunday Morning Coffee)
[write-playlists]       - Still Early Yet by The Ordinary Hours (to Warehouse Hours)
[write-playlists]
[write-playlists] 4 playlists would change: 1 created, 2 updated, 1 deleted
[write-playlists] 5 songs added (4 moved from another playlist, 1 new), 4 removed
[write-playlists] ok: saved, no API calls, 0 created, 0 updated, 0 deleted, 0ms
The dry run against the committed fixture library: the grouping it validated, then per playlist what it would create, update and delete, the songs entering and leaving each with the playlist a moved song came from, and the totals.What it prints when you ask what it would do: each playlist it would add, change or remove, which songs would move where, and a count at the end.
Architecture diagram: Playlist Maker favorited songs, read neverwritten nothing new only the songs last time didnot cover only playlists it owns Scheduled run Library read Music.app library Run snapshot Delta selection Nothing to do Track pack Theme pass Assignment pass Holding area Grouping gate Write plan Dry-run diff Ownership registry Ownership guard Playlist writer Run record Telegram summary
The music library is read for its favorited songs and written back only through the ownership guard, which lets nothing past that this tool did not create.It reads which songs you have liked, and the only playlists it is ever allowed to change are the ones it made itself.

How to use it

It runs by itself every six hours; everything below is for previewing it or running it now.

It runs on its own, four times a day; the rest is for checking what it's about to do, or running it now.

  1. Like songs in Music, and stop The favorited songs are the whole input. There is nothing else to keep up to date.Just tap the heart on songs you like. That is the only thing it reads.
  2. Preview it: ask for the dry run Prints what it would create, update and delete: the songs entering and leaving each, and where a moved song came from.Shows what it would do: new playlists, changed ones, and which songs would move, without doing any of it.
  3. Or run it now, without waiting for the schedule The same read, grouping and write the scheduled run does, printed in the past tense by the same renderer.Does the whole thing straight away, and tells you what it did in the same format the preview used.
  4. Read the record afterwards Every run leaves a structured line: what it read, asked, repaired, wrote, and how it ended.Every run writes down what it did, so you can check last Tuesday's run without opening anything.

It only writes to Music.app when a playlist it created needs changing, and sends nothing when a run found nothing new.

It leaves your own playlists completely alone, and it stays quiet on the runs where nothing changed.

It Can Only Touch Its Own Playlists

Music lets two playlists share a name, and an identity survives a rename. So a name is a label, only the identity is proof. Every playlist it creates is recorded under that identity before a song goes in, and the guard refuses any destructive write against anything absent from that record. Rename one and it stays yours, and managed.

Two playlists can have the same name, so a name proves nothing about which one is which. Instead it writes down an identity for each playlist it makes, and refuses to change anything not on that list. If you rename one of its playlists, it keeps your name and carries on looking after the songs.

A Quiet Week Costs Nothing

What to send is worked out by subtraction from the surviving grouping rather than from a list of what is new, which is what makes it safe: songs orphaned by a run that died half way are picked up by the same rule. Unliking needs no special case. A song no theme fits is parked rather than forced somewhere wrong.

It works out what to sort by asking which liked songs are not in a playlist yet, so anything missed by an interrupted run gets picked up next time. Songs you unlike drop out on their own. A song that fits nowhere is set aside rather than forced into the wrong playlist.

Nothing Is Applied Unexamined

A song missing, doubled or never sent means the answer is not a grouping of this library, and none of those can be fixed without deciding taste, so the run fails. Playlists merely too small or too many are repaired, and each repair is logged. The preview renders the plan itself, so what it shows is what would run.

If a song went missing, turned up twice, or was never one of yours, the whole run stops. Those cannot be fixed without guessing. Playlists that come out too small or too many are tidied up, and it says so. The preview is built from the real plan, so it cannot lie to you.

Runs Itself, Says Something Only When There Is Something

The interval is chosen from the cost of a run that finds nothing, which is most of them. A run that changed a playlist, and any run that gave up, sends a short summary; a successful run with nothing to do sends nothing at all, which is what keeps the messages worth reading.

It runs four times a day because a run that finds nothing new is nearly free. You hear about it when a playlist actually changed, or when something went wrong. Never on the quiet runs, so the messages stay worth opening.