cache

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCachePath

func GetCachePath() (string, error)

GetCachePath returns the path to the cache file

Types

type Cache

type Cache struct {
	Media       []plex.MediaItem `json:"media"`
	LastUpdated time.Time        `json:"last_updated"`
}

func Load

func Load() (*Cache, error)

Load reads the cache from disk

func (*Cache) FormatForFzf

func (c *Cache) FormatForFzf() []string

FormatForFzf returns a slice of formatted strings for fzf

func (*Cache) GetMediaByFormattedTitle

func (c *Cache) GetMediaByFormattedTitle(formattedTitle string) (*plex.MediaItem, error)

GetMediaByFormattedTitle returns the media item matching the formatted title

func (*Cache) GetMediaByIndex

func (c *Cache) GetMediaByIndex(index int) (*plex.MediaItem, error)

GetMediaByIndex returns the media item at the given index

func (*Cache) GetMediaByTitle

func (c *Cache) GetMediaByTitle(title string) []plex.MediaItem

GetMediaByTitle returns media items that match the given title

func (*Cache) IsStale

func (c *Cache) IsStale(maxAge time.Duration) bool

IsStale checks if the cache is older than the given duration

func (*Cache) Save

func (c *Cache) Save() error

Save writes the cache to disk

Jump to

Keyboard shortcuts

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