pgindex

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAdminCategoryID added in v0.7.0

func ParseAdminCategoryID(raw string) int

func StableReleaseGUID

func StableReleaseGUID(providerID int64, releaseKey string) string

StableReleaseGUID returns a deterministic GUID for PG release rows. This keeps release identity stable across repeat formation passes.

Types

type AdminIndexerReleaseListParams added in v0.7.0

type AdminIndexerReleaseListParams struct {
	Query              string
	Newsgroup          string
	Limit              int
	Offset             int
	Sort               string
	CategoryID         int
	Classification     string
	ExternalMediaType  string
	IdentityStatus     string
	PasswordState      string
	MediaQualityTier   string
	Hidden             string
	PublicState        string
	Inspected          string
	Enriched           string
	Uncategorized      string
	PasswordCandidates string
	MetadataMismatch   string
	LowConfidence      string
	CompletionState    string
	HasNFO             *bool
	HasPAR2            *bool
}

type ArticleHeader

type ArticleHeader struct {
	ArticleNumber int64
	MessageID     string
	Subject       string
	Poster        string
	DateUTC       *time.Time
	Bytes         int64
	Lines         int
	Xref          string
	RawOverview   map[string]any
}

type AssemblyCandidate

type AssemblyCandidate struct {
	ID                              int64
	ProviderID                      int64
	NewsgroupID                     int64
	NewsgroupName                   string
	ArticleNumber                   int64
	MessageID                       string
	Subject                         string
	Poster                          string
	DateUTC                         *time.Time
	Bytes                           int64
	Lines                           int
	Xref                            string
	PosterID                        int64
	FileName                        string
	FileIndex                       int
	FileTotal                       int
	YEncPart                        int
	YEncTotal                       int
	YEncFileSize                    int64
	YEncRecoveryMissingCount        int
	YEncRecoveryRetryAfter          *time.Time
	StructuredIdentityBinaryMatched bool
	RawOverview                     map[string]any
}

unassembled header row used by Milestone 6 assembly service.

type AssemblyClaimRequest added in v0.7.1

type AssemblyClaimRequest struct {
	Limit         int
	Owner         string
	LeaseDuration time.Duration
}

type BackfillCheckpointState added in v0.7.0

type BackfillCheckpointState struct {
	ArticleNumber int64
	UntilDate     *time.Time
	CutoffReached bool
	StoppedReason string
}

type BinaryArchiveEntryRecord added in v0.7.0

type BinaryArchiveEntryRecord struct {
	BinaryID          int64
	ReleaseID         string
	EntryName         string
	IsDir             bool
	UncompressedBytes int64
	CompressedBytes   int64
	Encrypted         bool
	Comment           string
	MediaType         string
	Signature         string
	Metadata          map[string]any
}

type BinaryInspectionArtifactRecord added in v0.7.0

type BinaryInspectionArtifactRecord struct {
	BinaryID     int64
	ReleaseID    string
	StageName    string
	ArtifactRole string
	ArtifactName string
	ArtifactPath string
	BytesTotal   int64
	MIMEType     string
	Signature    string
	SourceKind   string
	Metadata     map[string]any
}

type BinaryInspectionCandidate added in v0.7.0

type BinaryInspectionCandidate struct {
	StageName          string
	BinaryID           int64
	ReleaseID          string
	ReleaseTitle       string
	SourceTitle        string
	DeobfuscatedTitle  string
	GroupName          string
	FileName           string
	BinaryName         string
	ReleaseName        string
	Poster             string
	PostedAt           *time.Time
	TotalBytes         int64
	TotalParts         int
	MatchConfidence    float64
	SourceUpdatedAt    *time.Time
	CurrentStatus      string
	CurrentUpdatedAt   *time.Time
	CurrentSummaryJSON json.RawMessage
	ArchiveSummaryJSON json.RawMessage
}

type BinaryInspectionClaimRequest added in v0.7.1

type BinaryInspectionClaimRequest struct {
	StageName     string
	Limit         int
	Owner         string
	LeaseDuration time.Duration
}

type BinaryInspectionRecord added in v0.7.0

type BinaryInspectionRecord struct {
	StageName         string
	BinaryID          int64
	ReleaseID         string
	Status            string
	ErrorText         string
	MaterializedBytes int64
	ToolProvenance    map[string]any
	Summary           map[string]any
	SourceUpdatedAt   *time.Time
}

type BinaryMediaStreamRecord added in v0.7.0

type BinaryMediaStreamRecord struct {
	BinaryID           int64
	ReleaseID          string
	StreamIndex        int
	StreamType         string
	CodecName          string
	CodecLongName      string
	Profile            string
	Width              int
	Height             int
	Channels           int
	Language           string
	DurationSeconds    float64
	BitRate            int64
	DefaultDisposition bool
	ForcedDisposition  bool
	Metadata           map[string]any
}

type BinaryPAR2SetRecord added in v0.7.0

type BinaryPAR2SetRecord struct {
	BinaryID       int64
	ReleaseID      string
	SetName        string
	BaseName       string
	IsVolume       bool
	VolumeNumber   int
	RecoveryBlocks int
	SignatureOK    bool
	Metadata       map[string]any
}

type BinaryPartRecord

type BinaryPartRecord struct {
	BinaryID        int64
	ArticleHeaderID int64
	MessageID       string
	PartNumber      int
	TotalParts      int
	SegmentBytes    int64
	FileName        string
}

binary part upsert input for assembly service.

type BinaryRecord

type BinaryRecord struct {
	ProviderID        int64
	NewsgroupID       int64
	PosterID          int64
	SourceReleaseKey  string
	ReleaseFamilyKey  string
	FileFamilyKey     string
	FamilyKind        string
	BaseStem          string
	IsAuxiliary       bool
	IsMainPayload     bool
	ReleaseKey        string
	ReleaseName       string
	BinaryKey         string
	BinaryName        string
	FileName          string
	FileIndex         int
	ExpectedFileCount int
	TotalParts        int
	PostedAt          *time.Time
	MatchConfidence   float64
	MatchStatus       string
	GroupingEvidence  map[string]any
}

binary upsert input for assembly service.

type BinaryRecoveryRecord added in v0.7.0

type BinaryRecoveryRecord struct {
	BinaryID     int64
	Kind         string
	Extension    string
	Source       string
	Confidence   float64
	Canonicalize bool
}

type BinarySummary

type BinarySummary struct {
	BinaryID           int64
	ProviderID         int64
	NewsgroupID        int64
	SourceReleaseKey   string
	ReleaseFamilyKey   string
	FileFamilyKey      string
	FamilyKind         string
	BaseStem           string
	IsAuxiliary        bool
	IsMainPayload      bool
	ReleaseKey         string
	ReleaseName        string
	BinaryKey          string
	BinaryName         string
	FileName           string
	FileIndex          int
	ExpectedFileCount  int
	Poster             string
	PostedAt           *time.Time
	TotalParts         int
	ObservedParts      int
	TotalBytes         int64
	FirstArticleNumber int64
	LastArticleNumber  int64
	MatchConfidence    float64
	MatchStatus        string
}

binary summary returned to release formation.

type BinaryTextEvidenceRecord added in v0.7.0

type BinaryTextEvidenceRecord struct {
	BinaryID     int64
	ReleaseID    string
	StageName    string
	EvidenceKind string
	TextValue    string
	Tokens       []string
	Metadata     map[string]any
}

type CatalogArticleRef

type CatalogArticleRef struct {
	MessageID  string
	Bytes      int64
	PartNumber int
}

type CatalogReleaseFile

type CatalogReleaseFile struct {
	ID        int64
	BinaryID  int64
	FileName  string
	Subject   string
	Poster    string
	PostedAt  *time.Time
	SizeBytes int64
	IsPars    bool
	FileIndex int
}

read DTOs for PG-backed NZB materialization in Milestone 7.

type IndexerArchiveEntrySummary added in v0.7.0

type IndexerArchiveEntrySummary struct {
	EntryName         string          `json:"entry_name"`
	IsDir             bool            `json:"is_dir"`
	UncompressedBytes int64           `json:"uncompressed_bytes"`
	CompressedBytes   int64           `json:"compressed_bytes"`
	Encrypted         bool            `json:"encrypted"`
	Comment           string          `json:"comment"`
	MediaType         string          `json:"media_type"`
	Signature         string          `json:"signature"`
	Metadata          json.RawMessage `json:"metadata_json"`
}

type IndexerBackfillProgress added in v0.7.2

type IndexerBackfillProgress struct {
	Items []IndexerBackfillProgressItem `json:"items"`
	Count int                           `json:"count"`
}

type IndexerBackfillProgressItem added in v0.7.2

type IndexerBackfillProgressItem struct {
	GroupName                   string     `json:"group_name"`
	ConfiguredCutoffDate        *time.Time `json:"configured_cutoff_date,omitempty"`
	CutoffReached               bool       `json:"cutoff_reached"`
	BackfillCursorArticleNumber int64      `json:"backfill_cursor_article_number"`
	LatestArticleNumber         int64      `json:"latest_article_number"`
	OldestScrapedArticleDate    *time.Time `json:"oldest_scraped_article_date,omitempty"`
	LatestScrapedArticleDate    *time.Time `json:"latest_scraped_article_date,omitempty"`
	ProviderCount               int        `json:"provider_count"`
	LastCheckpointUpdatedAt     *time.Time `json:"last_checkpoint_updated_at,omitempty"`
}

type IndexerBinaryDetail added in v0.7.0

type IndexerBinaryDetail struct {
	BinaryID           int64                                    `json:"binary_id"`
	ReleaseID          string                                   `json:"release_id"`
	ReleaseTitle       string                                   `json:"release_title"`
	GroupName          string                                   `json:"group_name"`
	ReleaseKey         string                                   `json:"release_key"`
	ReleaseName        string                                   `json:"release_name"`
	BinaryKey          string                                   `json:"binary_key"`
	BinaryName         string                                   `json:"binary_name"`
	FileID             int64                                    `json:"file_id"`
	FileName           string                                   `json:"file_name"`
	ProviderID         int64                                    `json:"provider_id"`
	NewsgroupID        int64                                    `json:"newsgroup_id"`
	Poster             string                                   `json:"poster"`
	PostedAt           *time.Time                               `json:"posted_at,omitempty"`
	FileIndex          int                                      `json:"file_index"`
	ExpectedFileCount  int                                      `json:"expected_file_count"`
	TotalParts         int                                      `json:"total_parts"`
	ObservedParts      int                                      `json:"observed_parts"`
	TotalBytes         int64                                    `json:"total_bytes"`
	FirstArticleNumber int64                                    `json:"first_article_number"`
	LastArticleNumber  int64                                    `json:"last_article_number"`
	MatchConfidence    float64                                  `json:"match_confidence"`
	MatchStatus        string                                   `json:"match_status"`
	GroupingEvidence   json.RawMessage                          `json:"grouping_evidence_json"`
	Encrypted          bool                                     `json:"encrypted"`
	PasswordState      string                                   `json:"password_state"`
	Inspections        []IndexerInspectionSummary               `json:"inspections"`
	Artifacts          []IndexerBinaryInspectionArtifactSummary `json:"artifacts"`
	ArchiveEntries     []IndexerArchiveEntrySummary             `json:"archive_entries"`
	MediaStreams       []IndexerMediaStreamSummary              `json:"media_streams"`
	TextEvidence       []IndexerTextEvidenceSummary             `json:"text_evidence"`
	PAR2Sets           []IndexerPAR2SetSummary                  `json:"par2_sets"`
	Parts              []IndexerBinaryPartSummary               `json:"parts"`
}

type IndexerBinaryInspectionArtifactSummary added in v0.7.0

type IndexerBinaryInspectionArtifactSummary struct {
	StageName    string          `json:"stage_name"`
	ArtifactRole string          `json:"artifact_role"`
	ArtifactName string          `json:"artifact_name"`
	ArtifactPath string          `json:"artifact_path"`
	BytesTotal   int64           `json:"bytes_total"`
	MIMEType     string          `json:"mime_type"`
	Signature    string          `json:"signature"`
	SourceKind   string          `json:"source_kind"`
	Metadata     json.RawMessage `json:"metadata_json"`
}

type IndexerBinaryPartSummary added in v0.7.0

type IndexerBinaryPartSummary struct {
	ArticleHeaderID int64  `json:"article_header_id"`
	MessageID       string `json:"message_id"`
	PartNumber      int    `json:"part_number"`
	TotalParts      int    `json:"total_parts"`
	SegmentBytes    int64  `json:"segment_bytes"`
	FileName        string `json:"file_name"`
}

type IndexerDashboardStat added in v0.7.2

type IndexerDashboardStat struct {
	Key                string     `json:"key"`
	Label              string     `json:"label"`
	Description        string     `json:"description"`
	Value              int64      `json:"value"`
	Available          bool       `json:"available"`
	Exact              bool       `json:"exact"`
	UpdatedAt          *time.Time `json:"updated_at,omitempty"`
	RefreshAttemptedAt *time.Time `json:"refresh_attempted_at,omitempty"`
	LastError          string     `json:"last_error,omitempty"`
}

type IndexerDashboardStats added in v0.7.2

type IndexerDashboardStats struct {
	Items []IndexerDashboardStat `json:"items"`
	Count int                    `json:"count"`
}

type IndexerExternalMatchSummary added in v0.7.0

type IndexerExternalMatchSummary struct {
	Source        string          `json:"source"`
	ExternalID    int64           `json:"external_id"`
	MediaType     string          `json:"media_type"`
	Title         string          `json:"title"`
	OriginalTitle string          `json:"original_title"`
	Year          int             `json:"year"`
	Confidence    float64         `json:"confidence"`
	Chosen        bool            `json:"chosen"`
	Payload       json.RawMessage `json:"payload_json"`
}

type IndexerFileArticleSummary added in v0.7.0

type IndexerFileArticleSummary struct {
	MessageID  string `json:"message_id"`
	Bytes      int64  `json:"bytes"`
	PartNumber int    `json:"part_number"`
}

type IndexerFileDetail added in v0.7.0

type IndexerFileDetail struct {
	FileID           int64                       `json:"file_id"`
	ReleaseID        string                      `json:"release_id"`
	ReleaseTitle     string                      `json:"release_title"`
	GroupName        string                      `json:"group_name"`
	BinaryID         int64                       `json:"binary_id"`
	FileName         string                      `json:"file_name"`
	SizeBytes        int64                       `json:"size_bytes"`
	FileIndex        int                         `json:"file_index"`
	IsPars           bool                        `json:"is_pars"`
	Subject          string                      `json:"subject"`
	Poster           string                      `json:"poster"`
	PostedAt         *time.Time                  `json:"posted_at,omitempty"`
	ArticleCount     int                         `json:"article_count"`
	TotalParts       int                         `json:"total_parts"`
	ObservedParts    int                         `json:"observed_parts"`
	MatchConfidence  float64                     `json:"match_confidence"`
	MatchStatus      string                      `json:"match_status"`
	GroupingEvidence json.RawMessage             `json:"grouping_evidence_json"`
	Newsgroups       []string                    `json:"newsgroups"`
	Articles         []IndexerFileArticleSummary `json:"articles"`
}

type IndexerInspectionSummary added in v0.7.0

type IndexerInspectionSummary struct {
	StageName         string          `json:"stage_name"`
	BinaryID          int64           `json:"binary_id"`
	ReleaseID         string          `json:"release_id"`
	Status            string          `json:"status"`
	ErrorText         string          `json:"error_text"`
	MaterializedBytes int64           `json:"materialized_bytes"`
	ToolProvenance    json.RawMessage `json:"tool_provenance_json"`
	Summary           json.RawMessage `json:"summary_json"`
	StartedAt         *time.Time      `json:"started_at,omitempty"`
	FinishedAt        *time.Time      `json:"finished_at,omitempty"`
	UpdatedAt         time.Time       `json:"updated_at"`
}

type IndexerMaintenanceResult added in v0.7.0

type IndexerMaintenanceResult struct {
	AbandonedStageRuns         int64
	ClearedStageLeases         int64
	AbandonedScrapeRuns        int64
	AbandonedBinaryInspections int64
	PurgedStageRuns            int64
	PurgedScrapeRuns           int64
	PurgedBinaryInspections    int64
	PurgedHeaderPayloads       int64
	PurgedOrphanReleases       int64
}

type IndexerMediaStreamSummary added in v0.7.0

type IndexerMediaStreamSummary struct {
	StreamIndex        int             `json:"stream_index"`
	StreamType         string          `json:"stream_type"`
	CodecName          string          `json:"codec_name"`
	CodecLongName      string          `json:"codec_long_name"`
	Profile            string          `json:"profile"`
	Width              int             `json:"width"`
	Height             int             `json:"height"`
	Channels           int             `json:"channels"`
	Language           string          `json:"language"`
	DurationSeconds    float64         `json:"duration_seconds"`
	BitRate            int64           `json:"bit_rate"`
	DefaultDisposition bool            `json:"default_disposition"`
	ForcedDisposition  bool            `json:"forced_disposition"`
	Metadata           json.RawMessage `json:"metadata_json"`
}

type IndexerOverview added in v0.7.0

type IndexerOverview struct {
	ReleaseCount          int64 `json:"release_count"`
	BinaryCount           int64 `json:"binary_count"`
	FileCount             int64 `json:"file_count"`
	InspectionCount       int64 `json:"inspection_count"`
	ReadyNZBCount         int64 `json:"ready_nzb_count"`
	ReadyReleaseCount     int64 `json:"ready_release_count"`
	CompletedReleaseCount int64 `json:"completed_release_count"`
	EncryptedReleaseCount int64 `json:"encrypted_release_count"`
	PasswordKnownCount    int64 `json:"password_known_count"`
	PasswordUnknownCount  int64 `json:"password_unknown_count"`
	PAR2ReleaseCount      int64 `json:"par2_release_count"`
	NFOReleaseCount       int64 `json:"nfo_release_count"`
	MediaProbedCount      int64 `json:"media_probed_count"`
	RunningStageCount     int64 `json:"running_stage_count"`
	PausedStageCount      int64 `json:"paused_stage_count"`
	FailedRunCount        int64 `json:"failed_run_count"`
}

type IndexerPAR2SetSummary added in v0.7.0

type IndexerPAR2SetSummary struct {
	SetName        string          `json:"set_name"`
	BaseName       string          `json:"base_name"`
	IsVolume       bool            `json:"is_volume"`
	VolumeNumber   int             `json:"volume_number"`
	RecoveryBlocks int             `json:"recovery_blocks"`
	SignatureOK    bool            `json:"signature_ok"`
	Metadata       json.RawMessage `json:"metadata_json"`
}

type IndexerPasswordCandidateSummary added in v0.7.0

type IndexerPasswordCandidateSummary struct {
	ID                 int64      `json:"id"`
	BinaryID           int64      `json:"binary_id"`
	ArtifactID         int64      `json:"artifact_id"`
	SourceKind         string     `json:"source_kind"`
	SourceRef          string     `json:"source_ref"`
	Confidence         float64    `json:"confidence"`
	VerificationStatus string     `json:"verification_status"`
	LastVerifiedAt     *time.Time `json:"last_verified_at,omitempty"`
	LastError          string     `json:"last_error"`
}

type IndexerPredbMatchSummary added in v0.7.0

type IndexerPredbMatchSummary struct {
	EntryID    int64           `json:"entry_id"`
	Title      string          `json:"title"`
	Category   string          `json:"category"`
	Source     string          `json:"source"`
	Team       string          `json:"team"`
	Genre      string          `json:"genre"`
	URL        string          `json:"url"`
	SizeKB     float64         `json:"size_kb"`
	FileCount  int             `json:"file_count"`
	PostedAt   *time.Time      `json:"posted_at,omitempty"`
	Confidence float64         `json:"confidence"`
	Chosen     bool            `json:"chosen"`
	Payload    json.RawMessage `json:"payload_json"`
}

type IndexerReleaseDetail added in v0.7.0

type IndexerReleaseDetail struct {
	Release            IndexerReleaseSummary             `json:"release"`
	Newsgroups         []string                          `json:"newsgroups"`
	Files              []IndexerReleaseFileSummary       `json:"files"`
	PasswordCandidates []IndexerPasswordCandidateSummary `json:"password_candidates"`
	Inspections        []IndexerInspectionSummary        `json:"inspections"`
	PredbMatches       []IndexerPredbMatchSummary        `json:"predb_matches"`
	TMDBMatches        []IndexerExternalMatchSummary     `json:"tmdb_matches"`
	TVDBMatches        []IndexerExternalMatchSummary     `json:"tvdb_matches"`
}

type IndexerReleaseFileSummary added in v0.7.0

type IndexerReleaseFileSummary struct {
	FileID          int64      `json:"file_id"`
	BinaryID        int64      `json:"binary_id"`
	FileName        string     `json:"file_name"`
	SizeBytes       int64      `json:"size_bytes"`
	FileIndex       int        `json:"file_index"`
	IsPars          bool       `json:"is_pars"`
	Subject         string     `json:"subject"`
	Poster          string     `json:"poster"`
	PostedAt        *time.Time `json:"posted_at,omitempty"`
	ArticleCount    int        `json:"article_count"`
	TotalParts      int        `json:"total_parts"`
	ObservedParts   int        `json:"observed_parts"`
	MatchConfidence float64    `json:"match_confidence"`
	MatchStatus     string     `json:"match_status"`
}

type IndexerReleaseSummary added in v0.7.0

type IndexerReleaseSummary struct {
	ReleaseID               string     `json:"release_id"`
	GUID                    string     `json:"guid"`
	ProviderID              int64      `json:"provider_id"`
	ReleaseKey              string     `json:"release_key"`
	GroupName               string     `json:"group_name"`
	Title                   string     `json:"title"`
	SourceTitle             string     `json:"source_title"`
	DeobfuscatedTitle       string     `json:"deobfuscated_title"`
	MatchedMediaTitle       string     `json:"matched_media_title"`
	OriginalMediaTitle      string     `json:"original_media_title"`
	TMDBID                  int64      `json:"tmdb_id"`
	TVDBID                  int64      `json:"tvdb_id"`
	ExternalMediaType       string     `json:"external_media_type"`
	ExternalYear            int        `json:"external_year"`
	SeasonNumber            int        `json:"season_number"`
	EpisodeNumber           int        `json:"episode_number"`
	SeasonEpisodeSource     string     `json:"season_episode_source"`
	SeasonEpisodeConfidence float64    `json:"season_episode_confidence"`
	TitleSource             string     `json:"title_source"`
	TitleConfidence         float64    `json:"title_confidence"`
	CategoryID              int        `json:"category_id"`
	Category                string     `json:"category"`
	Classification          string     `json:"classification"`
	Poster                  string     `json:"poster"`
	SizeBytes               int64      `json:"size_bytes"`
	PostedAt                *time.Time `json:"posted_at,omitempty"`
	FileCount               int        `json:"file_count"`
	ExpectedFileCount       int        `json:"expected_file_count"`
	ParFileCount            int        `json:"par_file_count"`
	CompletionPct           float64    `json:"completion_pct"`
	MatchConfidence         float64    `json:"match_confidence"`
	IdentityStatus          string     `json:"identity_status"`
	Passworded              bool       `json:"passworded"`
	PasswordedKnown         bool       `json:"passworded_known"`
	PasswordedUnknown       bool       `json:"passworded_unknown"`
	PasswordState           string     `json:"password_state"`
	PreferredPasswordID     int64      `json:"preferred_password_id"`
	Encrypted               bool       `json:"encrypted"`
	HasPAR2                 bool       `json:"has_par2"`
	HasNFO                  bool       `json:"has_nfo"`
	ArchiveCount            int        `json:"archive_count"`
	VideoCount              int        `json:"video_count"`
	AudioCount              int        `json:"audio_count"`
	SamplePresent           bool       `json:"sample_present"`
	AvailabilityScore       float64    `json:"availability_score"`
	AvailabilityTier        string     `json:"availability_tier"`
	MediaQualityScore       float64    `json:"media_quality_score"`
	MediaQualityTier        string     `json:"media_quality_tier"`
	IdentityConfidenceScore float64    `json:"identity_confidence_score"`
	RuntimeSeconds          int        `json:"runtime_seconds"`
	PrimaryResolution       string     `json:"primary_resolution"`
	PrimaryVideoCodec       string     `json:"primary_video_codec"`
	PrimaryAudioCodec       string     `json:"primary_audio_codec"`
	SubtitleLanguages       []string   `json:"subtitle_languages"`
	MediaTags               []string   `json:"media_tags"`
	MetadataUpdatedAt       *time.Time `json:"metadata_updated_at,omitempty"`
	NZBGenerationStatus     string     `json:"nzb_generation_status"`
	Hidden                  bool       `json:"hidden"`
	PublicVisible           bool       `json:"public_visible"`
	PasswordCandidateCount  int        `json:"password_candidate_count"`
}

type IndexerStageClaimRequest added in v0.7.0

type IndexerStageClaimRequest struct {
	StageName     string
	TriggerKind   string
	Owner         string
	Enabled       bool
	Interval      time.Duration
	BatchSize     int
	Concurrency   int
	Backoff       time.Duration
	LeaseDuration time.Duration
}

type IndexerStageClaimResult added in v0.7.0

type IndexerStageClaimResult struct {
	Claimed bool
	Reason  string
	Run     *IndexerStageRun
}

type IndexerStageFinishRequest added in v0.7.0

type IndexerStageFinishRequest struct {
	RunID       int64
	Owner       string
	ErrorText   string
	MetricsJSON json.RawMessage
}

type IndexerStageRepairResult added in v0.7.0

type IndexerStageRepairResult struct {
	AbandonedRuns      int64 `json:"abandoned_runs"`
	ClearedStaleLeases int64 `json:"cleared_stale_leases"`
}

type IndexerStageRun added in v0.7.0

type IndexerStageRun struct {
	ID          int64           `json:"id"`
	StageName   string          `json:"stage_name"`
	TriggerKind string          `json:"trigger_kind"`
	Status      string          `json:"status"`
	ClaimedBy   string          `json:"claimed_by"`
	StartedAt   time.Time       `json:"started_at"`
	HeartbeatAt *time.Time      `json:"heartbeat_at,omitempty"`
	FinishedAt  *time.Time      `json:"finished_at,omitempty"`
	ErrorText   string          `json:"error_text"`
	MetricsJSON json.RawMessage `json:"metrics_json"`
}

type IndexerStageRunListParams added in v0.7.0

type IndexerStageRunListParams struct {
	StageName   string
	Status      string
	TriggerKind string
	Limit       int
}

type IndexerStageState added in v0.7.0

type IndexerStageState struct {
	StageName       string     `json:"stage_name"`
	Enabled         bool       `json:"enabled"`
	Paused          bool       `json:"paused"`
	IntervalSeconds int        `json:"interval_seconds"`
	BatchSize       int        `json:"batch_size"`
	Concurrency     int        `json:"concurrency"`
	BackoffSeconds  int        `json:"backoff_seconds"`
	LeaseOwner      string     `json:"lease_owner"`
	LeaseExpiresAt  *time.Time `json:"lease_expires_at,omitempty"`
	LastHeartbeatAt *time.Time `json:"last_heartbeat_at,omitempty"`
	LastRunID       int64      `json:"last_run_id"`
	LastSuccessAt   *time.Time `json:"last_success_at,omitempty"`
	LastError       string     `json:"last_error"`
	UpdatedAt       time.Time  `json:"updated_at"`
}

type IndexerStageThroughput added in v0.7.2

type IndexerStageThroughput struct {
	Items []IndexerStageThroughputItem `json:"items"`
	Count int                          `json:"count"`
}

type IndexerStageThroughputItem added in v0.7.2

type IndexerStageThroughputItem struct {
	StageName string                         `json:"stage_name"`
	Label     string                         `json:"label"`
	ItemLabel string                         `json:"item_label"`
	Windows   []IndexerStageThroughputWindow `json:"windows"`
}

type IndexerStageThroughputWindow added in v0.7.2

type IndexerStageThroughputWindow struct {
	WindowHours      int     `json:"window_hours"`
	CompletedRuns    int     `json:"completed_runs"`
	FailedRuns       int     `json:"failed_runs"`
	ItemsProcessed   int64   `json:"items_processed"`
	ItemsPerSecond   float64 `json:"items_per_second"`
	ItemsPerMinute   float64 `json:"items_per_minute"`
	ItemsPerHour     float64 `json:"items_per_hour"`
	AvgRunDurationMS float64 `json:"avg_run_duration_ms"`
}

type IndexerTextEvidenceSummary added in v0.7.0

type IndexerTextEvidenceSummary struct {
	StageName    string          `json:"stage_name"`
	EvidenceKind string          `json:"evidence_kind"`
	TextValue    string          `json:"text_value"`
	Tokens       []string        `json:"tokens"`
	Metadata     json.RawMessage `json:"metadata_json"`
}

type PasswordVerificationCandidate added in v0.7.0

type PasswordVerificationCandidate struct {
	ID                 int64
	ReleaseID          string
	BinaryID           int64
	ArtifactID         int64
	Title              string
	SourceTitle        string
	DeobfuscatedTitle  string
	PasswordValue      string
	SourceKind         string
	SourceRef          string
	Confidence         float64
	VerificationStatus string
	LastError          string
}

type PredbBackfillCheckpoint added in v0.7.0

type PredbBackfillCheckpoint struct {
	Provider              string
	OffsetHint            int
	OldestPostedAt        *time.Time
	OldestNormalizedTitle string
}

type PredbBackfillWindow added in v0.7.0

type PredbBackfillWindow struct {
	From *time.Time
	To   *time.Time
}

type PredbEntryRecord added in v0.7.0

type PredbEntryRecord struct {
	ExternalID      int64
	NormalizedTitle string
	Title           string
	Category        string
	Source          string
	Team            string
	Genre           string
	URL             string
	SizeKB          float64
	FileCount       int
	PostedAt        *time.Time
	Payload         map[string]any
}

type PredbEntrySummary added in v0.7.0

type PredbEntrySummary struct {
	EntryID         int64
	ExternalID      int64
	NormalizedTitle string
	Title           string
	Category        string
	Source          string
	Team            string
	Genre           string
	URL             string
	SizeKB          float64
	FileCount       int
	PostedAt        *time.Time
	Payload         map[string]any
}

type PublicIndexerReleaseCapabilities added in v0.7.0

type PublicIndexerReleaseCapabilities struct {
	CanSendToDownloader bool `json:"can_send_to_downloader"`
}

type PublicIndexerReleaseDetail added in v0.7.0

type PublicIndexerReleaseDetail struct {
	Release      PublicIndexerReleaseSummary       `json:"release"`
	Files        []PublicIndexerReleaseFileSummary `json:"files"`
	Media        PublicIndexerReleaseMediaSummary  `json:"media"`
	External     PublicIndexerReleaseExternal      `json:"external"`
	Capabilities PublicIndexerReleaseCapabilities  `json:"capabilities"`
}

type PublicIndexerReleaseExternal added in v0.7.0

type PublicIndexerReleaseExternal struct {
	TMDBID            int64      `json:"tmdb_id,omitempty"`
	TVDBID            int64      `json:"tvdb_id,omitempty"`
	IMDBID            string     `json:"imdb_id,omitempty"`
	ExternalMediaType string     `json:"external_media_type,omitempty"`
	ExternalTitle     string     `json:"external_title,omitempty"`
	ExternalYear      int        `json:"external_year,omitempty"`
	MetadataUpdatedAt *time.Time `json:"metadata_updated_at,omitempty"`
}

type PublicIndexerReleaseFileSummary added in v0.7.0

type PublicIndexerReleaseFileSummary struct {
	FileName      string     `json:"file_name"`
	SizeBytes     int64      `json:"size_bytes"`
	FileIndex     int        `json:"file_index"`
	IsPars        bool       `json:"is_pars,omitempty"`
	PostedAt      *time.Time `json:"posted_at,omitempty"`
	ArticleCount  int        `json:"article_count"`
	TotalParts    int        `json:"total_parts"`
	ObservedParts int        `json:"observed_parts"`
}

type PublicIndexerReleaseListParams added in v0.7.0

type PublicIndexerReleaseListParams struct {
	Query             string
	Limit             int
	Offset            int
	Sort              string
	Classification    string
	BrowseCategory    string
	BrowseSubcategory string
	HasNFO            *bool
	HasPAR2           *bool
	PasswordState     string
	AvailabilityTier  string
	MediaQualityTier  string
	CompletionMin     float64
	PostedAfter       *time.Time
	PostedBefore      *time.Time
	SizeMin           int64
	SizeMax           int64
	MetadataStatus    string
	IMDBID            string
	TVDBID            int64
	Season            int
	Episode           int
}

type PublicIndexerReleaseMediaSummary added in v0.7.0

type PublicIndexerReleaseMediaSummary struct {
	RuntimeSeconds    int      `json:"runtime_seconds"`
	PrimaryResolution string   `json:"primary_resolution,omitempty"`
	PrimaryVideoCodec string   `json:"primary_video_codec,omitempty"`
	PrimaryAudioCodec string   `json:"primary_audio_codec,omitempty"`
	SubtitleLanguages []string `json:"subtitle_languages,omitempty"`
	SamplePresent     bool     `json:"sample_present"`
	ArchiveCount      int      `json:"archive_count"`
	VideoCount        int      `json:"video_count"`
	AudioCount        int      `json:"audio_count"`
}

type PublicIndexerReleaseSummary added in v0.7.0

type PublicIndexerReleaseSummary struct {
	ReleaseID         string     `json:"release_id"`
	GUID              string     `json:"guid"`
	Title             string     `json:"title"`
	PostedAt          *time.Time `json:"posted_at,omitempty"`
	AddedAt           *time.Time `json:"added_at,omitempty"`
	SizeBytes         int64      `json:"size_bytes"`
	FileCount         int        `json:"file_count"`
	CompletionPct     float64    `json:"completion_pct"`
	CategoryID        int        `json:"category_id"`
	Category          string     `json:"category"`
	Classification    string     `json:"classification"`
	HasPAR2           bool       `json:"has_par2"`
	HasNFO            bool       `json:"has_nfo"`
	PasswordState     string     `json:"password_state,omitempty"`
	AvailabilityScore float64    `json:"availability_score"`
	AvailabilityTier  string     `json:"availability_tier"`
	MediaQualityScore float64    `json:"media_quality_score"`
	MediaQualityTier  string     `json:"media_quality_tier"`
	TMDBID            int64      `json:"tmdb_id,omitempty"`
	TVDBID            int64      `json:"tvdb_id,omitempty"`
	IMDBID            string     `json:"imdb_id,omitempty"`
	ExternalMediaType string     `json:"external_media_type,omitempty"`
	ExternalTitle     string     `json:"external_title,omitempty"`
	ExternalYear      int        `json:"external_year,omitempty"`
	MetadataUpdatedAt *time.Time `json:"metadata_updated_at,omitempty"`
}

type ReleaseCandidate

type ReleaseCandidate struct {
	ProviderID          int64
	NewsgroupID         int64
	KeyKind             string
	SourceReleaseKey    string
	ReleaseFamilyKey    string
	ReleaseKey          string
	ReleaseName         string
	PostedAt            *time.Time
	BinaryCount         int
	CompleteBinaryCount int
	ReadinessBucket     string
	TotalBytes          int64
}

grouped release candidate used by release formation.

type ReleaseCandidateAck added in v0.7.1

type ReleaseCandidateAck struct {
	ProviderID  int64
	NewsgroupID int64
	KeyKind     string
	FamilyKey   string
}

type ReleaseEnrichmentCandidate added in v0.7.0

type ReleaseEnrichmentCandidate struct {
	ReleaseID               string
	Title                   string
	SourceTitle             string
	DeobfuscatedTitle       string
	MatchedMediaTitle       string
	TitleSource             string
	Classification          string
	IdentityStatus          string
	MatchConfidence         float64
	IdentityConfidenceScore float64
	TMDBID                  int64
	TVDBID                  int64
	ExternalMediaType       string
	ExternalYear            int
	SeasonNumber            int
	EpisodeNumber           int
	PostedAt                *time.Time
	RuntimeSeconds          int
	PrimaryResolution       string
	PrimaryVideoCodec       string
	PrimaryAudioCodec       string
}

type ReleaseEnrichmentUpdate added in v0.7.0

type ReleaseEnrichmentUpdate struct {
	ReleaseID               string
	MatchedMediaTitle       string
	OriginalMediaTitle      string
	TMDBID                  int64
	TVDBID                  int64
	ExternalMediaType       string
	ExternalYear            int
	SeasonNumber            int
	EpisodeNumber           int
	SeasonEpisodeSource     string
	SeasonEpisodeConfidence float64
	IdentityStatus          string
	IdentityConfidenceScore float64
	MetadataUpdatedAt       *time.Time
}

type ReleaseFileArticleRecord

type ReleaseFileArticleRecord struct {
	ArticleHeaderID int64
	PartNumber      int
}

article mapping row per release file.

type ReleaseFileRecord

type ReleaseFileRecord struct {
	BinaryID  int64
	FileName  string
	SizeBytes int64
	FileIndex int
	IsPars    bool
	Subject   string
	Poster    string
	PostedAt  *time.Time
	Articles  []ReleaseFileArticleRecord
}

release file upsert input.

type ReleaseInspectionUpdate added in v0.7.0

type ReleaseInspectionUpdate struct {
	ReleaseID           string
	Encrypted           *bool
	HasPAR2             *bool
	HasNFO              *bool
	Passworded          *bool
	PasswordedKnown     *bool
	PasswordedUnknown   *bool
	PasswordState       string
	PreferredPasswordID *int64
	ArchiveCount        *int
	VideoCount          *int
	AudioCount          *int
	RuntimeSeconds      *int
	SamplePresent       *bool
	PrimaryResolution   string
	PrimaryVideoCodec   string
	PrimaryAudioCodec   string
	SubtitleLanguages   []string
	MediaTags           []string
	MediaQualityScore   *float64
	MediaQualityTier    string
	MetadataUpdatedAt   *time.Time
}

type ReleaseOverrideRecord added in v0.7.0

type ReleaseOverrideRecord struct {
	ReleaseID              string     `json:"release_id"`
	DisplayTitle           string     `json:"display_title"`
	ClassificationOverride string     `json:"classification_override"`
	TMDBIDOverride         int64      `json:"tmdb_id_override"`
	TVDBIDOverride         int64      `json:"tvdb_id_override"`
	IMDBIDOverride         string     `json:"imdb_id_override"`
	Hidden                 bool       `json:"hidden"`
	Notes                  string     `json:"notes"`
	Tags                   []string   `json:"tags"`
	CreatedAt              *time.Time `json:"created_at,omitempty"`
	UpdatedAt              *time.Time `json:"updated_at,omitempty"`
}

type ReleasePasswordCandidateRecord added in v0.7.0

type ReleasePasswordCandidateRecord struct {
	ReleaseID          string
	BinaryID           int64
	ArtifactID         int64
	PasswordValue      string
	SourceKind         string
	SourceRef          string
	Confidence         float64
	VerificationStatus string
	LastVerifiedAt     *time.Time
	LastError          string
}

type ReleasePredbMatchRecord added in v0.7.0

type ReleasePredbMatchRecord struct {
	ReleaseID       string
	ExternalID      int64
	NormalizedTitle string
	Title           string
	Category        string
	Source          string
	Team            string
	Genre           string
	URL             string
	SizeKB          float64
	FileCount       int
	PostedAt        *time.Time
	Confidence      float64
	Chosen          bool
	Payload         map[string]any
}

type ReleasePredbUpdate added in v0.7.0

type ReleasePredbUpdate struct {
	ReleaseID               string
	Title                   string
	DeobfuscatedTitle       string
	TitleSource             string
	TitleConfidence         float64
	IdentityStatus          string
	IdentityConfidenceScore float64
	MetadataUpdatedAt       *time.Time
}

type ReleaseRecord

type ReleaseRecord struct {
	ReleaseID               string
	GUID                    string
	ProviderID              int64
	SourceReleaseKey        string
	ReleaseFamilyKey        string
	ReleaseKey              string
	GroupName               string
	Title                   string
	SourceTitle             string
	DeobfuscatedTitle       string
	MatchedMediaTitle       string
	TitleSource             string
	TitleConfidence         float64
	SearchTitle             string
	CategoryID              int
	Category                string
	Classification          string
	Poster                  string
	SizeBytes               int64
	PostedAt                *time.Time
	FileCount               int
	ExpectedFileCount       int
	ParFileCount            int
	CompletionPct           float64
	MatchConfidence         float64
	IdentityStatus          string
	Passworded              bool
	PasswordedKnown         bool
	PasswordedUnknown       bool
	PasswordState           string
	PreferredPasswordID     int64
	Encrypted               bool
	HasPAR2                 bool
	HasNFO                  bool
	ArchiveCount            int
	VideoCount              int
	AudioCount              int
	SamplePresent           bool
	AvailabilityScore       float64
	AvailabilityTier        string
	MediaQualityScore       float64
	MediaQualityTier        string
	IdentityConfidenceScore float64
	RuntimeSeconds          int
	PrimaryResolution       string
	PrimaryVideoCodec       string
	PrimaryAudioCodec       string
	SubtitleLanguages       []string
	MediaTags               []string
	MetadataUpdatedAt       *time.Time
}

release catalog upsert input.

type ReleaseTMDBMatchRecord added in v0.7.0

type ReleaseTMDBMatchRecord struct {
	ReleaseID     string
	TMDBID        int64
	MediaType     string
	Title         string
	OriginalTitle string
	Year          int
	Confidence    float64
	Chosen        bool
	Payload       map[string]any
}

type ReleaseTVDBMatchRecord added in v0.7.0

type ReleaseTVDBMatchRecord struct {
	ReleaseID     string
	TVDBID        int64
	MediaType     string
	Title         string
	OriginalTitle string
	Year          int
	Confidence    float64
	Chosen        bool
	Payload       map[string]any
}

type ReleaseTitleCandidate added in v0.7.0

type ReleaseTitleCandidate struct {
	BinaryID   int64
	Source     string
	Value      string
	Confidence float64
}

type Store

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

func NewStore

func NewStore(dsn string) (*Store, error)

NewStore now opens PostgreSQL by DSN and runs migrations.

func (*Store) AckReleaseCandidate added in v0.7.0

func (s *Store) AckReleaseCandidate(ctx context.Context, providerID, newsgroupID int64, keyKind, familyKey string) error

func (*Store) AckReleaseCandidates added in v0.7.1

func (s *Store) AckReleaseCandidates(ctx context.Context, candidates []ReleaseCandidateAck) error

func (*Store) ApplyBinaryRecovery added in v0.7.0

func (s *Store) ApplyBinaryRecovery(ctx context.Context, in BinaryRecoveryRecord) error

func (*Store) ApplyReleaseEnrichmentUpdate added in v0.7.0

func (s *Store) ApplyReleaseEnrichmentUpdate(ctx context.Context, in ReleaseEnrichmentUpdate) error

func (*Store) ApplyReleaseInspectionUpdate added in v0.7.0

func (s *Store) ApplyReleaseInspectionUpdate(ctx context.Context, in ReleaseInspectionUpdate) error

func (*Store) ApplyReleasePredbUpdate added in v0.7.0

func (s *Store) ApplyReleasePredbUpdate(ctx context.Context, in ReleasePredbUpdate) error

func (*Store) ClaimBinaryInspectionCandidates added in v0.7.1

func (s *Store) ClaimBinaryInspectionCandidates(ctx context.Context, req BinaryInspectionClaimRequest) ([]BinaryInspectionCandidate, error)

func (*Store) ClaimIndexerStage added in v0.7.0

func (s *Store) ClaimIndexerStage(ctx context.Context, req IndexerStageClaimRequest) (*IndexerStageClaimResult, error)

func (*Store) ClaimUnassembledArticleHeaders added in v0.7.1

func (s *Store) ClaimUnassembledArticleHeaders(ctx context.Context, req AssemblyClaimRequest) ([]AssemblyCandidate, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CompleteBinaryInspection added in v0.7.0

func (s *Store) CompleteBinaryInspection(ctx context.Context, in BinaryInspectionRecord) error

func (*Store) CompleteIndexerStageRun added in v0.7.0

func (s *Store) CompleteIndexerStageRun(ctx context.Context, req IndexerStageFinishRequest) error

func (*Store) CountPendingInspectMediaBinaries added in v0.7.2

func (s *Store) CountPendingInspectMediaBinaries(ctx context.Context) (int64, error)

func (*Store) CountPendingReleaseCandidateFamilies added in v0.7.2

func (s *Store) CountPendingReleaseCandidateFamilies(ctx context.Context) (int64, error)

func (*Store) CountUnassembledArticleHeaders added in v0.7.0

func (s *Store) CountUnassembledArticleHeaders(ctx context.Context) (int64, error)

func (*Store) DB

func (s *Store) DB() *sql.DB

func (*Store) DeleteStaleReleasesForSourceKey added in v0.7.0

func (s *Store) DeleteStaleReleasesForSourceKey(ctx context.Context, providerID int64, releaseFamilyKey string, keepGroupNames []string) error

func (*Store) EnsureNewsgroup

func (s *Store) EnsureNewsgroup(ctx context.Context, groupName string) (int64, error)

EnsureNewsgroup creates/updates a newsgroup row and returns its id.

func (*Store) EnsurePoster

func (s *Store) EnsurePoster(ctx context.Context, posterName string) (int64, error)

CHANGED: normalize posters into a dimension table.

func (*Store) EnsureProvider

func (s *Store) EnsureProvider(ctx context.Context, providerKey, displayName string) (int64, error)

EnsureProvider creates/updates a provider row and returns its id.

func (*Store) ExpectedSchemaVersion

func (s *Store) ExpectedSchemaVersion() int

func (*Store) FailBinaryInspection added in v0.7.0

func (s *Store) FailBinaryInspection(ctx context.Context, in BinaryInspectionRecord) error

func (*Store) FailIndexerStageRun added in v0.7.0

func (s *Store) FailIndexerStageRun(ctx context.Context, req IndexerStageFinishRequest) error

func (*Store) FinishScrapeRun

func (s *Store) FinishScrapeRun(ctx context.Context, runID int64, status, errorText string) error

FinishScrapeRun closes a scrape_run row.

func (*Store) GetBackfillCheckpoint

func (s *Store) GetBackfillCheckpoint(ctx context.Context, providerID, newsgroupID int64) (int64, error)

separate backward cursor for historical scrape mode. Returns 0 when no backfill checkpoint exists yet.

func (*Store) GetBackfillCheckpointState added in v0.7.0

func (s *Store) GetBackfillCheckpointState(ctx context.Context, providerID, newsgroupID int64) (*BackfillCheckpointState, error)

func (*Store) GetCatalogReleaseByID

func (s *Store) GetCatalogReleaseByID(ctx context.Context, releaseID string) (*domain.Release, error)

CHANGED: PG release catalog read by id for later resolver work.

func (*Store) GetCheckpoint

func (s *Store) GetCheckpoint(ctx context.Context, providerID, newsgroupID int64) (int64, error)

GetCheckpoint returns the last article number for provider+group. Returns 0 when no checkpoint exists.

func (*Store) GetIndexerBackfillProgress added in v0.7.2

func (s *Store) GetIndexerBackfillProgress(ctx context.Context) (*IndexerBackfillProgress, error)

func (*Store) GetIndexerBinaryDetail added in v0.7.0

func (s *Store) GetIndexerBinaryDetail(ctx context.Context, binaryID int64) (*IndexerBinaryDetail, error)

func (*Store) GetIndexerDashboardStats added in v0.7.2

func (s *Store) GetIndexerDashboardStats(ctx context.Context) (*IndexerDashboardStats, error)

func (*Store) GetIndexerFileDetail added in v0.7.0

func (s *Store) GetIndexerFileDetail(ctx context.Context, fileID int64) (*IndexerFileDetail, error)

func (*Store) GetIndexerOverview added in v0.7.0

func (s *Store) GetIndexerOverview(ctx context.Context) (*IndexerOverview, error)

func (*Store) GetIndexerReleaseDetail added in v0.7.0

func (s *Store) GetIndexerReleaseDetail(ctx context.Context, releaseID string) (*IndexerReleaseDetail, error)

func (*Store) GetIndexerStageRun added in v0.7.0

func (s *Store) GetIndexerStageRun(ctx context.Context, runID int64) (*IndexerStageRun, error)

func (*Store) GetIndexerStageThroughput added in v0.7.2

func (s *Store) GetIndexerStageThroughput(ctx context.Context) (*IndexerStageThroughput, error)

func (*Store) GetLatestCheckpoint

func (s *Store) GetLatestCheckpoint(ctx context.Context, providerID, newsgroupID int64) (int64, error)

explicit latest/forward checkpoint accessor for Milestone 8.5.

func (*Store) GetPredbBackfillCheckpoint added in v0.7.0

func (s *Store) GetPredbBackfillCheckpoint(ctx context.Context, provider string) (*PredbBackfillCheckpoint, error)

func (*Store) GetPredbBackfillWindow added in v0.7.0

func (s *Store) GetPredbBackfillWindow(ctx context.Context) (*PredbBackfillWindow, error)

func (*Store) GetPredbEntryWindow added in v0.7.0

func (s *Store) GetPredbEntryWindow(ctx context.Context) (*PredbBackfillWindow, error)

func (*Store) GetPublicIndexerReleaseDetail added in v0.7.0

func (s *Store) GetPublicIndexerReleaseDetail(ctx context.Context, releaseID string) (*PublicIndexerReleaseDetail, error)

func (*Store) GetReleaseOverride added in v0.7.0

func (s *Store) GetReleaseOverride(ctx context.Context, releaseID string) (*ReleaseOverrideRecord, error)

func (*Store) HasBackfillCutoffReachedForGroup added in v0.7.2

func (s *Store) HasBackfillCutoffReachedForGroup(ctx context.Context, newsgroupID int64, untilDate time.Time) (bool, error)

func (*Store) HeartbeatIndexerStageRun added in v0.7.0

func (s *Store) HeartbeatIndexerStageRun(ctx context.Context, runID int64, owner string, leaseDuration time.Duration) error

func (*Store) InsertArticleHeaders

func (s *Store) InsertArticleHeaders(ctx context.Context, providerID, newsgroupID int64, headers []ArticleHeader) (int64, error)

InsertArticleHeaders inserts header rows plus transient ingest payload side rows.

func (*Store) ListBinariesForReleaseCandidate

func (s *Store) ListBinariesForReleaseCandidate(ctx context.Context, providerID, newsgroupID int64, keyKind, releaseFamilyKey string) ([]BinarySummary, error)

CHANGED: fetch binaries that belong to one release candidate.

func (*Store) ListBinaryInspectionCandidates added in v0.7.0

func (s *Store) ListBinaryInspectionCandidates(ctx context.Context, stageName string, limit int) ([]BinaryInspectionCandidate, error)

func (*Store) ListBinaryPartArticles

func (s *Store) ListBinaryPartArticles(ctx context.Context, binaryID int64) ([]ReleaseFileArticleRecord, error)

CHANGED: fetch article ids/part numbers for one binary so release file article refs can be derived on demand.

func (*Store) ListBinaryPartArticlesBatch added in v0.7.1

func (s *Store) ListBinaryPartArticlesBatch(ctx context.Context, binaryIDs []int64) (map[int64][]ReleaseFileArticleRecord, error)

CHANGED: fetch article ids/part numbers for a set of binaries in one query.

func (*Store) ListCatalogReleaseFileArticles

func (s *Store) ListCatalogReleaseFileArticles(ctx context.Context, releaseFileID int64) ([]CatalogArticleRef, error)

CHANGED: list article refs for one release_file row via release_files -> binary_parts.

func (*Store) ListCatalogReleaseFiles

func (s *Store) ListCatalogReleaseFiles(ctx context.Context, releaseID string) ([]CatalogReleaseFile, error)

CHANGED: list release files for one formed PG release.

func (*Store) ListCatalogReleaseNewsgroups

func (s *Store) ListCatalogReleaseNewsgroups(ctx context.Context, releaseID string) ([]string, error)

CHANGED: list newsgroups attached to a formed release.

func (*Store) ListExistingReleaseCandidates added in v0.7.0

func (s *Store) ListExistingReleaseCandidates(ctx context.Context, limit, offset int) ([]ReleaseCandidate, error)

func (*Store) ListIndexerReleases added in v0.7.0

func (s *Store) ListIndexerReleases(ctx context.Context, params AdminIndexerReleaseListParams) ([]IndexerReleaseSummary, int, error)

func (*Store) ListIndexerStageRuns added in v0.7.0

func (s *Store) ListIndexerStageRuns(ctx context.Context, stageName string, limit int) ([]IndexerStageRun, error)

func (*Store) ListIndexerStageRunsFiltered added in v0.7.0

func (s *Store) ListIndexerStageRunsFiltered(ctx context.Context, params IndexerStageRunListParams) ([]IndexerStageRun, error)

func (*Store) ListIndexerStageStates added in v0.7.0

func (s *Store) ListIndexerStageStates(ctx context.Context) ([]IndexerStageState, error)

func (*Store) ListPasswordVerificationCandidates added in v0.7.0

func (s *Store) ListPasswordVerificationCandidates(ctx context.Context, limit int) ([]PasswordVerificationCandidate, error)

func (*Store) ListPredbEntriesForWindow added in v0.7.0

func (s *Store) ListPredbEntriesForWindow(ctx context.Context, from, to *time.Time, categoryHint string, limit int) ([]PredbEntrySummary, error)

func (*Store) ListPublicIndexerReleases added in v0.7.0

func (s *Store) ListPublicIndexerReleases(ctx context.Context, params PublicIndexerReleaseListParams) ([]PublicIndexerReleaseSummary, int, error)

func (*Store) ListReleaseCandidates

func (s *Store) ListReleaseCandidates(ctx context.Context, limit int) ([]ReleaseCandidate, error)

CHANGED: return release groups whose binaries are new or changed since last formation.

func (*Store) ListReleaseEnrichmentCandidates added in v0.7.0

func (s *Store) ListReleaseEnrichmentCandidates(ctx context.Context, stageName string, limit int) ([]ReleaseEnrichmentCandidate, error)

func (*Store) ListReleaseTitleCandidates added in v0.7.0

func (s *Store) ListReleaseTitleCandidates(ctx context.Context, binaryIDs []int64) ([]ReleaseTitleCandidate, error)

func (*Store) ListUnassembledArticleHeaders

func (s *Store) ListUnassembledArticleHeaders(ctx context.Context, limit int) ([]AssemblyCandidate, error)

func (*Store) PauseIndexerStage added in v0.7.0

func (s *Store) PauseIndexerStage(ctx context.Context, stageName string) error

func (*Store) Ping

func (s *Store) Ping(ctx context.Context) error

func (*Store) RecordYEncRecoveryNotFound added in v0.7.2

func (s *Store) RecordYEncRecoveryNotFound(ctx context.Context, articleHeaderID int64) error

func (*Store) RefreshBinaryStats

func (s *Store) RefreshBinaryStats(ctx context.Context, binaryID int64) error

CHANGED: recompute binary aggregate stats after parts were inserted.

func (*Store) RefreshBinaryStatsBatch added in v0.7.1

func (s *Store) RefreshBinaryStatsBatch(ctx context.Context, binaryIDs []int64) error

func (*Store) RefreshIndexerDashboardStats added in v0.7.2

func (s *Store) RefreshIndexerDashboardStats(ctx context.Context) (*IndexerDashboardStats, error)

func (*Store) RepairIndexerStageRuntime added in v0.7.0

func (s *Store) RepairIndexerStageRuntime(ctx context.Context) (*IndexerStageRepairResult, error)

func (*Store) ReplaceBinaryArchiveEntries added in v0.7.0

func (s *Store) ReplaceBinaryArchiveEntries(ctx context.Context, binaryID int64, rows []BinaryArchiveEntryRecord) error

func (*Store) ReplaceBinaryInspectionArtifacts added in v0.7.0

func (s *Store) ReplaceBinaryInspectionArtifacts(ctx context.Context, stageName string, binaryID int64, rows []BinaryInspectionArtifactRecord) error

func (*Store) ReplaceBinaryMediaStreams added in v0.7.0

func (s *Store) ReplaceBinaryMediaStreams(ctx context.Context, binaryID int64, rows []BinaryMediaStreamRecord) error

func (*Store) ReplaceBinaryPAR2Sets added in v0.7.0

func (s *Store) ReplaceBinaryPAR2Sets(ctx context.Context, binaryID int64, rows []BinaryPAR2SetRecord) error

func (*Store) ReplaceBinaryTextEvidence added in v0.7.0

func (s *Store) ReplaceBinaryTextEvidence(ctx context.Context, stageName string, binaryID int64, rows []BinaryTextEvidenceRecord) error

func (*Store) ReplaceReleaseFiles

func (s *Store) ReplaceReleaseFiles(ctx context.Context, releaseID string, files []ReleaseFileRecord) error

CHANGED: replace release_files atomically for one release.

func (*Store) ReplaceReleaseNewsgroups

func (s *Store) ReplaceReleaseNewsgroups(ctx context.Context, releaseID string, newsgroupIDs []int64) error

CHANGED: replace release_newsgroups atomically for one release.

func (*Store) ReplaceReleasePredbMatches added in v0.7.0

func (s *Store) ReplaceReleasePredbMatches(ctx context.Context, releaseID string, rows []ReleasePredbMatchRecord) error

func (*Store) ReplaceReleaseTMDBMatches added in v0.7.0

func (s *Store) ReplaceReleaseTMDBMatches(ctx context.Context, releaseID string, rows []ReleaseTMDBMatchRecord) error

func (*Store) ReplaceReleaseTVDBMatches added in v0.7.0

func (s *Store) ReplaceReleaseTVDBMatches(ctx context.Context, releaseID string, rows []ReleaseTVDBMatchRecord) error

func (*Store) ResetReleaseEnrichmentState added in v0.7.0

func (s *Store) ResetReleaseEnrichmentState(ctx context.Context, releaseID string) error

func (*Store) ResetReleaseInspectionState added in v0.7.0

func (s *Store) ResetReleaseInspectionState(ctx context.Context, releaseID string) error

func (*Store) ResumeIndexerStage added in v0.7.0

func (s *Store) ResumeIndexerStage(ctx context.Context, stageName string) error

func (*Store) RunIndexerMaintenance added in v0.7.0

func (s *Store) RunIndexerMaintenance(ctx context.Context) (*IndexerMaintenanceResult, error)

func (*Store) RunMigrations

func (s *Store) RunMigrations() error

func (*Store) SchemaVersion

func (s *Store) SchemaVersion(ctx context.Context) (int, error)

func (*Store) SearchCatalogReleases

func (s *Store) SearchCatalogReleases(ctx context.Context, query string, limit int) ([]*domain.Release, error)

CHANGED: PG release catalog search for later aggregator/resolver integration.

func (*Store) SetBackfillCheckpointState added in v0.7.0

func (s *Store) SetBackfillCheckpointState(ctx context.Context, providerID, newsgroupID int64, untilDate *time.Time, cutoffReached bool, stoppedReason string) error

func (*Store) StartBinaryInspection added in v0.7.0

func (s *Store) StartBinaryInspection(ctx context.Context, stageName string, binaryID int64, releaseID string, sourceUpdatedAt *time.Time) error

func (*Store) StartScrapeRun

func (s *Store) StartScrapeRun(ctx context.Context, providerID int64) (int64, error)

StartScrapeRun creates a running scrape_run row.

func (*Store) UpdateReleasePasswordCandidateStatus added in v0.7.0

func (s *Store) UpdateReleasePasswordCandidateStatus(ctx context.Context, candidateID int64, status string, verifiedAt *time.Time, lastError string) error

func (*Store) UpsertBackfillCheckpoint

func (s *Store) UpsertBackfillCheckpoint(ctx context.Context, providerID, newsgroupID, backfillArticleNumber int64) error

persist backward/historical scrape cursor independently of latest cursor.

func (*Store) UpsertBinary

func (s *Store) UpsertBinary(ctx context.Context, in BinaryRecord) (int64, error)

CHANGED: create/update a binary grouping row.

func (*Store) UpsertBinaryPart

func (s *Store) UpsertBinaryPart(ctx context.Context, in BinaryPartRecord) error

CHANGED: add/update one binary part row.

func (*Store) UpsertBinaryParts added in v0.7.1

func (s *Store) UpsertBinaryParts(ctx context.Context, records []BinaryPartRecord) error

UpsertBinaryParts adds or updates binary parts in one transaction and marks the source article headers assembled with one set-based update.

func (*Store) UpsertCheckpoint

func (s *Store) UpsertCheckpoint(ctx context.Context, providerID, newsgroupID, lastArticleNumber int64) error

UpsertCheckpoint stores/advances checkpoint for provider+group.

func (*Store) UpsertLatestCheckpoint

func (s *Store) UpsertLatestCheckpoint(ctx context.Context, providerID, newsgroupID, lastArticleNumber int64) error

explicit latest/forward checkpoint upsert for Milestone 8.5.

func (*Store) UpsertNZBCache

func (s *Store) UpsertNZBCache(ctx context.Context, releaseID, generationStatus, hashSHA256, lastError string) error

CHANGED: seed/update PG nzb cache metadata row for a release.

func (*Store) UpsertPredbBackfillCheckpoint added in v0.7.0

func (s *Store) UpsertPredbBackfillCheckpoint(ctx context.Context, in PredbBackfillCheckpoint) error

func (*Store) UpsertPredbEntries added in v0.7.0

func (s *Store) UpsertPredbEntries(ctx context.Context, rows []PredbEntryRecord) error

func (*Store) UpsertRelease

func (s *Store) UpsertRelease(ctx context.Context, in ReleaseRecord) (string, error)

CHANGED: create/update a release row and keep its id stable.

func (*Store) UpsertReleaseOverride added in v0.7.0

func (s *Store) UpsertReleaseOverride(ctx context.Context, in ReleaseOverrideRecord) error

func (*Store) UpsertReleasePasswordCandidate added in v0.7.0

func (s *Store) UpsertReleasePasswordCandidate(ctx context.Context, in ReleasePasswordCandidateRecord) (int64, error)

func (*Store) ValidateSchema

func (s *Store) ValidateSchema(ctx context.Context) error

Jump to

Keyboard shortcuts

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