player

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteHistoryEntry

func DeleteHistoryEntry(mediaID int) error

DeleteHistoryEntry deletes a history entry

func DeleteIncognitoHistory

func DeleteIncognitoHistory() error

DeleteIncognitoHistory deletes the incognito history file

func GetHistoryPath

func GetHistoryPath() (string, error)

GetHistoryPath returns the path to the history file

func GetHistoryPathWithConfig

func GetHistoryPathWithConfig(cfg *config.Config) (string, error)

GetHistoryPathWithConfig returns the path to the history file (incognito or normal) Note: This is kept for compatibility but incognito mode is now runtime-only

func GetHistoryPathWithIncognito

func GetHistoryPathWithIncognito(incognito bool) (string, error)

GetHistoryPathWithIncognito returns the path to the history file (incognito or normal)

func SaveHistoryEntry

func SaveHistoryEntry(entry HistoryEntry) error

SaveHistoryEntry saves or updates a history entry

func SaveHistoryEntryWithConfig

func SaveHistoryEntryWithConfig(entry HistoryEntry, cfg *config.Config) error

SaveHistoryEntryWithConfig saves or updates a history entry (incognito or normal)

func SaveHistoryEntryWithIncognito

func SaveHistoryEntryWithIncognito(entry HistoryEntry, incognito bool) error

SaveHistoryEntryWithIncognito saves or updates a history entry (incognito or normal)

Types

type HistoryEntry

type HistoryEntry struct {
	MediaID       int
	Progress      int
	EpisodesTotal int
	Timestamp     string // Resume timestamp (where you stopped watching)
	Duration      string // Total duration of the episode (HH:MM:SS format)
	LastWatched   string // Last watched timestamp (when you last completed an episode)
	Title         string
}

HistoryEntry represents a watch history entry

func GetHistoryEntry

func GetHistoryEntry(mediaID int, episode int) (*HistoryEntry, error)

GetHistoryEntry gets a specific history entry (defaults to normal history)

func GetHistoryEntryWithIncognito

func GetHistoryEntryWithIncognito(mediaID int, episode int, incognito bool) (*HistoryEntry, error)

GetHistoryEntryWithIncognito gets a specific history entry (incognito or normal)

func LoadHistory

func LoadHistory() ([]HistoryEntry, error)

LoadHistory loads the watch history

func LoadHistoryWithConfig

func LoadHistoryWithConfig(cfg *config.Config) ([]HistoryEntry, error)

LoadHistoryWithConfig loads the watch history (incognito or normal)

func LoadHistoryWithIncognito

func LoadHistoryWithIncognito(incognito bool) ([]HistoryEntry, error)

LoadHistoryWithIncognito loads the watch history (incognito or normal)

type IINAPlayer

type IINAPlayer struct {
	// contains filtered or unexported fields
}

IINAPlayer implements IINA player (macOS)

func NewIINAPlayer

func NewIINAPlayer(cfg *config.Config) *IINAPlayer

NewIINAPlayer creates a new IINA player

func (*IINAPlayer) Name

func (p *IINAPlayer) Name() string

Name returns the player name

func (*IINAPlayer) Play

func (p *IINAPlayer) Play(ctx context.Context, videoData *providers.VideoData, title string, resumeFrom string) (*PlaybackInfo, error)

Play plays a video using IINA

type MPVPlayer

type MPVPlayer struct {
	// contains filtered or unexported fields
}

MPVPlayer implements MPV player

func NewMPVPlayer

func NewMPVPlayer(cfg *config.Config) *MPVPlayer

NewMPVPlayer creates a new MPV player

func (*MPVPlayer) Name

func (p *MPVPlayer) Name() string

Name returns the player name

func (*MPVPlayer) Play

func (p *MPVPlayer) Play(ctx context.Context, videoData *providers.VideoData, title string, resumeFrom string) (*PlaybackInfo, error)

Play plays a video using MPV

type PlaybackInfo

type PlaybackInfo struct {
	StoppedAt           string
	TotalDuration       string // Total duration of the episode (HH:MM:SS format)
	PercentageProgress  int
	CompletedSuccessful bool
}

PlaybackInfo contains information about a playback session

type Player

type Player interface {
	// Play plays a video with the given data
	Play(ctx context.Context, videoData *providers.VideoData, title string, resumeFrom string) (*PlaybackInfo, error)

	// Name returns the player name
	Name() string
}

Player defines the interface for video players

func GetPlayer

func GetPlayer(cfg *config.Config) (Player, error)

GetPlayer returns a player by name

type VLCPlayer

type VLCPlayer struct {
	// contains filtered or unexported fields
}

VLCPlayer implements VLC player

func NewVLCPlayer

func NewVLCPlayer(cfg *config.Config) *VLCPlayer

NewVLCPlayer creates a new VLC player

func (*VLCPlayer) Name

func (p *VLCPlayer) Name() string

Name returns the player name

func (*VLCPlayer) Play

func (p *VLCPlayer) Play(ctx context.Context, videoData *providers.VideoData, title string, resumeFrom string) (*PlaybackInfo, error)

Play plays a video using VLC

Jump to

Keyboard shortcuts

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