~ knotless Search/
↑↓ move↵ open⇧↵ all results

geesawra.industries/hydraulophone

An unofficial YouTube Music app for iPhone, iPad, and Mac.

0
0
main
32 lines · 1.4 KB Raw History
# 0010 — Restore the last playback queue

Date: 2026-09-24
Status: accepted

## Decision

Persist the active queue's catalog metadata and playback state in the app's
standard local preferences store. Restore the queue, occurrence order, current
occurrence, shuffle/repeat settings, and last position after process restart.
Restoration is paused: the app never starts audio without a deliberate Play
action.

Persist only `Song` metadata and queue identifiers. Never persist InnerTube
media URLs, request credentials, or session cookies. On Play, resolve a fresh
stream through the normal authenticated playback path, then seek to the saved
position. If the saved position is at the end of the track, start that track
from zero.

Save structural changes immediately, save position at most every five seconds,
and force a save on pause, seek, and app resign. Explicit Stop and sign-out
clear the saved queue. Fixture and dependency-injected app instances do not use
the production queue store.

## Rationale and risks

This preserves the listener's queue through ordinary app termination without
assuming expiring stream URLs survive a restart. UserDefaults is appropriate
for a bounded, non-secret queue archive; the archive has a schema version,
entry and byte limits, and validation before restoration. A crash may lose up
to five seconds of position. Catalog metadata can become stale, but stream
resolution and authentication remain live and authoritative.