Documentation
¶
Index ¶
- type Launcher
- type PlaybackHandle
- type PlayerDef
- type ScrobbleResult
- type Scrobbler
- type Service
- func (s *Service) MarkUnwatched(ctx context.Context, itemID string) error
- func (s *Service) MarkWatched(ctx context.Context, itemID string) error
- func (s *Service) Play(ctx context.Context, item domain.MediaItem, playlist ...domain.MediaItem) (PlaybackHandle, error)
- func (s *Service) Resume(ctx context.Context, item domain.MediaItem, playlist ...domain.MediaItem) (PlaybackHandle, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Launcher ¶
type Launcher struct {
// contains filtered or unexported fields
}
Launcher launches media URLs in an external player
func NewLauncher ¶
NewLauncher creates a new Launcher seekFlag is optional - if empty, we look up the flag from our known players table
type PlaybackHandle ¶ added in v0.0.2
type PlaybackHandle struct {
ResultCh <-chan ScrobbleResult
StatusCh <-chan string
}
PlaybackHandle provides channels for monitoring progress and final result.
type PlayerDef ¶
type PlayerDef struct {
Binary string
SeekFlag string // Use %d for seconds placeholder, e.g., "--start=%d" or "-ss %d"
}
PlayerDef defines a player binary and its seek flag format
type ScrobbleResult ¶ added in v0.0.2
type ScrobbleResult struct {
Item domain.MediaItem
ItemID string
Title string
FinalPosMs int64
Duration time.Duration
AutoMarked bool
Err error
}
ScrobbleResult contains the final outcome of a monitored playback session.
type Scrobbler ¶ added in v0.0.2
type Scrobbler struct {
// contains filtered or unexported fields
}
Scrobbler monitors a running player process and reports progress to the server.
func NewScrobbler ¶ added in v0.0.2
func NewScrobbler(client domain.PlaybackClient, logger *slog.Logger) *Scrobbler
NewScrobbler creates a new scrobbler.
func (*Scrobbler) Monitor ¶ added in v0.0.2
func (s *Scrobbler) Monitor(ctx context.Context, cmd *exec.Cmd, ipcSocket string, playlistStart int, items ...domain.MediaItem) PlaybackHandle
Monitor starts a background goroutine to track playback progress for one or more items. If multiple items are provided, it uses mpv IPC to detect which one is active.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service orchestrates playback operations
func NewService ¶
NewService creates a new playback service
func (*Service) MarkUnwatched ¶
MarkUnwatched marks an item as unwatched
func (*Service) MarkWatched ¶
MarkWatched marks an item as fully watched