trackericons

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrIconNotFound is returned when no icon could be fetched for a tracker.
	ErrIconNotFound = errors.New("tracker icon not found")
	// ErrInvalidTrackerHost is returned when the requested tracker host is invalid.
	ErrInvalidTrackerHost = errors.New("invalid tracker host")
	// ErrFetchingDisabled is returned when tracker icon fetching is disabled by configuration.
	ErrFetchingDisabled = errors.New("tracker icon fetching is disabled")
)

Functions

func QueueFetch

func QueueFetch(host, trackerURL string)

func SetFetchEnabled added in v1.12.0

func SetFetchEnabled(enabled bool)

func SetGlobal

func SetGlobal(svc *Service)

Types

type Service

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

Service handles fetching and caching tracker icons on disk.

func NewService

func NewService(dataDir, userAgent string) (*Service, error)

NewService creates a new tracker icon service rooted in the provided data directory.

func (*Service) GetIcon

func (s *Service) GetIcon(ctx context.Context, host, trackerURL string) (string, error)

GetIcon ensures an icon is available for the host (fetching if necessary) and returns the file path.

func (*Service) ListIcons

func (s *Service) ListIcons(ctx context.Context) (map[string]string, error)

ListIcons returns all cached tracker icons as base64-encoded data URLs.

func (*Service) SetActivityPublisher added in v1.20.0

func (s *Service) SetActivityPublisher(publisher activity.Publisher)

SetActivityPublisher wires the qui server-event hub so newly cached tracker icons are pushed to connected clients instead of polled. Safe to call once at startup.

Jump to

Keyboard shortcuts

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