tracking

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

tracking/sqlite_tracker.go

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCgoDisabled      = errors.New("CGO disabled: sqlite tracking not available")
	ErrTrackerNotInited = errors.New("tracker not initialized")
)

Error constants

View Source
var IsCgoEnabled = true

IsCgoEnabled indicates whether CGO is enabled for SQLite support

View Source
var NewLocalTracker func(dbPath string) *LocalTracker

────────────────────────────────────────────────────────────────────────────* │ Construtor e Inicialização │ *────────────────────────────────────────────────────────────────────────────

Functions

func CloseGlobalTracker added in v1.6.0

func CloseGlobalTracker() error

CloseGlobalTracker closes the global tracker and clears the cache. Should be called on application shutdown.

func HandleTrackingNotice

func HandleTrackingNotice()

HandleTrackingNotice displays a notice about tracking availability

Types

type Anime

type Anime struct {
	AnilistID     int       `json:"anilist_id"`
	AllanimeID    string    `json:"allanime_id"` // Primary key - unique per content
	EpisodeNumber int       `json:"episode_number"`
	PlaybackTime  int       `json:"playback_time"`
	Duration      int       `json:"duration"`
	Title         string    `json:"title"`
	MediaType     string    `json:"media_type"` // "anime" or "movie"
	LastUpdated   time.Time `json:"last_updated"`
}

Anime represents tracked media (anime, movie, or TV show)

type LocalTracker

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

func GetGlobalTracker added in v1.6.0

func GetGlobalTracker() *LocalTracker

GetGlobalTracker returns the cached global tracker instance. This avoids repeatedly opening the database connection which is slow.

func (*LocalTracker) Close

func (t *LocalTracker) Close() error

────────────────────────────────────────────────────────────────────────────* │ Finalização │ *────────────────────────────────────────────────────────────────────────────

func (*LocalTracker) DeleteAnime

func (t *LocalTracker) DeleteAnime(anilistID int, allanimeID string) error

DeleteAnime removes tracking data by allanime_id The anilistID parameter is kept for backwards compatibility but is ignored

func (*LocalTracker) GetAllAnime

func (t *LocalTracker) GetAllAnime() ([]Anime, error)

func (*LocalTracker) GetAnime

func (t *LocalTracker) GetAnime(anilistID int, allanimeID string) (*Anime, error)

GetAnime retrieves tracking data by allanime_id (works for both movies and anime) The anilistID parameter is kept for backwards compatibility but is ignored

func (*LocalTracker) UpdateProgress

func (t *LocalTracker) UpdateProgress(a Anime) error

────────────────────────────────────────────────────────────────────────────* │ Operações Principais │ *────────────────────────────────────────────────────────────────────────────

Jump to

Keyboard shortcuts

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