Documentation
¶
Overview ¶
tracking/sqlite_tracker.go
Index ¶
- Variables
- func CloseGlobalTracker() error
- func HandleTrackingNotice()
- type Anime
- type LocalTracker
- func (t *LocalTracker) Close() error
- func (t *LocalTracker) DeleteAnime(anilistID int, allanimeID string) error
- func (t *LocalTracker) GetAllAnime() ([]Anime, error)
- func (t *LocalTracker) GetAnime(anilistID int, allanimeID string) (*Anime, error)
- func (t *LocalTracker) UpdateProgress(a Anime) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrCgoDisabled = errors.New("CGO disabled: sqlite tracking not available") ErrTrackerNotInited = errors.New("tracker not initialized") )
Error constants
var IsCgoEnabled = true
IsCgoEnabled indicates whether CGO is enabled for SQLite support
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 │ *────────────────────────────────────────────────────────────────────────────