Skip to content

Clear now-playing.txt when the app closes #53

@paulpv

Description

@paulpv

Problem

  • The player writes the current track name to now-playing.txt, but the file still contains stale data after the app is closed.
  • Downstream tools that read now-playing.txt (e.g., overlays or stream widgets) continue to show the last track even though nothing is playing.

Proposal

  • Detect when the app window or tab is being closed and clear the contents of now-playing.txt before exiting.
  • Consider also clearing the file if playback stops because the selected folder is closed or the track list empties.

Acceptance Criteria

  • Closing the player tab or window results in an empty now-playing.txt file.
  • Clear behavior does not trigger while general playback is paused or when switching tracks.
  • Behavior works consistently across supported Chromium-based browsers.

Notes

  • Ensure the cleanup logic aligns with the File System Access API limitations and handles permission prompts gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions