progress

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package progress manages user progress data which contains media offset and duration to allow incremental watch/listen progress to be saved and retrieved to/from the server based on etag.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOffsetTooOld = errors.New("offset is old")
	ErrOffsetSame   = errors.New("offset is the same")
	ErrAccessDenied = errors.New("access denied")
)

Functions

This section is empty.

Types

type Progress

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

func NewProgress

func NewProgress(config *config.Config) *Progress

func (*Progress) Close

func (p *Progress) Close()

func (*Progress) Delete

func (p *Progress) Delete(user *auth.User, offset Offset) error

Delete will delete the provided user & offset, ensuring the offset belongs to the user.

func (*Progress) Offset

func (p *Progress) Offset(user *auth.User, id int) *Offset

Offset gets the user offset based on the internal id.

func (*Progress) Offsets

func (p *Progress) Offsets(user *auth.User) []Offset

Offsets gets all the offets for the user.

func (*Progress) Open

func (p *Progress) Open() (err error)

func (*Progress) Update

func (p *Progress) Update(user *auth.User, newOffset Offset) error

Update will create or update an offset for the provided user using the etag as the primary key.

Jump to

Keyboard shortcuts

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