api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ErrCodeBDMVRescanRequired = "bdmv_rescan_required"

Variables

This section is empty.

Functions

func EmitDupeProgress

func EmitDupeProgress(ctx context.Context, update DupeProgressUpdate)

func EmitMetadataProgress

func EmitMetadataProgress(ctx context.Context, update MetadataProgressUpdate)

func EmitUploadProgress

func EmitUploadProgress(ctx context.Context, update UploadProgressUpdate)

func ParseLogLevel

func ParseLogLevel(value string) (string, error)

func SetApplicationBuild

func SetApplicationBuild(version string, buildIdentifier string)

func WithDupeProgressReporter

func WithDupeProgressReporter(ctx context.Context, reporter DupeProgressReporter) context.Context

func WithMetadataProgressReporter

func WithMetadataProgressReporter(ctx context.Context, reporter MetadataProgressReporter) context.Context

func WithUploadProgressReporter

func WithUploadProgressReporter(ctx context.Context, reporter UploadProgressReporter) context.Context

Types

type ApplicationInfo

type ApplicationInfo struct {
	Version         string `json:"version"`
	BuildIdentifier string `json:"buildIdentifier"`
	GoVersion       string `json:"goVersion"`
	GOOS            string `json:"goos"`
	GOARCH          string `json:"goarch"`
	Uptime          string `json:"uptime"`
	UptimeSeconds   int64  `json:"uptimeSeconds"`
}

func CurrentApplicationInfo

func CurrentApplicationInfo() ApplicationInfo

type BDMVRescanRequiredError

type BDMVRescanRequiredError struct {
	SourcePath        string
	SelectedPlaylists []string
	CachedPlaylists   []string
	MissingPlaylists  []string
}

func (*BDMVRescanRequiredError) Error

func (e *BDMVRescanRequiredError) Error() string

type BlurayDiscSpec

type BlurayDiscSpec struct {
	Type   string
	Count  int
	Format string
}

type BlurayImage

type BlurayImage struct {
	Kind string
	URL  string
}

type BlurayMetadata

type BlurayMetadata struct {
	SourcePath        string
	IMDBID            int
	SearchURL         string
	SelectedReleaseID string
	SelectedURL       string
	AutoSelected      bool
	SelectionReason   string
	BestScore         float64
	Threshold         float64
	Candidates        []BlurayReleaseCandidate
	UpdatedAt         time.Time `ts_type:"string"`
}

func (*BlurayMetadata) CandidateByID

func (m *BlurayMetadata) CandidateByID(releaseID string) *BlurayReleaseCandidate

func (*BlurayMetadata) SelectCandidate

func (m *BlurayMetadata) SelectCandidate(releaseID string, auto bool, reason string) bool

func (*BlurayMetadata) SelectedCandidate

func (m *BlurayMetadata) SelectedCandidate() *BlurayReleaseCandidate

type BlurayPlaybackSpec

type BlurayPlaybackSpec struct {
	Region      string
	RegionNotes string
}

type BlurayReleaseCandidate

type BlurayReleaseCandidate struct {
	ReleaseID    string
	ProductID    string
	MovieTitle   string
	MovieYear    string
	Title        string
	URL          string
	Price        string
	Publisher    string
	Country      string
	Region       string
	Score        float64
	Accepted     bool
	Warnings     []string
	MatchNotes   []string
	Specs        BluraySpecs
	CoverImages  []BlurayImage
	GenericDisc  bool
	SpecsMissing bool
}

type BluraySpecs

type BluraySpecs struct {
	Video     BlurayVideoSpec
	Audio     []string
	Subtitles []string
	Discs     BlurayDiscSpec
	Playback  BlurayPlaybackSpec
}

type BlurayVideoSpec

type BlurayVideoSpec struct {
	Codec      string
	Resolution string
}

type BrowseDirectoryEntry

type BrowseDirectoryEntry struct {
	Name       string `json:"name"`
	Path       string `json:"path"`
	IsDir      bool   `json:"isDir"`
	Size       int64  `json:"size"`
	ModifiedAt string `json:"modifiedAt"`
}

type BrowseDirectoryRequest

type BrowseDirectoryRequest struct {
	Path string `json:"path"`
	Mode string `json:"mode"`
}

type BrowseDirectoryResponse

type BrowseDirectoryResponse struct {
	CurrentPath string                 `json:"currentPath"`
	ParentPath  string                 `json:"parentPath"`
	Mode        string                 `json:"mode"`
	Entries     []BrowseDirectoryEntry `json:"entries"`
}

type Category

type Category string
const (
	CategoryUnknown Category = ""
	CategoryMovie   Category = "MOVIE"
	CategoryTV      Category = "TV"
)

func NormalizeCategory

func NormalizeCategory(value string) Category

func (Category) Canonical

func (c Category) Canonical() Category

func (Category) IsValid

func (c Category) IsValid() bool

func (*Category) Scan

func (c *Category) Scan(src any) error

func (Category) Value

func (c Category) Value() (driver.Value, error)

type ClientOverrides

type ClientOverrides struct {
	Client       *string
	QbitCategory *string
	QbitTag      *string
	ForceRecheck *bool
}

type ClientSearchResult

type ClientSearchResult struct {
	InfoHash            string
	TrackerIDs          map[string]string
	FoundTrackerMatch   bool
	TorrentComments     []TorrentMatch
	PieceSizeConstraint string
	FoundPreferredPiece string
	MatchedTrackers     []string
	TorrentPath         string
}

type ClientService

type ClientService interface {
	Inject(ctx context.Context, meta PreparedMetadata, torrent TorrentResult) error
	SearchPathedTorrents(ctx context.Context, meta PreparedMetadata) (ClientSearchResult, error)
}

type Config

type Config interface {
	Validate() error
}

Config defines the minimum application configuration contract required by core wiring. Keeping this in pkg/api avoids leaking internal package types into exported APIs.

type Core

type Core interface {
	RunUpload(ctx context.Context, req Request) (Result, error)
	RunUploadPrepared(ctx context.Context, req Request) (Result, error)
	FetchMetadataPreview(ctx context.Context, req Request) (MetadataPreview, error)
	// FetchDescriptionBuilderPreview returns editable description groups for one
	// source path. Non-empty request trackers limit group generation to that set.
	FetchDescriptionBuilderPreview(ctx context.Context, req Request) (DescriptionBuilderPreview, error)
	// FetchDescriptionBuilderGroupPreview rebuilds one editable description group
	// for the requested source path and selected tracker set.
	FetchDescriptionBuilderGroupPreview(ctx context.Context, req Request) (DescriptionBuilderGroup, error)
	// FetchPreparationPreview returns tracker preparation details for one source
	// path. Non-empty request trackers limit preparation to that set.
	FetchPreparationPreview(ctx context.Context, req Request) (PreparationPreview, error)
	FetchTrackerDryRunPreview(ctx context.Context, req Request) (TrackerDryRunPreview, error)
	CheckDupes(ctx context.Context, req Request) (DupeCheckSummary, error)
	BuildUploadReview(ctx context.Context, req Request) (UploadReview, error)
	FetchScreenshotPlan(ctx context.Context, req Request) (ScreenshotPlan, error)
	GenerateScreenshots(ctx context.Context, req Request, selections []ScreenshotSelection, purpose ScreenshotPurpose) (ScreenshotResult, error)
	PreviewScreenshotFrame(ctx context.Context, req Request, timestampSeconds float64) (ScreenshotPreview, error)
	DeleteScreenshot(ctx context.Context, req Request, imagePath string) error
	DeleteTrackerImageURL(ctx context.Context, req Request, url string) error
	SaveFinalScreenshotSelections(ctx context.Context, req Request, images []ScreenshotImage) error
	ListUploadCandidates(ctx context.Context, req Request) ([]ScreenshotImage, error)
	ListUploadedImages(ctx context.Context, req Request) ([]UploadedImageLink, error)
	UploadImages(ctx context.Context, req Request, host string, images []ScreenshotImage) (UploadImagesResult, error)
	DeleteUploadedImage(ctx context.Context, req Request, imagePath string, host string) error
	ImportMenuImages(ctx context.Context, req Request, paths []string) error
	DiscoverPlaylists(ctx context.Context, sourcePath string) ([]PlaylistInfo, error)
	SavePlaylistSelection(ctx context.Context, sourcePath string, playlists []string, useAll bool) error
	LoadPlaylistSelection(ctx context.Context, sourcePath string) (PlaylistSelection, error)
	ListHistory(ctx context.Context) ([]HistoryEntry, error)
	GetHistoryOverview(ctx context.Context, sourcePath string) (HistoryOverview, error)
	DeleteHistoryRelease(ctx context.Context, sourcePath string) error
	DeleteAllHistoryReleases(ctx context.Context) (int, error)
	RenderDescription(ctx context.Context, raw string) (string, error)
	SaveDescriptionOverride(ctx context.Context, req Request, raw string) (DescriptionBuilderGroup, error)
	Close() error
}

Core defines the shared upload, preview, history, screenshot, and description operations used by CLI, Wails, and embedded web entrypoints.

type CoreDependencies

type CoreDependencies struct {
	// Config is validated before the core is created.
	Config Config
	// Logger receives core initialization and runtime messages. Nil uses NopLogger.
	Logger Logger
	// Services supplies optional service overrides; zero values use the core defaults.
	Services ServiceSet
	// Repository stores metadata and history. Nil opens and owns a SQLite repository from Config.
	Repository MetadataRepository
	// SkipCookieMigration skips legacy cookie migration for callers that already
	// synchronize cookie encryption state with the shared repository.
	SkipCookieMigration bool
}

CoreDependencies supplies the externally owned services used to construct a Core.

type CoreImpl

type CoreImpl interface {
	Core
}

CoreImpl is the exported concrete-core contract used by packages that accept any current core implementation.

type DVDMediaInfo

type DVDMediaInfo struct {
	SourcePath      string
	IFOPath         string
	VOBPath         string
	VOBSet          string
	Width           int
	Height          int
	FrameRate       string
	ScanType        string
	Resolution      string
	HighFrameRate   bool
	MediaInfoJSON   string
	MediaInfoText   string
	VOBMediaInfoRaw string
	UpdatedAt       time.Time `ts_type:"string"`
}

type DescriptionBuilderGroup

type DescriptionBuilderGroup struct {
	GroupKey           string
	Trackers           []string
	Description        string
	DescriptionHTML    string
	RawDescription     string
	RawDescriptionHTML string
	HasOverride        bool
	ImageHost          ImageHostFeedback
}

func CloneDescriptionBuilderGroups

func CloneDescriptionBuilderGroups(groups []DescriptionBuilderGroup) []DescriptionBuilderGroup

CloneDescriptionBuilderGroups deep-copies the reference-typed fields used by DescriptionBuilderGroup so callers can safely reuse cached or queued values.

type DescriptionBuilderPreview

type DescriptionBuilderPreview struct {
	SourcePath string
	Groups     []DescriptionBuilderGroup
}

type DescriptionImageHostStatus

type DescriptionImageHostStatus struct {
	Trackers  []string
	ImageHost ImageHostFeedback
}

type DescriptionOverride

type DescriptionOverride struct {
	SourcePath  string
	GroupKey    string
	Description string
	UpdatedAt   time.Time `ts_type:"string"`
}

type DupeCheckResult

type DupeCheckResult struct {
	Tracker     string
	Raw         []DupeEntry
	Filtered    []DupeEntry
	HasDupes    bool
	ContentFail bool
	Match       DupeMatch
	Notes       []string
	Skipped     bool
	SkipReason  string
	// SkipCode is a stable machine-readable skip reason.
	SkipCode string
	// SkipRules are upload rule keys that produced a rule-failure skip.
	SkipRules []string
	Status    string
	Error     string
	CheckedAt time.Time `ts_type:"string"`
}

DupeCheckResult is the duplicate-search outcome for one tracker. Raw contains tracker results before filtering, Filtered contains blocking matches, and skipped or failed checks carry Status plus SkipReason or Error. SkipCode is a stable machine-readable reason, while SkipRules names upload rules that caused rule-failure skips.

type DupeCheckSummary

type DupeCheckSummary struct {
	SourcePath string
	Results    []DupeCheckResult
	Notes      []string
}

DupeCheckSummary groups duplicate-search results for one prepared source path.

type DupeEntry

type DupeEntry struct {
	Name        string
	SizeBytes   int64
	SizeKnown   bool
	SizeText    string
	Files       []string
	FileCount   int
	Trumpable   bool
	Link        string
	Download    string
	Flags       []string
	ID          string
	Type        string
	Res         string
	Internal    bool
	BDInfo      string
	Description string
}

DupeEntry describes one tracker duplicate-search hit before or after local filtering.

type DupeEpisodeMatch

type DupeEpisodeMatch struct {
	ID       string
	Name     string
	Link     string
	Tracker  string
	Internal bool
}

DupeEpisodeMatch identifies an episode-level match found inside a duplicate search result, including season packs that contain the requested episode.

type DupeMatch

type DupeMatch struct {
	FilenameMatch             string
	FileCountMatch            int
	SizeMatch                 string
	TrumpableID               string
	MatchedID                 string
	MatchedName               string
	MatchedLink               string
	MatchedDownload           string
	MatchedReason             string
	SeasonPackExists          bool
	SeasonPackName            string
	SeasonPackLink            string
	SeasonPackID              string
	SeasonPackContainsEpisode bool
	MatchedEpisodeIDs         []DupeEpisodeMatch
}

DupeMatch records why duplicate filtering matched an entry and which tracker result can be reused for cross-seed injection.

type DupeProgressReporter

type DupeProgressReporter func(update DupeProgressUpdate)

type DupeProgressUpdate

type DupeProgressUpdate struct {
	SourcePath string          `json:"sourcePath"`
	Tracker    string          `json:"tracker"`
	Status     string          `json:"status"`
	Message    string          `json:"message"`
	Completed  int             `json:"completed"`
	Total      int             `json:"total"`
	Result     DupeCheckResult `json:"result"`
}

type DupeService

type DupeService interface {
	Check(ctx context.Context, meta PreparedMetadata, trackers []string) (DupeCheckSummary, error)
}

type ExecutionOptions

type ExecutionOptions struct {
	QueueName         string
	QueueLimit        int
	SiteCheck         bool
	SiteUploadTracker string
}

ExecutionOptions controls queued and site-check execution behavior.

type ExternalIDCandidate

type ExternalIDCandidate struct {
	Provider      string
	ID            int
	Title         string
	OriginalTitle string
	Year          int
	Category      string
	MediaType     string
	Overview      string
	PosterURL     string
	Similarity    float64
}

type ExternalIDCandidates

type ExternalIDCandidates struct {
	TMDB             []ExternalIDCandidate
	IMDB             []ExternalIDCandidate
	TMDBAutoSelected bool
	IMDBAutoSelected bool
}

type ExternalIDInfo

type ExternalIDInfo struct {
	Provider string
	ID       int
	Source   string
}

type ExternalIDOverrides

type ExternalIDOverrides struct {
	TMDBID   *int
	IMDBID   *int
	TVDBID   *int
	TVmazeID *int
	MALID    *int
}

type ExternalIDSelection

type ExternalIDSelection struct {
	TMDBID   *int
	IMDBID   *int
	TVDBID   *int
	TVmazeID *int
}

ExternalIDSelection records the external metadata IDs chosen for one source path.

type ExternalIDs

type ExternalIDs struct {
	SourcePath   string
	TMDBID       int
	IMDBID       int
	TVDBID       int
	TVmazeID     int
	Category     string
	SourceTMDB   string
	SourceIMDB   string
	SourceTVDB   string
	SourceTVmaze string
	UpdatedAt    time.Time `ts_type:"string"`
}

type ExternalMetadata

type ExternalMetadata struct {
	SourcePath string
	TMDB       *TMDBMetadata
	IMDB       *IMDBMetadata
	TVDB       *TVDBMetadata
	TVmaze     *TVmazeMetadata
	Bluray     *BlurayMetadata
	UpdatedAt  time.Time `ts_type:"string"`
}

type ExternalPreview

type ExternalPreview struct {
	Provider         string
	ID               int
	Source           string
	Title            string
	Year             int
	Overview         string
	PosterURL        string
	BackdropURL      string
	Category         string
	OriginalTitle    string
	ReleaseDate      string
	FirstAirDate     string
	LastAirDate      string
	OriginalLanguage string
	TMDBType         string
	Runtime          int
	Genres           string
	Keywords         string
	YouTube          string
	IMDBType         string
	Rating           float64
	RatingCount      int
	RuntimeMinutes   int
	Country          string
	Premiered        string
	IMDBID           int
	TVDBID           int
	TMDB             *TMDBMetadata
	IMDB             *IMDBMetadata
	TVDB             *TVDBMetadata
	TVmaze           *TVmazeMetadata
}

type FileMetadata

type FileMetadata struct {
	Path       string
	InfoHash   string
	UpdatedAt  time.Time `ts_type:"string"`
	DiscType   string
	VideoPath  string
	FileList   []string
	SourceSize int64
	Scene      bool
	SceneName  string
	SceneIMDB  int
	// Category is the normalized movie/TV content category that drives upload
	// logic. It is seeded from release parsing but should be overridden by a
	// supported TrackerMetadata.Category when that value is available, since a
	// site-reported movie/TV category is the authoritative classification for
	// the upload.
	Category   Category
	Type       string
	Artist     string
	Title      string
	Subtitle   string
	Alt        string
	Year       int
	Month      int
	Day        int
	Source     string
	Resolution string
	Codec      []string
	Audio      []string
	HDR        []string
	Ext        string
	Language   []string
	Site       string
	Genre      string
	Channels   string
	Collection string
	Region     string
	Size       string
	Group      string
	Disc       string
	Edition    []string
	Other      []string
}

type FilesystemService

type FilesystemService interface {
	ValidatePaths(ctx context.Context, paths []string) ([]string, error)
}

type HistoryEntry

type HistoryEntry struct {
	SourcePath         string
	ReleaseTitle       string
	ReleaseSource      string
	ReleaseResolution  string
	MetadataUpdatedAt  time.Time `ts_type:"string"`
	LatestUploadStatus string
	LatestUploadAt     time.Time `ts_type:"string"`
	RuleFailureCount   int
}

type HistoryOverview

type HistoryOverview struct {
	SourcePath           string
	ReleaseTitle         string
	ReleaseSource        string
	ReleaseResolution    string
	MetadataUpdatedAt    time.Time `ts_type:"string"`
	LatestUploadStatus   string
	LatestUploadAt       time.Time `ts_type:"string"`
	StatusLabel          string
	Metadata             FileMetadata
	ExternalIDs          ExternalIDs
	ExternalMetadata     ExternalMetadata
	ReleaseNameOverrides ReleaseNameOverrides
	DescriptionOverride  DescriptionOverride
	DescriptionOverrides []DescriptionOverride
	PlaylistSelection    PlaylistSelection
	TrackerMetadata      []TrackerMetadata
	TrackerRuleFailures  []TrackerRuleFailure
	Screenshots          []Screenshot
	FinalSelections      []ScreenshotFinalSelection
	UploadedImages       []UploadedImageLink
	UploadHistory        []UploadRecord
}

type IMDBAKA

type IMDBAKA struct {
	Title      string
	Country    string
	Language   string
	Attributes []string
}

type IMDBEditionDetail

type IMDBEditionDetail struct {
	DisplayName string
	Seconds     int
	Minutes     int
	Attributes  []string
}

type IMDBEpisode

type IMDBEpisode struct {
	ID          string
	Title       string
	ReleaseYear int
	ReleaseDate IMDBReleaseDate
	Season      int
	EpisodeText string
}

type IMDBMetadata

type IMDBMetadata struct {
	IMDBID           int
	IMDbIDText       string
	IMDbURL          string
	Title            string
	Year             int
	EndYear          int
	AKA              string
	Type             string
	Plot             string
	Rating           float64
	RatingCount      int
	RatingText       string
	RuntimeMinutes   int
	RuntimeText      string
	Genres           string
	Country          string
	CountryList      string
	Cover            string
	Directors        []IMDBPerson
	Creators         []IMDBPerson
	Writers          []IMDBPerson
	Stars            []IMDBPerson
	Editions         []string
	EditionDetails   map[string]IMDBEditionDetail
	Akas             []IMDBAKA
	Episodes         []IMDBEpisode
	SeasonsSummary   []IMDBSeasonSummary
	SoundMixes       []string
	TVYear           int
	OriginalLanguage string
}

type IMDBPerson

type IMDBPerson struct {
	ID   string
	Name string
}

type IMDBReleaseDate

type IMDBReleaseDate struct {
	Year  int
	Month int
	Day   int
}

type IMDBSeasonSummary

type IMDBSeasonSummary struct {
	Season    int
	Year      int
	YearRange string
}

type ImageHostFeedback

type ImageHostFeedback struct {
	Status       string
	SelectedHost string
	AllowedHosts []string
	Warnings     []ImageHostWarning
	Reuploaded   bool
	Message      string
}

type ImageHostOverrides

type ImageHostOverrides struct {
	PreferredHost *string
	SkipUpload    *bool
}

type ImageHostWarning

type ImageHostWarning struct {
	Host    string
	Message string
}

type ImageHostingService

type ImageHostingService interface {
	ListCandidates(ctx context.Context, meta PreparedMetadata) ([]ScreenshotImage, error)
	Upload(ctx context.Context, meta PreparedMetadata, host string, usageScope string, images []ScreenshotImage) ([]UploadedImageLink, error)
}

type InteractionMode

type InteractionMode string
const (
	InteractionModeInteractive       InteractionMode = "interactive"
	InteractionModeUnattended        InteractionMode = "unattended"
	InteractionModeUnattendedConfirm InteractionMode = "unattended_confirm"
)

type Logger

type Logger interface {
	Tracef(format string, args ...any)
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
}

type MetadataOverrides

type MetadataOverrides struct {
	Distributor      *string
	OriginalLanguage *string
	PersonalRelease  *bool
	Commentary       *bool
	WebDV            *bool
	StreamOptimized  *bool
	Anime            *bool
}

type MetadataPreview

type MetadataPreview struct {
	SourcePath           string
	TrackerName          string
	ReleaseName          string
	Warnings             []string
	ReleaseNameOverrides ReleaseNameOverrides
	ExternalIDs          ExternalIDs
	ExternalIDCandidates ExternalIDCandidates
	ExternalIDInfo       []ExternalIDInfo
	ExternalPreview      []ExternalPreview
	Bluray               *BlurayMetadata
	TrackerData          []TrackerPreview
}

type MetadataProgressReporter

type MetadataProgressReporter func(update MetadataProgressUpdate)

type MetadataProgressUpdate

type MetadataProgressUpdate struct {
	Path      string `json:"path"`
	Phase     string `json:"phase"`
	Message   string `json:"message"`
	Status    string `json:"status"`
	Level     string `json:"level"`
	Timestamp string `json:"timestamp"`
}

type MetadataRepository

type MetadataRepository interface {
	GetByPath(ctx context.Context, path string) (FileMetadata, error)
	Save(ctx context.Context, metadata FileMetadata) error
	GetExternalIDs(ctx context.Context, path string) (ExternalIDs, error)
	SaveExternalIDs(ctx context.Context, ids ExternalIDs) error
	GetExternalMetadata(ctx context.Context, path string) (ExternalMetadata, error)
	SaveExternalMetadata(ctx context.Context, metadata ExternalMetadata) error
	GetDVDMediaInfo(ctx context.Context, path string) (DVDMediaInfo, error)
	SaveDVDMediaInfo(ctx context.Context, info DVDMediaInfo) error
	GetReleaseNameOverrides(ctx context.Context, path string) (ReleaseNameOverrides, error)
	SaveReleaseNameOverrides(ctx context.Context, path string, overrides ReleaseNameOverrides) error
	DeleteReleaseNameOverrides(ctx context.Context, path string) error
	GetDescriptionOverride(ctx context.Context, path string, groupKey string) (DescriptionOverride, error)
	ListDescriptionOverridesByPath(ctx context.Context, path string) ([]DescriptionOverride, error)
	SaveDescriptionOverride(ctx context.Context, override DescriptionOverride) error
	DeleteDescriptionOverride(ctx context.Context, path string, groupKey string) error
	GetPlaylistSelection(ctx context.Context, sourcePath string) (PlaylistSelection, error)
	SavePlaylistSelection(ctx context.Context, sourcePath string, playlists []string, useAll bool) error
	DeletePlaylistSelection(ctx context.Context, sourcePath string) error
	ListHistoryEntries(ctx context.Context) ([]HistoryEntry, error)
	ListUploadHistoryByPath(ctx context.Context, sourcePath string) ([]UploadRecord, error)
	ListPendingUploads(ctx context.Context) ([]UploadRecord, error)
	CreateUploadRecord(ctx context.Context, record UploadRecord) error
	UpdateLatestUploadRecordStatus(ctx context.Context, sourcePath string, tracker string, status string) error
	SaveTrackerRuleFailures(ctx context.Context, sourcePath string, tracker string, failures []TrackerRuleFailure) error
	ListTrackerRuleFailuresByPath(ctx context.Context, path string) ([]TrackerRuleFailure, error)
	GetTrackerTimestamp(ctx context.Context, tracker string) (time.Time, error)
	SaveTrackerTimestamp(ctx context.Context, timestamp TrackerTimestamp) error
	SaveTrackerMetadata(ctx context.Context, metadata TrackerMetadata) error
	ListTrackerMetadataByPath(ctx context.Context, path string) ([]TrackerMetadata, error)
	SaveScreenshot(ctx context.Context, screenshot Screenshot) error
	ListScreenshotsByPath(ctx context.Context, path string) ([]Screenshot, error)
	DeleteScreenshot(ctx context.Context, imagePath string) error
	SaveFinalSelections(ctx context.Context, path string, selections []ScreenshotFinalSelection) error
	ListFinalSelections(ctx context.Context, path string) ([]ScreenshotFinalSelection, error)
	DeleteFinalSelection(ctx context.Context, imagePath string) error
	ReplaceScreenshotSlots(ctx context.Context, path string, slots []ScreenshotSlot) error
	ListScreenshotSlotsByPath(ctx context.Context, path string) ([]ScreenshotSlot, error)
	UpsertScreenshotSlotVariants(ctx context.Context, path string, variants []ScreenshotSlotVariant) error
	SaveUploadedImages(ctx context.Context, path string, host string, images []UploadedImageLink) error
	ListUploadedImagesByPath(ctx context.Context, path string) ([]UploadedImageLink, error)
	DeleteUploadedImage(ctx context.Context, path string, imagePath string, host string) error
	ListStoredReleasePaths(ctx context.Context) ([]string, error)
	PurgeContentData(ctx context.Context, path string) error
}

type MetadataService

type MetadataService interface {
	Prepare(ctx context.Context, req Request) (PreparedMetadata, error)
	RefreshPreparedMetadata(ctx context.Context, meta PreparedMetadata) (PreparedMetadata, error)
	EnrichTrackerData(ctx context.Context, meta PreparedMetadata) (PreparedMetadata, error)
	ApplyMediaInfoIDs(ctx context.Context, meta PreparedMetadata) (PreparedMetadata, error)
	ApplyArrData(ctx context.Context, meta PreparedMetadata) (PreparedMetadata, error)
	ResolveExternalIDs(ctx context.Context, meta PreparedMetadata) (PreparedMetadata, error)
	ApplyMediaDetails(ctx context.Context, meta PreparedMetadata) (PreparedMetadata, error)
}

type Mode

type Mode string

Mode identifies the entrypoint building a core request.

const (
	// ModeCLI marks requests started from the command-line entrypoint.
	ModeCLI Mode = "cli"
	// ModeGUI marks requests started from GUI or embedded web entrypoints.
	ModeGUI Mode = "gui"
)

type NopLogger

type NopLogger struct{}

func (NopLogger) Debugf

func (NopLogger) Debugf(string, ...any)

func (NopLogger) Errorf

func (NopLogger) Errorf(string, ...any)

func (NopLogger) Infof

func (NopLogger) Infof(string, ...any)

func (NopLogger) Tracef

func (NopLogger) Tracef(string, ...any)

func (NopLogger) Warnf

func (NopLogger) Warnf(string, ...any)

type PlaylistInfo

type PlaylistInfo struct {
	File     string         `json:"file"`
	Duration float64        `json:"duration"`
	Items    []PlaylistItem `json:"items"`
	Score    float64        `json:"score"`
	Edition  string         `json:"edition"`
}

PlaylistInfo represents a discovered playlist file with its metrics and scoring.

type PlaylistItem

type PlaylistItem struct {
	File string `json:"file"`
	Size int64  `json:"size"`
}

PlaylistItem represents a single file reference within a playlist.

type PlaylistSelection

type PlaylistSelection struct {
	SourcePath        string
	SelectedPlaylists []string
	UseAll            bool
	UpdatedAt         time.Time `ts_type:"string"`
}

type PreparationDescription

type PreparationDescription struct {
	GroupKey           string
	Trackers           []string
	RawDescription     string
	RawDescriptionHTML string
	Description        string
	DescriptionHTML    string
	HasOverride        bool
	ImageHost          ImageHostFeedback
}

type PreparationPreview

type PreparationPreview struct {
	SourcePath   string
	Descriptions []PreparationDescription
}

type PreparedMetadata

type PreparedMetadata struct {
	SourcePath                  string
	SourceLookupURL             string
	SourceLookupActive          bool
	SourceLookupMode            string
	SourceLookupTracker         string
	SourceLookupTrackerID       string
	LookupWarnings              []string
	Paths                       []string
	DiscType                    string
	VideoPath                   string
	FileList                    []string
	SourceSize                  int64
	MediaInfoJSONPath           string
	MediaInfoTextPath           string
	DVDIFOPath                  string
	DVDVOBPath                  string
	DVDVOBSet                   string
	DVDVOBMediaInfoJSON         string
	DVDVOBMediaInfoText         string
	MediaInfoUniqueID           string
	Scene                       bool
	SceneName                   string
	SceneTMDBID                 int
	SceneIMDB                   int
	SceneTVDBID                 int
	SceneTVmazeID               int
	SceneMALID                  int
	SceneNFOPath                string
	SceneNFONew                 bool
	Mode                        Mode
	DescriptionGroups           []DescriptionBuilderGroup
	Trackers                    []string
	Options                     UploadOptions
	TrackersRemove              []string
	MatchedTrackers             []string
	Tag                         string
	Release                     ReleaseInfo
	TagOverride                 *TagOverride
	DescriptionOverride         string
	MetadataOverrides           MetadataOverrides
	TrackerConfigOverrides      TrackerConfigOverrides
	TrackerSiteOverrides        TrackerSiteOverrides
	ClientOverrides             ClientOverrides
	ImageHostOverrides          ImageHostOverrides
	ScreenshotOverrides         ScreenshotOverrides
	TorrentOverrides            TorrentOverrides
	DescriptionTemplate         string
	PersonalRelease             bool
	InfoHash                    string
	TrackerIDs                  map[string]string
	FoundTrackerMatch           bool
	TorrentComments             []TorrentMatch
	PieceSizeConstraint         string
	FoundPreferredPiece         string
	StoredInfoHash              string
	StoredUpdatedAt             time.Time `ts_type:"string"`
	StoredDataFresh             bool
	TrackerData                 []TrackerMetadata
	CrossSeedTorrents           []UploadedTorrent
	ClientTorrentPath           string
	TorrentPath                 string
	MediaInfoCategory           string
	MediaInfoTMDBID             int
	MediaInfoIMDBID             int
	MediaInfoTVDBID             int
	ArrSource                   string
	ArrTMDBID                   int
	ArrIMDBID                   int
	ArrTVDBID                   int
	ArrTVmazeID                 int
	ArrYear                     int
	ArrGenres                   []string
	ArrReleaseGroup             string
	MismatchedMediaInfoTMDBID   int
	MismatchedMediaInfoIMDBID   int
	MismatchedMediaInfoTVDBID   int
	ExternalIDOverrides         ExternalIDOverrides
	ReleaseNameOverrides        ReleaseNameOverrides
	TrackerQuestionnaireAnswers map[string]map[string]string
	SeasonInt                   int
	EpisodeInt                  int
	SeasonStr                   string
	EpisodeStr                  string
	TVDBAiredDate               string
	TVDBAirsDays                []string
	TVDBAirsTime                string
	TVDBAirsTimezone            string
	TVDBAirsTimezoneSource      string
	TVPack                      bool
	DailyEpisodeDate            string
	TMDBDateMatch               bool
	Anime                       bool
	MALID                       int
	EpisodeTitle                string
	EpisodeOverview             string
	EpisodeYear                 int
	SelectedBDMVPlaylists       []PlaylistInfo
	ExternalIDs                 ExternalIDs
	ExternalIDCandidates        ExternalIDCandidates
	ExternalMetadata            ExternalMetadata
	AudioLanguages              []string
	SubtitleLanguages           []string
	Container                   string
	Audio                       string
	Channels                    string
	HasCommentary               bool
	Is3D                        string
	Source                      string
	Type                        string
	UHD                         string
	HDR                         string
	Distributor                 string
	Region                      string
	VideoCodec                  string
	VideoEncode                 string
	HasEncodeSettings           bool
	BitDepth                    string
	Edition                     string
	Repack                      string
	WebDV                       bool
	ValidMediaInfo              bool
	ValidMediaInfoSettings      bool
	StreamOptimized             int
	Service                     string
	ServiceLongName             string
	Filename                    string
	ReleaseName                 string
	ReleaseNameNoTag            string
	ReleaseNameClean            string
	ReleaseNameMissing          []string
	BlockedTrackers             map[string][]TrackerBlockReason
	IgnoreTrackerRuleFailures   bool
	TrackerRuleFailures         map[string][]RuleFailure
	BDInfo                      map[string]any
}

type ReleaseInfo

type ReleaseInfo struct {
	Category   string
	Type       string
	Artist     string
	Title      string
	Subtitle   string
	Alt        string
	Year       int
	Month      int
	Day        int
	Source     string
	Resolution string
	Codec      []string
	Audio      []string
	HDR        []string
	Ext        string
	Language   []string
	Site       string
	Genre      string
	Channels   string
	Collection string
	Region     string
	Size       string
	Group      string
	Disc       string
	Season     int
	Episode    int
	Edition    []string
	Other      []string
}

type ReleaseNameOverrides

type ReleaseNameOverrides struct {
	Category         *string
	Type             *string
	Source           *string
	Resolution       *string
	Tag              *string
	Service          *string
	Edition          *string
	Season           *string
	Episode          *string
	EpisodeTitle     *string
	ManualYear       *int
	ManualDate       *string
	UseSeasonEpisode *bool
	NoSeason         *bool
	NoYear           *bool
	NoAKA            *bool
	NoTag            *bool
	NoEdition        *bool
	NoDub            *bool
	NoDual           *bool
	DualAudio        *bool
	Region           *string
}

type ReleaseNameRequest

type ReleaseNameRequest struct {
	Category      string
	Type          string
	Title         string
	AltTitle      string
	Year          int
	ManualYear    int
	Resolution    string
	Audio         string
	Service       string
	Season        string
	Episode       string
	Part          string
	Repack        string
	ThreeD        string
	Tag           string
	Source        string
	UHD           string
	HDR           string
	WebDV         bool
	EpisodeTitle  string
	VideoCodec    string
	VideoEncode   string
	DiscType      string
	Region        string
	DVDSize       string
	Edition       string
	SearchYear    string
	DailyDate     string
	ManualDate    bool
	TMDBDateMatch bool
	NoSeason      bool
	NoYear        bool
	NoAKA         bool
}

type ReleaseNameResult

type ReleaseNameResult struct {
	NameNoTag     string
	Name          string
	CleanName     string
	MissingFields []string
}

type Request

type Request struct {
	Paths                        []string
	Mode                         Mode
	Options                      UploadOptions
	Execution                    ExecutionOptions
	DescriptionGroups            []DescriptionBuilderGroup
	Trackers                     []string
	TrackersRemove               []string
	IgnoreTrackerRuleFailures    bool
	IgnoreTrackerRuleFailuresFor []string
	IgnoreDupesFor               []string
	SkipDupeCheck                bool
	SkipDupeAsActual             bool
	DoubleDupeCheck              bool
	SourceLookupURL              string
	DescriptionOverrideRaw       string
	DescriptionOverrideURL       string
	DescriptionOverrideGroup     string
	MetadataOverrides            MetadataOverrides
	TrackerConfigOverrides       TrackerConfigOverrides
	TrackerSiteOverrides         TrackerSiteOverrides
	ClientOverrides              ClientOverrides
	ImageHostOverrides           ImageHostOverrides
	ScreenshotOverrides          ScreenshotOverrides
	TorrentOverrides             TorrentOverrides
	TrackerIDOverrides           map[string]string
	ExternalIDOverrides          ExternalIDOverrides
	ExternalIDSelections         map[string]ExternalIDSelection // keyed by source path, value is selected external IDs for that path
	ReleaseNameOverrides         ReleaseNameOverrides
	TrackerQuestionnaireAnswers  map[string]map[string]string // keyed by tracker, then questionnaire field key
	PlaylistSelections           map[string][]string          // keyed by source path, value is selected playlist files
	PlaylistSelectionsUseAll     map[string]bool              // keyed by source path, value is use-all flag
	ConfirmBDMVRescan            bool
}

Request carries one core operation across CLI, Wails, and embedded web. Paths and path-keyed maps use host filesystem source paths as keys.

type Result

type Result struct {
	UploadedCount int
}

Result summarizes a completed core upload run.

type RuleFailure

type RuleFailure struct {
	Rule   string
	Reason string
}

type Screenshot

type Screenshot struct {
	SourcePath  string
	ImagePath   string
	Timestamp   float64
	FrameNumber int
	Width       int
	Height      int
	Purpose     ScreenshotPurpose
	CapturedAt  time.Time `ts_type:"string"`
}

type ScreenshotError

type ScreenshotError struct {
	Index   int
	Message string
}

type ScreenshotFinalSelection

type ScreenshotFinalSelection struct {
	SourcePath string
	ImagePath  string
	Order      int
	Source     string
	SelectedAt time.Time `ts_type:"string"`
}

type ScreenshotImage

type ScreenshotImage struct {
	Index            int
	TimestampSeconds float64
	Path             string
	Width            int
	Height           int
	SizeBytes        int64
	// Optional upload information (populated when image has been uploaded)
	Host       string    `json:"Host,omitempty"`
	ImgURL     string    `json:"ImgURL,omitempty"`
	RawURL     string    `json:"RawURL,omitempty"`
	WebURL     string    `json:"WebURL,omitempty"`
	UploadedAt time.Time `json:"UploadedAt,omitempty" ts_type:"string"`
}

type ScreenshotLinkedImage

type ScreenshotLinkedImage struct {
	Tracker string
	URL     string
	Path    string
	Host    string // Normalized host name (e.g., "imgbb", "pixhost") or domain name
}

type ScreenshotOverrides

type ScreenshotOverrides struct {
	ManualFrames           []int
	ComparisonPaths        []string
	ComparisonPrimaryIndex *int
	MenuPaths              []string
}

type ScreenshotPlan

type ScreenshotPlan struct {
	SourcePath                 string
	DiscType                   string
	DurationSeconds            float64
	FrameRate                  float64
	SuggestedSelections        []ScreenshotSelection
	ExistingScreenshots        []ScreenshotImage
	ExistingTrackerScreenshots []ScreenshotImage
	FinalSelections            []ScreenshotImage
	TrackerImageLinks          []ScreenshotLinkedImage
	PreviewImages              []ScreenshotImage
	MetadataTimestamp          string
	RequiresManualFrames       bool
}

type ScreenshotPreview

type ScreenshotPreview struct {
	TimestampSeconds float64
	ImageBytes       []byte
	Width            int
	Height           int
	SizeBytes        int64
}

type ScreenshotPurpose

type ScreenshotPurpose string
const (
	ScreenshotPurposePreview ScreenshotPurpose = "preview"
	ScreenshotPurposeFinal   ScreenshotPurpose = "final"
	ScreenshotPurposeMenu    ScreenshotPurpose = "menu"
)

type ScreenshotResult

type ScreenshotResult struct {
	SourcePath     string
	Purpose        ScreenshotPurpose
	Images         []ScreenshotImage
	Tonemapped     bool
	UsedLibplacebo bool
	Errors         []ScreenshotError
}

type ScreenshotSelection

type ScreenshotSelection struct {
	Index            int
	TimestampSeconds float64
	Frame            int
	Source           string
}

type ScreenshotService

type ScreenshotService interface {
	Plan(ctx context.Context, meta PreparedMetadata, count int) (ScreenshotPlan, error)
	Capture(ctx context.Context, meta PreparedMetadata, selections []ScreenshotSelection, purpose ScreenshotPurpose) (ScreenshotResult, error)
	PreviewFrame(ctx context.Context, meta PreparedMetadata, timestampSeconds float64) (ScreenshotPreview, error)
	Delete(ctx context.Context, meta PreparedMetadata, imagePath string) error
	SaveFinalSelections(ctx context.Context, meta PreparedMetadata, images []ScreenshotImage) error
}

type ScreenshotSlot

type ScreenshotSlot struct {
	SourcePath          string
	SlotOrder           int
	SourceKind          string
	OriginalKey         string
	OriginalURL         string
	OriginalHost        string
	ImagePath           string
	FromDescription     bool
	Tracker             string
	SectionKind         string
	RenderInScreenshots bool
	Variants            []ScreenshotSlotVariant
}

type ScreenshotSlotVariant

type ScreenshotSlotVariant struct {
	SourcePath string
	SlotOrder  int
	Host       string
	UsageScope string
	ImagePath  string
	ImgURL     string
	RawURL     string
	WebURL     string
	UploadedAt time.Time `ts_type:"string"`
}

type ServiceSet

type ServiceSet struct {
	Metadata    MetadataService
	Trackers    TrackerService
	Torrents    TorrentService
	Clients     ClientService
	Filesystem  FilesystemService
	Dupes       DupeService
	Screenshots ScreenshotService
	Images      ImageHostingService
}

type TIKOverrides

type TIKOverrides struct {
	Foreign  *bool
	Opera    *bool
	Asian    *bool
	DiscType *string
}

TIKOverrides carries TIK-specific upload flags selected outside static config.

type TMDBCompany

type TMDBCompany struct {
	ID            int
	Name          string
	LogoPath      string
	OriginCountry string
}

type TMDBCountry

type TMDBCountry struct {
	ISO3166 string
	Name    string
}

type TMDBLocalizedData added in v0.2.0

type TMDBLocalizedData struct {
	Title           string
	Overview        string
	EpisodeTitle    string
	EpisodeOverview string
	TrailerURL      string
	Genres          string
	ContentRating   string
	Poster          string
}

func ExtractLocalizedPTBR added in v0.2.0

func ExtractLocalizedPTBR(meta PreparedMetadata) TMDBLocalizedData

ExtractLocalizedPTBR returns the pt-BR localized data from the given metadata, or an empty value when none is available.

type TMDBMetadata

type TMDBMetadata struct {
	TMDBID           int
	IMDBID           int
	TVDBID           int
	Category         string
	Title            string
	OriginalTitle    string
	Year             int
	ReleaseDate      string
	FirstAirDate     string
	LastAirDate      string
	OriginCountry    []string
	OriginalLanguage string
	Overview         string
	Poster           string
	TMDBPosterPath   string
	Backdrop         string
	TMDBType         string
	Runtime          int
	Genres           string
	GenreIDs         string
	Creators         []string
	Directors        []string
	Cast             []string
	MALID            int
	Anime            bool
	Demographic      string
	RetrievedAKA     string
	Keywords         string
	// LocalizedTitles maps lowercase language codes and optional regional tags
	// such as "de" or "pt-BR" to TMDB translation titles. Nil values marshal as
	// an empty JSON object for Wails and embedded-web callers.
	LocalizedTitles     map[string]string
	YouTube             string
	Certification       string
	ProductionCompanies []TMDBCompany
	ProductionCountries []TMDBCountry
	Networks            []TMDBNetwork
	IMDbMismatch        bool
	MismatchedIMDbID    int
	Localized           map[string]TMDBLocalizedData
}

TMDBMetadata is the shared TMDB metadata snapshot returned to CLI, Wails, and embedded web callers during upload preparation and review.

func (TMDBMetadata) MarshalJSON added in v0.2.0

func (m TMDBMetadata) MarshalJSON() ([]byte, error)

MarshalJSON preserves the shared TMDBMetadata shape while emitting LocalizedTitles as an object instead of null.

type TMDBNetwork

type TMDBNetwork struct {
	ID            int
	Name          string
	LogoPath      string
	OriginCountry string
}

type TVDBMetadata

type TVDBMetadata struct {
	TVDBID                 int
	Name                   string
	NameEnglish            string
	Overview               string
	OverviewEnglish        string
	FirstAired             string
	Year                   int
	YearFromAlias          bool
	Type                   string
	Status                 string
	Network                string
	OriginalCountry        string
	OriginalLanguage       string
	HasEnglish             bool
	Genres                 string
	Poster                 string
	Aliases                []string
	EpisodeSeason          int
	EpisodeNumber          int
	EpisodeName            string
	EpisodeNameEnglish     string
	EpisodeOverview        string
	EpisodeOverviewEnglish string
	EpisodeAired           string
}

type TVmazeMetadata

type TVmazeMetadata struct {
	TVmazeID       int
	Name           string
	Premiered      string
	Ended          string
	Summary        string
	Status         string
	Type           string
	Language       string
	Genres         string
	Runtime        int
	AverageRuntime int
	Rating         float64
	Weight         int
	OfficialSite   string
	Country        string
	Network        string
	NetworkCountry string
	WebChannel     string
	WebCountry     string
	Poster         string
	PosterMedium   string
	Backdrop       string
	BackdropMedium string
	IMDBID         int
	TVDBID         int
}

type TagOverride

type TagOverride struct {
	Type            string
	Source          string
	Template        string
	PersonalRelease bool
}

type TorrentMatch

type TorrentMatch struct {
	Hash              string
	Name              string
	SavePath          string
	ContentPath       string
	Size              int64
	Category          string
	Seeders           int64
	Tracker           string
	HasWorkingTracker bool
	Comment           string
	TrackerURLsRaw    []string
	TrackerURLs       []TrackerMatch
	HasTracker        bool
}

type TorrentOverrides

type TorrentOverrides struct {
	InfoHash        *string
	MaxPieceSizeMiB *int
	NoHash          *bool
	Rehash          *bool
}

type TorrentResult

type TorrentResult struct {
	Path      string
	InfoHash  string
	URL       string
	Tracker   string
	CrossSeed bool
}

type TorrentService

type TorrentService interface {
	Create(ctx context.Context, meta PreparedMetadata) (TorrentResult, error)
}

type TrackerBlockReason

type TrackerBlockReason string
const (
	TrackerBlockReasonDupe  TrackerBlockReason = "dupe"
	TrackerBlockReasonClaim TrackerBlockReason = "claim"
	TrackerBlockReasonAudio TrackerBlockReason = "audio"
)

type TrackerConfigOverrides

type TrackerConfigOverrides struct {
	Anon    *bool
	Draft   *bool
	ModQ    *bool
	Channel *string
}

TrackerConfigOverrides supplies optional per-request tracker setting overrides.

type TrackerDryRunEntry

type TrackerDryRunEntry struct {
	Tracker                 string
	Status                  string
	Message                 string
	ReleaseName             string
	OriginalReleaseName     string
	UploadReleaseName       string
	ReleaseNameChanged      bool
	ReleaseNameChangeReason string
	DescriptionGroup        string
	Description             string
	Endpoint                string
	Payload                 map[string]string
	Files                   []TrackerDryRunFile
	Questionnaire           *TrackerQuestionnaire
	ImageHost               ImageHostFeedback
}

type TrackerDryRunFile

type TrackerDryRunFile struct {
	Field   string
	Path    string
	Present bool
}

type TrackerDryRunPreview

type TrackerDryRunPreview struct {
	SourcePath string
	Trackers   []TrackerDryRunEntry
}

type TrackerMatch

type TrackerMatch struct {
	ID        string
	TrackerID string
}

type TrackerMetadata

type TrackerMetadata struct {
	SourcePath string
	Tracker    string
	TrackerID  string
	InfoHash   string
	TMDBID     int
	IMDBID     int
	TVDBID     int
	MALID      int
	// Category is the site-reported movie/TV content category from the tracker
	// API. Supported values take precedence over MediaInfoCategory and
	// Release.Category when resolving ExternalIDs.Category for upload
	// classification; unsupported categories are ignored.
	Category    Category
	Description string
	ImageURLs   []string
	Filename    string
	Matched     bool
	UpdatedAt   time.Time `ts_type:"string"`
}

type TrackerPreview

type TrackerPreview struct {
	Tracker         string
	TrackerID       string
	TorrentURL      string
	InfoHash        string
	TMDBID          int
	IMDBID          int
	TVDBID          int
	MALID           int
	Category        string
	Description     string
	DescriptionHTML string
	ImageURLs       []string
	Filename        string
	Matched         bool
	UpdatedAt       string
}

type TrackerQuestionnaire

type TrackerQuestionnaire struct {
	Tracker string
	Fields  []TrackerQuestionnaireField
}

type TrackerQuestionnaireField

type TrackerQuestionnaireField struct {
	Key         string
	Label       string
	Kind        string
	Options     []string
	Value       string
	Placeholder string
	Help        string
	Required    bool
}

type TrackerReview

type TrackerReview struct {
	Tracker       string
	Banned        bool
	BannedReason  string
	RuleFailures  []RuleFailure
	DupeCheck     DupeCheckResult
	DryRun        TrackerDryRunEntry
	Questionnaire *TrackerQuestionnaire
}

type TrackerRuleFailure

type TrackerRuleFailure struct {
	SourcePath string
	Tracker    string
	Rule       string
	Reason     string
	CreatedAt  time.Time `ts_type:"string"`
}

type TrackerService

type TrackerService interface {
	Upload(ctx context.Context, meta PreparedMetadata) (UploadSummary, error)
	BuildPreparation(ctx context.Context, meta PreparedMetadata, trackers []string) (PreparationPreview, error)
	BuildUploadDryRun(ctx context.Context, meta PreparedMetadata, trackers []string) ([]TrackerDryRunEntry, error)
}

type TrackerSiteOverrides

type TrackerSiteOverrides struct {
	TIK TIKOverrides
}

TrackerSiteOverrides groups tracker-specific site override payloads.

type TrackerTimestamp

type TrackerTimestamp struct {
	Tracker   string
	UpdatedAt time.Time `ts_type:"string"`
}

type UploadImageHostFailure

type UploadImageHostFailure struct {
	Host       string
	UsageScope string
	Trackers   []string
	Message    string
}

UploadImageHostFailure describes a single host-level image upload failure returned in UploadImagesResult when one or more target hosts fail. Host is the failed image host name. UsageScope is the upload scope targeted for that host. Trackers lists trackers blocked by this host failure. Message contains the host failure reason.

type UploadImagesResult

type UploadImagesResult struct {
	Links    []UploadedImageLink
	Failures []UploadImageHostFailure
}

UploadImagesResult aggregates image upload outcomes across target hosts. Links contains successfully uploaded image links and is populated when one or more host uploads succeed. Failures contains host-level upload failures and is populated when one or more target hosts fail.

type UploadOptions

type UploadOptions struct {
	Debug           bool
	DryRun          bool
	RunLogLevel     string
	Screens         int
	NoSeed          bool
	SkipAutoTorrent bool
	OnlyID          bool
	KeepFolder      bool
	KeepImages      bool
	InteractionMode InteractionMode
}

UploadOptions contains per-run upload and preview behavior flags.

type UploadProgressReporter

type UploadProgressReporter func(update UploadProgressUpdate)

type UploadProgressUpdate

type UploadProgressUpdate struct {
	SourcePath      string  `json:"sourcePath"`
	Tracker         string  `json:"tracker"`
	Task            string  `json:"task"`
	Status          string  `json:"status"`
	Message         string  `json:"message"`
	CompletedPieces int     `json:"completedPieces"`
	TotalPieces     int     `json:"totalPieces"`
	Percent         int     `json:"percent"`
	HashRateMiB     float64 `json:"hashRateMiB"`
	Timestamp       string  `json:"timestamp"`
}

type UploadRecord

type UploadRecord struct {
	Tracker    string
	Status     string
	CreatedAt  time.Time `ts_type:"string"`
	SourcePath string
}

type UploadReview

type UploadReview struct {
	SourcePath string
	Trackers   []TrackerReview
}

type UploadSummary

type UploadSummary struct {
	Uploaded         int
	UploadedTorrents []UploadedTorrent
}
type UploadedImageLink struct {
	SourcePath string
	ImagePath  string
	Host       string
	UsageScope string
	ImgURL     string
	RawURL     string
	WebURL     string
	SizeBytes  int64
	UploadedAt time.Time `ts_type:"string"`
}

type UploadedTorrent

type UploadedTorrent struct {
	Tracker     string
	TorrentID   string
	DownloadURL string
	TorrentURL  string
	TorrentPath string
}

Jump to

Keyboard shortcuts

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