resume

package
v1.60.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package resume persists the last-played track and position so playback can be resumed on the next launch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(path string, positionSec int, playlist string)

Save writes the resume state to disk. No-ops for empty path or zero/negative position to avoid overwriting a valid resume file with useless data. Errors are silently ignored so a failed write never disrupts normal exit.

Types

type State

type State struct {
	Path        string `json:"path"`
	PositionSec int    `json:"position_sec"`
	Playlist    string `json:"playlist,omitempty"`
}

State holds enough information to resume a previous playback session.

func Load

func Load() State

Load reads the resume state from disk. Returns a zero State if the file does not exist or cannot be parsed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL