search

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache keeps lightweight per-library search snapshots in memory.

func NewCache

func NewCache(client *cache.Client, store *cache.Store) *Cache

NewCache creates a new in-memory search cache.

func (*Cache) Invalidate added in v0.3.0

func (c *Cache) Invalidate(libraryID string)

Invalidate removes the cached search snapshot for a library.

func (*Cache) PrebuildCmd added in v0.4.0

func (c *Cache) PrebuildCmd(libraryID, libraryMediaType string) tea.Cmd

PrebuildCmd returns a tea.Cmd that builds the search cache in the background.

func (*Cache) Prepare

func (c *Cache) Prepare(ctx context.Context, libraryID, libraryMediaType string) error

Prepare ensures the library snapshot exists before the user starts searching.

func (*Cache) Search

func (c *Cache) Search(ctx context.Context, libraryID, libraryMediaType, query string) ([]abs.LibraryItem, error)

Search returns search results from a cached per-library snapshot.

func (*Cache) TryGetAll added in v0.4.0

func (c *Cache) TryGetAll(libraryID, libraryMediaType string) ([]abs.LibraryItem, bool)

TryGetAll returns all items from the cached snapshot if it is ready, otherwise it returns false. It does not block to build the snapshot.

func (*Cache) UpdateItem added in v0.4.0

func (c *Cache) UpdateItem(item abs.LibraryItem)

UpdateItem replaces cached metadata for a single item in-place. This avoids a full re-fetch from ABS which can return stale data.

type CacheReadyMsg added in v0.4.0

type CacheReadyMsg struct {
	LibraryID string
}

CacheReadyMsg signals that the cache for a library is built.

type PersistedEntry added in v0.3.0

type PersistedEntry struct {
	ItemID    string
	LibraryID string
	MediaType string
	Title     string
	Author    string
	Duration  float64

	SeriesID   string
	SeriesName string

	EpisodeID    string
	EpisodeTitle string

	PrimarySearchText   string
	SecondarySearchText string
	CombinedSearchText  string
	FuzzySearchText     string
	PrimaryTokens       []string
	CombinedTokens      []string
}

PersistedEntry is a gob-serializable representation of snapshotEntry.

type PersistedSnapshot added in v0.3.0

type PersistedSnapshot struct {
	LibraryID      string
	MediaType      string
	BuiltAt        time.Time
	LastAccessedAt time.Time
	Entries        []PersistedEntry
	Items          []abs.LibraryItem
}

PersistedSnapshot is a gob-serializable representation of a librarySnapshot for disk cache persistence.

Jump to

Keyboard shortcuts

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