manager

package
v0.0.0-...-aaa1bea Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntryAllFolder     string = "__all__"
	EntryBadFolder     string = "__bad__"
	EntryTorrentFolder string = "torrents"
	EntryNZBFolder     string = "nzbs"
)
View Source
const (
	MaxFFprobeWorkers   = 10
	MaxNZBPreCacheFiles = 5
	FFprobeTimeout      = 60 * time.Second
)

Variables

View Source
var (
	ErrUnsupportedDebridProvider = errors.New("unsupported debrid provider")
)

Functions

This section is empty.

Types

type ActiveStream

type ActiveStream struct {
	ID         string `json:"id"`
	EntryName  string `json:"entry_name"`
	FileName   string `json:"file_name"`
	FileSize   int64  `json:"file_size"`
	Source     string `json:"source"` // "torrent" or "nzb"
	StartedAt  int64  `json:"started_at"`
	LastActive int64  `json:"last_active"` // Last activity timestamp (for observability)
	Debrid     string `json:"debrid,omitempty"`
	Client     string `json:"client,omitempty"` // Client identifier (User-Agent for WebDAV, "DFS" for DFS)
}

ActiveStream represents a currently active streaming file

type CacheDetail

type CacheDetail struct {
	TotalSize   int64   `json:"total_size"`
	MaxSize     int64   `json:"max_size"`
	ItemCount   int64   `json:"item_count"`
	Utilization float64 `json:"utilization"`
}

CacheDetail holds VFS cache statistics.

type CustomFolders

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

type DFSDetail

type DFSDetail struct {
	Backend   string    `json:"backend"`
	Ready     bool      `json:"ready"`
	MountPath string    `json:"mount_path"`
	VFS       VFSDetail `json:"vfs"`
}

DFSDetail holds DFS-specific mount statistics.

type Downloader

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

func NewDownloadManager

func NewDownloadManager(manager *Manager) *Downloader

NewDownloadManager creates a new strm manager

type EntryCache

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

func NewEntryCache

func NewEntryCache(manager *Manager) *EntryCache

func (*EntryCache) Get

func (e *EntryCache) Get(name string) (*FileInfo, []FileInfo)

func (*EntryCache) Refresh

func (e *EntryCache) Refresh()

Refresh triggers a cache refresh with debouncing. If called multiple times rapidly, only one refresh will occur.

type EntryCacheItem

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

type FileInfo

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

FileInfo implements os.FileInfo

func (*FileInfo) ActiveDebrid

func (f *FileInfo) ActiveDebrid() string

func (*FileInfo) ByteRange

func (f *FileInfo) ByteRange() *[2]int64

func (*FileInfo) CanDelete

func (f *FileInfo) CanDelete() bool

func (*FileInfo) Content

func (f *FileInfo) Content() []byte

func (*FileInfo) InfoHash

func (f *FileInfo) InfoHash() string

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) IsRemote

func (f *FileInfo) IsRemote() bool

func (*FileInfo) ModTime

func (f *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (f *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Parent

func (f *FileInfo) Parent() string

func (*FileInfo) SetSys

func (f *FileInfo) SetSys(v interface{})

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() interface{}

type FileProbeResult

type FileProbeResult struct {
	Name     string          `json:"name"`
	InfoHash string          `json:"info_hash"`
	Protocol config.Protocol `json:"protocol"`
	Status   FileProbeStatus `json:"status"`
	Reason   string          `json:"reason,omitempty"`
}

type FileProbeStatus

type FileProbeStatus string
const (
	FileProbeHealthy FileProbeStatus = "healthy"
	FileProbeBroken  FileProbeStatus = "broken"
	FileProbeUnknown FileProbeStatus = "unknown"
)

type FixResult

type FixResult struct {
	Success       bool
	NewDebrid     string
	Error         error
	AttemptsCount int
}

FixResult is the result of a fix operation

type Fixer

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

Fixer handles torrent repair with cascading re-insertion across debrids

func NewFixer

func NewFixer(manager *Manager) *Fixer

NewFixer creates a new Fixer instance

func (*Fixer) FixTorrent

func (f *Fixer) FixTorrent(ctx context.Context, entry *storage.Entry, skipCurrent bool) (*FixResult, error)

FixTorrent attempts to fix a broken torrent by re-inserting across debrids Strategy: 1. Try to re-insert on current active debrid, except if skipCurrent is true 2. If fails, cascade through other debrids in config order 3. Skip debrids where torrent already exists (unless they're also broken) 4. Mark as completely failed if all debrids fail

func (*Fixer) IsFailedToReinsert

func (f *Fixer) IsFailedToReinsert(infohash, debrid string) bool

IsFailedToReinsert checks if a torrent has been marked as failed to re-insert

func (*Fixer) MoveTorrent

func (f *Fixer) MoveTorrent(entry *storage.Entry, debridName string, reinsert bool) (bool, error)

MoveTorrent attempts to re-insert a torrent on a specific debrid

func (*Fixer) ResetFailureState

func (f *Fixer) ResetFailureState(infohash string)

ResetFailureState manually resets the failure state for a torrent

type FixerRequest

type FixerRequest struct {
	InfoHash         string
	CurrentDebrid    string
	AttemptedDebrids []string
	StartedAt        time.Time
	LastAttempt      time.Time
	// contains filtered or unexported fields
}

FixerRequest tracks an ongoing repair operation

type ImportRequest

type ImportRequest struct {
	Name             string                `json:"name"`
	NZBContent       []byte                `json:"-,omitempty"`
	Id               string                `json:"id"`
	DownloadFolder   string                `json:"downloadFolder"`
	SelectedDebrid   string                `json:"debrid"`
	Magnet           *utils.Magnet         `json:"magnet"`
	Arr              *arr.Arr              `json:"arr"`
	Action           config.DownloadAction `json:"action"`
	DownloadUncached *bool                 `json:"downloadUncached"`
	CallBackUrl      string                `json:"callBackUrl"`
	SkipMultiSeason  bool                  `json:"skip_multi_season"`

	Status      string    `json:"status"`
	CompletedAt time.Time `json:"completedAt,omitempty"`
	Error       string    `json:"error,omitempty"`

	Type  ImportType `json:"type"`
	Async bool       `json:"async"`
}

func NewNZBRequest

func NewNZBRequest(name, downloadFolder string, nzbContent []byte, arr *arr.Arr, action config.DownloadAction, callBackUrl string, importType ImportType, skipMultiSeason bool) *ImportRequest

func NewTorrentRequest

func NewTorrentRequest(debrid string, downloadFolder string, magnet *utils.Magnet, arr *arr.Arr, action config.DownloadAction, downloadUncached *bool, callBackUrl string, importType ImportType, skipMultiSeason bool) *ImportRequest

type ImportType

type ImportType string
const (
	ImportTypeQBit    ImportType = "qbit"
	ImportTypeAPI     ImportType = "api"
	ImportTypeSABnzbd ImportType = "sabnzbd"
	ImportSwitcher    ImportType = "switcher"
)

type Job

type Job struct {
	ID        string
	Type      JobType
	Request   *ImportRequest               // The original import request
	NZBMeta   *storage.NZB                 // NZB metadata (set after parse, before worker processes)
	NZBGroups map[string]*parser.FileGroup // NZB file groups (set after parse)
	Entry     *storage.Entry               // Entry created during processing
	CreatedAt time.Time
}

Job represents a unified processing job for both torrents and NZBs

func NewJob

func NewJob(jobType JobType, req *ImportRequest) *Job

NewJob creates a new job

type JobQueue

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

JobQueue is a unified, unbounded, thread-safe job queue with a fixed worker pool. It replaces the separate ImportRequest queue, nzbJobQueue, and unbounded goroutine fan-out with a single queue that processes both torrent and NZB jobs.

func NewJobQueue

func NewJobQueue(ctx context.Context, maxWorkers int, processFunc func(ctx context.Context, job *Job)) *JobQueue

NewJobQueue creates a new unified job queue with the given number of workers

func (*JobQueue) Close

func (q *JobQueue) Close()

Close signals all workers to stop and waits for them to finish

func (*JobQueue) DeleteJob

func (q *JobQueue) DeleteJob(jobID string) bool

DeleteJob removes a pending job by ID (before it's picked up by a worker). Returns true if the job was found and removed.

func (*JobQueue) FindJob

func (q *JobQueue) FindJob(jobID string) *Job

FindJob returns a pending job by ID without removing it

func (*JobQueue) Len

func (q *JobQueue) Len() int

Len returns the current number of pending jobs

func (*JobQueue) PendingCount

func (q *JobQueue) PendingCount(jobType JobType) int

PendingCount returns the count of pending jobs, optionally filtered by type

func (*JobQueue) Submit

func (q *JobQueue) Submit(job *Job) error

Submit adds a job to the queue (never blocks)

type JobType

type JobType string

JobType represents the type of processing job

const (
	JobTypeTorrent JobType = "torrent"
	JobTypeNZB     JobType = "nzb"
)

type Manager

type Manager struct {

	// Notifications service
	Notifications *notifications.Service
	// contains filtered or unexported fields
}

Manager handles unified torrent management - replaces wire.Store completely

func New

func New() *Manager

New creates a new Manager instance

func (*Manager) AddNewNZB

func (m *Manager) AddNewNZB(ctx context.Context, req *ImportRequest) (string, error)

AddNewNZB processes an NZB file and stores it as a storage.Entry

func (*Manager) AddNewTorrent

func (m *Manager) AddNewTorrent(ctx context.Context, importReq *ImportRequest) error

AddNewTorrent creates a torrent from import request and processes it

func (*Manager) AddOrUpdate

func (m *Manager) AddOrUpdate(entry *storage.Entry, callback func(t *storage.Entry)) error

func (*Manager) Arr

func (m *Manager) Arr() *arr.Storage

Arr returns the Arr storage instance

func (*Manager) Clients

func (m *Manager) Clients() *xsync.Map[string, debrid.Client]

func (*Manager) CopyEntry

func (m *Manager) CopyEntry(entry *FileInfo, destPath string, delete bool) error

func (*Manager) DeleteEntry

func (m *Manager) DeleteEntry(infohash string, removePlacements bool) error

DeleteEntry deletes a torrent by infohash

func (*Manager) DeleteTorrents

func (m *Manager) DeleteTorrents(infohashes []string, removeFromDebrid bool) error

func (*Manager) EntryExists

func (m *Manager) EntryExists(infohash string) (bool, error)

func (*Manager) FilterDebrid

func (m *Manager) FilterDebrid(filter func(debrid.Client) bool) []debrid.Client

FilterDebrid returns clients that match the filter function

func (*Manager) GetActiveStreams

func (m *Manager) GetActiveStreams() []*ActiveStream

GetActiveStreams returns all currently active streams.

func (*Manager) GetActiveStreamsCount

func (m *Manager) GetActiveStreamsCount() int

GetActiveStreamsCount returns the number of active streams.

func (*Manager) GetBrokenFiles

func (m *Manager) GetBrokenFiles(item *storage.EntryItem, filenames []string) []string

func (*Manager) GetCustomFolders

func (m *Manager) GetCustomFolders() []string

func (*Manager) GetDebridSpeedTestResult

func (m *Manager) GetDebridSpeedTestResult(provider string) (debridTypes.SpeedTestResult, bool)

GetDebridSpeedTestResult returns stored speed test result for a specific debrid provider

func (*Manager) GetDownloadByteRange

func (m *Manager) GetDownloadByteRange(torrentName, filename string) (*[2]int64, error)

GetDownloadByteRange gets the byte range for a file

func (m *Manager) GetDownloadLink(ctx context.Context, entry *storage.Entry, filename string) (types.DownloadLink, error)

GetDownloadLink fetches and validates a download link for a file in an entry. This is the public interface that delegates to the link service.

func (*Manager) GetEntries

func (m *Manager) GetEntries() []FileInfo

GetEntries returns the subdirectories under a given mount name it would show __all__, __bad__, torrents, nzbs, per-provider folders and any custom folders

func (*Manager) GetEntry

func (m *Manager) GetEntry(infohash string) (*storage.Entry, error)

GetEntry gets a torrent by name

func (*Manager) GetEntryByName

func (m *Manager) GetEntryByName(torrentName, filename string) (*storage.Entry, error)

func (*Manager) GetEntryChildren

func (m *Manager) GetEntryChildren(group string) (*FileInfo, []FileInfo)

func (*Manager) GetEntryInfo

func (m *Manager) GetEntryInfo(name string) (*FileInfo, error)

GetEntryInfo returns a FileInfo for a torrent/entry by name - O(1) lookup

func (*Manager) GetEntryItem

func (m *Manager) GetEntryItem(torrentName string) (*storage.EntryItem, error)

func (*Manager) GetIngests

func (m *Manager) GetIngests() ([]types.IngestData, error)

func (*Manager) GetIngestsByDebrid

func (m *Manager) GetIngestsByDebrid(debridName string) ([]types.IngestData, error)

func (*Manager) GetMigrationJob

func (m *Manager) GetMigrationJob(jobID string) (*storage.SwitcherJob, error)

func (*Manager) GetStats

func (m *Manager) GetStats() (map[string]interface{}, error)

func (*Manager) GetTorrentChildren

func (m *Manager) GetTorrentChildren(name string) (*FileInfo, []FileInfo)

func (*Manager) GetTorrentEntry

func (m *Manager) GetTorrentEntry(torrentName string) (*FileInfo, error)

func (*Manager) GetTorrentFile

func (m *Manager) GetTorrentFile(torrentName, fileName string) (*FileInfo, error)

func (*Manager) GetTorrentMountPath

func (m *Manager) GetTorrentMountPath(torrent *storage.Entry) string

GetTorrentMountPath returns the full mount path for a torrent Returns the path based on the new unified mount structure

func (*Manager) GetTorrents

func (m *Manager) GetTorrents(filter func(*storage.Entry) bool) ([]*storage.Entry, error)

func (*Manager) GetTorrentsCount

func (m *Manager) GetTorrentsCount() (int, error)
func (m *Manager) GetTotalActiveDownloadLinks() int

GetTotalActiveDownloadLinks returns the total number of active download links across all debrids

func (*Manager) HasUsenet

func (m *Manager) HasUsenet() bool

HasUsenet returns true if usenet is configured

func (*Manager) IsReady

func (m *Manager) IsReady() chan struct{}

func (*Manager) Migrator

func (m *Manager) Migrator() *Migrator

Migrator returns the migrator instance

func (*Manager) MountManager

func (m *Manager) MountManager() MountManager

func (*Manager) ProbeEntryFiles

func (m *Manager) ProbeEntryFiles(ctx context.Context, item *storage.EntryItem, filenames []string, strategy ...storage.RepairStrategy) []FileProbeResult

func (*Manager) ProviderClient

func (m *Manager) ProviderClient(name string) debrid.Client

func (*Manager) Queue

func (m *Manager) Queue() *Queue

func (*Manager) RefreshEntries

func (m *Manager) RefreshEntries(refreshMount bool)

func (*Manager) RefreshMount

func (m *Manager) RefreshMount() error

func (*Manager) ReinsertEntry

func (m *Manager) ReinsertEntry(ctx context.Context, entry *storage.Entry) error

func (*Manager) RemoveEntry

func (m *Manager) RemoveEntry(entry *FileInfo) error

func (*Manager) RemoveFromProvider

func (m *Manager) RemoveFromProvider(providerEntry *storage.ProviderEntry) error

func (*Manager) RemoveTorrentFile

func (m *Manager) RemoveTorrentFile(torrentName, filename string) error

func (*Manager) RemoveTorrentPlacements

func (m *Manager) RemoveTorrentPlacements(t *storage.Entry)

func (*Manager) Repair

func (m *Manager) Repair() RepairManager

func (*Manager) Reset

func (m *Manager) Reset() error

Reset resets the manager with the new configuration This is called after config changes (e.g., setup wizard) to apply new settings

func (*Manager) RootInfo

func (m *Manager) RootInfo() *FileInfo

func (*Manager) RunFFprobe

func (m *Manager) RunFFprobe(filePaths []string) error

RunFFprobe runs ffprobe on the given file paths to warm up caches and trigger imports. Uses: ffprobe -v quiet -print_format json -show_format -show_streams <file>

func (*Manager) Scheduler

func (m *Manager) Scheduler() gocron.Scheduler

func (*Manager) SendToDebrid

func (m *Manager) SendToDebrid(ctx context.Context, importRequest *ImportRequest) (*debridTypes.Torrent, error)

SendToDebrid submits a magnet to debrid service(s) - replaces debrid.Parse

func (*Manager) SetMountManager

func (m *Manager) SetMountManager(mountMgr MountManager)

func (*Manager) SetRepairManager

func (m *Manager) SetRepairManager(repairMgr RepairManager)

func (*Manager) SpeedTest

func (m *Manager) SpeedTest(ctx context.Context, req SpeedTestRequest) SpeedTestResponse

SpeedTest runs a speed test for a specific provider based on protocol

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start starts the manager and all its components

func (*Manager) StartTime

func (m *Manager) StartTime() time.Time

func (*Manager) StartWorker

func (m *Manager) StartWorker(ctx context.Context) error

func (*Manager) Stop

func (m *Manager) Stop() error

Stop stops the manager and cleans up all resources

func (*Manager) Storage

func (m *Manager) Storage() *storage.Storage

func (*Manager) Stream

func (m *Manager) Stream(ctx context.Context, entry *storage.Entry, filename string, start, end int64, writer io.Writer, onReady StreamReadyFunc, client string) error

Stream streams a file from an entry to the provided writer within the specified byte range. client identifies the caller (e.g., User-Agent for WebDAV, "DFS" for DFS mount).

func (*Manager) SwitchTorrent

func (m *Manager) SwitchTorrent(ctx context.Context, infohash, target string, keepOld, waitComplete bool) (*storage.SwitcherJob, error)

SwitchTorrent moves a torrent from one debrid to another

func (*Manager) TrackStream

func (m *Manager) TrackStream(entry *storage.Entry, filename, client string) string

TrackStream registers an active stream for observability and returns the stream ID. Call UntrackStream with the returned ID when streaming completes.

func (*Manager) UntrackStream

func (m *Manager) UntrackStream(streamID string)

UntrackStream removes a previously-registered active stream if the ID is non-empty.

func (*Manager) Uptime

func (m *Manager) Uptime() time.Duration

func (*Manager) Usenet

func (m *Manager) Usenet() *usenet.Usenet

func (*Manager) UsenetStats

func (m *Manager) UsenetStats() map[string]interface{}

UsenetStats returns usenet client statistics

type Migrator

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

Migrator handles migration from cache JSON files to unified bbolt system

func NewMigrator

func NewMigrator(storage *storage.Storage) *Migrator

NewMigrator creates a new migrator

func (*Migrator) GetStats

func (m *Migrator) GetStats() (map[string]interface{}, error)

GetStats returns migration statistics

func (*Migrator) GetStatus

func (m *Migrator) GetStatus() (*storage.SystemMigrationStatus, error)

GetStatus returns the current migration status

func (*Migrator) Start

func (m *Migrator) Start() error

Start starts the migration process from cache files

func (*Migrator) Stop

func (m *Migrator) Stop() error

Stop stops the migration process

type MountManager

type MountManager interface {
	Start(ctx context.Context) error
	Stop() error
	Stats() map[string]interface{}
	IsReady() bool
	Type() string
	Refresh(dirs []string) error
}

func NewStubMountManager

func NewStubMountManager() MountManager

type MountStats

type MountStats struct {
	Enabled  bool          `json:"enabled"`
	Ready    bool          `json:"ready"`
	Type     string        `json:"type,omitempty"`
	Error    string        `json:"error,omitempty"`
	DFS      *DFSDetail    `json:"dfs,omitempty"`
	Rclone   *RcloneDetail `json:"rclone,omitempty"`
	External *RcloneDetail `json:"external,omitempty"`
}

MountStats is the unified stats struct returned by all MountManager implementations. Each mount type populates only its relevant field.

type Queue

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

func (*Queue) Add

func (q *Queue) Add(torrent *storage.Entry) error

func (*Queue) Close

func (q *Queue) Close()

func (*Queue) Delete

func (q *Queue) Delete(infohash string, cleanup func(t *storage.Entry) error) error

func (*Queue) DeleteRequest

func (q *Queue) DeleteRequest(requestID string) bool

DeleteRequest specific request by ID

func (*Queue) DeleteRequestWhere

func (q *Queue) DeleteRequestWhere(predicate func(*ImportRequest) bool) int

DeleteRequestWhere requests matching a condition

func (*Queue) DeleteStalled

func (q *Queue) DeleteStalled(cleanup func(*storage.Entry) error) error

func (*Queue) DeleteWhere

func (q *Queue) DeleteWhere(category string, protocol config.Protocol, state storage.TorrentState, hashes []string, cleanup func(t *storage.Entry) error) error

func (*Queue) FindRequest

func (q *Queue) FindRequest(requestID string) *ImportRequest

FindRequest request without removing it

func (*Queue) GetTorrent

func (q *Queue) GetTorrent(infohash string) (*storage.Entry, error)

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

func (*Queue) ListFilter

func (q *Queue) ListFilter(category string, protocol config.Protocol, state storage.TorrentState, hashes []string, sortBy string, reverse bool) []*storage.Entry

func (*Queue) ListFilterFunc

func (q *Queue) ListFilterFunc(category string, protocol config.Protocol, state storage.TorrentState, hashes []string) func(*storage.Entry) bool

func (*Queue) PopRequest

func (q *Queue) PopRequest() (*ImportRequest, error)

func (*Queue) PushRequest

func (q *Queue) PushRequest(req *ImportRequest) error

func (*Queue) ReQueue

func (q *Queue) ReQueue(importReq *ImportRequest) error

func (*Queue) RequestsSize

func (q *Queue) RequestsSize() int

func (*Queue) Update

func (q *Queue) Update(torrent *storage.Entry) error

func (*Queue) UpdateWhere

func (q *Queue) UpdateWhere(predicate func(*storage.Entry) bool, updateFunc func(*storage.Entry) bool) error

type RcloneDetail

type RcloneDetail struct {
	Core      rclone.CoreStatsResponse `json:"core"`
	Memory    rclone.MemoryStats       `json:"memory"`
	Bandwidth rclone.BandwidthStats    `json:"bandwidth"`
	Version   rclone.VersionResponse   `json:"version"`
	Mount     *RcloneMountInfo         `json:"mount,omitempty"`
}

RcloneDetail holds rclone/external-specific mount statistics.

type RcloneMountInfo

type RcloneMountInfo struct {
	LocalPath  string `json:"local_path"`
	WebDAVURL  string `json:"webdav_url"`
	Mounted    bool   `json:"mounted"`
	MountedAt  string `json:"mounted_at,omitempty"`
	ConfigName string `json:"config_name"`
	Error      string `json:"error,omitempty"`
}

RcloneMountInfo holds rclone mount point information.

type RepairJobCounts

type RepairJobCounts struct {
	Active    int `json:"active_jobs"`
	Pending   int `json:"pending_jobs"`
	Completed int `json:"completed_jobs"`
	Failed    int `json:"failed_jobs"`
}

RepairJobCounts holds per-status counts of repair jobs.

type RepairJobOptions

type RepairJobOptions struct {
	Arrs        []string
	MediaIDs    []string
	AutoProcess bool
	Recurrent   bool
	Schedule    string
	Strategy    storage.RepairStrategy
	Workers     int
}

type RepairManager

type RepairManager interface {
	AddJob(opts RepairJobOptions) (string, error)
	StopJob(id string) error
	ProcessJob(id string) error
	DeleteJobs(ids []string)
	GetJobs() []*storage.Job
	JobStats() RepairJobCounts
	LoadRecurringJobs()
	Stop()
}

type SeasonInfo

type SeasonInfo struct {
	SeasonNumber int
	Files        []*storage.File
	InfoHash     string
	Name         string
}

SeasonInfo represents information about a season in a multi-season torrent

type SpeedTestRequest

type SpeedTestRequest struct {
	Protocol string `json:"protocol"` // "nntp" or "debrid"
	Provider string `json:"provider"` // provider host/identifier
}

SpeedTestRequest represents a speed test request payload

type SpeedTestResponse

type SpeedTestResponse struct {
	Provider  string  `json:"provider"`
	Protocol  string  `json:"protocol"`
	SpeedMBps float64 `json:"speed_mbps"`
	LatencyMs int64   `json:"latency_ms"`
	BytesRead int64   `json:"bytes_read"`
	TestedAt  string  `json:"tested_at"`
	Error     string  `json:"error,omitempty"`
}

SpeedTestResponse represents a speed test result

type StreamError

type StreamError struct {
	Err       error
	Retryable bool
	LinkError bool // true if we should try a new link
}

func (StreamError) Error

func (e StreamError) Error() string

type StreamMetadata

type StreamMetadata struct {
	Header        http.Header
	StatusCode    int
	ContentLength int64
}

StreamMetadata describes the headers/status for a streaming response before data flows.

type StreamReadyFunc

type StreamReadyFunc func(*StreamMetadata) error

StreamReadyFunc allows callers to copy headers/status before streaming begins.

type VFSDetail

type VFSDetail struct {
	TotalFiles     int32       `json:"total_files"`
	ActiveFiles    int32       `json:"active_files"`
	Cache          CacheDetail `json:"cache"`
	TotalBytesRead int64       `json:"total_bytes_read"`
	TotalErrors    int64       `json:"total_errors"`
}

VFSDetail holds VFS manager statistics.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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