Skip to content

Refactor resume to session queue model with autosave and takeover lock#105

Open
pythrick wants to merge 1 commit intobjarneo:mainfrom
pythrick:feat/resume-session-from-upstream-main
Open

Refactor resume to session queue model with autosave and takeover lock#105
pythrick wants to merge 1 commit intobjarneo:mainfrom
pythrick:feat/resume-session-from-upstream-main

Conversation

@pythrick
Copy link
Contributor

@pythrick pythrick commented Mar 18, 2026

This replaces the earlier resume implementation with a session queue model and lock-based single-instance handling.

What changed:

  • Store the current queue in ~/.config/cliamp/session_queue.toml
  • Store lightweight resume metadata in ~/.config/cliamp/resume.json (current_index, position_sec)
  • Restore session queue + index + position on startup (when no positional args are passed)
  • Autosave session changes with a short debounce and periodic position updates while playing
  • Keep shuffle/repeat as user config preferences (not session metadata)
  • Add single-instance session lock to prevent concurrent resume file races
  • Add --takeover to terminate the running instance and acquire the lock

Fixes #104

@pythrick pythrick force-pushed the feat/resume-session-from-upstream-main branch from eaa7f85 to 49623aa Compare March 19, 2026 14:10
@pythrick pythrick changed the title Restore last session on startup and resume yt-dlp position Refactor resume to session queue model with autosave and takeover lock Mar 19, 2026
@pythrick pythrick force-pushed the feat/resume-session-from-upstream-main branch 2 times, most recently from 8d9447f to cd4ff85 Compare March 19, 2026 14:35
@pythrick pythrick force-pushed the feat/resume-session-from-upstream-main branch from cd4ff85 to b15f0a1 Compare March 19, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session resume falls back to sample radio; yt-dlp resume missing

1 participant