release

package
v0.10.0-dev.53 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package release reads a release or subtitle name with the patterns the arrs and TRaSH publish, imported as published by cmd/release-patterns into patterns_gen.go and run by netregex with .NET's match semantics.

Index

Constants

View Source
const MaxNameLen = 512

MaxNameLen bounds what Parse reads: the name as given, cut to this many bytes at a rune boundary.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cut

type Cut uint16

Cut is a set of cut tokens read from Radarr's EditionRegex captures; zero is unlabelled. Presentation words (IMAX, Open Matte, Remastered, Collector's, Signature and the like) never set a bit.

const (
	CutTheatrical Cut = 1 << iota
	CutExtended
	CutDirectors
	CutUltimate
	CutFinal
	CutAssembly
	CutRecut
	CutDespecialized
	CutSpecial
	CutUnrated
	CutUncut
	CutUncensored
	CutFanEdit
)

The cut tokens.

type Family

type Family uint8

Family is what rank compares sources by.

const (
	FamilyUnknown Family = iota
	Disc
	Web
	TV
	DVD
	PreRelease
)

The families; FamilyUnknown is SourceUnknown's.

type Parsed

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

Parsed is one name read by the imported tables; the zero value is a name nothing matched.

func Parse

func Parse(name string, k media.Kind) Parsed

Parse reads a video string or a subtitle name with Sonarr's tables for an Episode and Radarr's for a Movie; any other Kind reads as nothing. It reads the name as given, at most MaxNameLen bytes of it: a caller holding a path passes its base name.

func (Parsed) Cut

func (p Parsed) Cut() Cut

Cut is the cut tokens of the name's edition.

func (Parsed) Group

func (p Parsed) Group() string

Group is the release group after the arrs' clean, exception and invalid-group steps; "" when none.

func (Parsed) SeasonPack

func (p Parsed) SeasonPack() bool

SeasonPack is true for an episode name stating a season and no episode marker, as epmarker reads them.

func (Parsed) Service

func (p Parsed) Service() string

Service is a TRaSH streaming custom format's label, set only when that format's specifications hold, its Source condition included; "" when none or when two formats with different labels hold.

func (Parsed) Source

func (p Parsed) Source() Source

Source is the last source label the name carries.

type Source

type Source uint8

Source is the label the imported source patterns give a name; the last match counts, as in the arrs.

const (
	SourceUnknown Source = iota
	BluRay
	Remux
	BDRip
	BRRip
	WebDL
	WebRip
	HDTV
	SDTV
	PDTV
	DSR
	TVRip
	RawHD
	DVDSource
	DVDR
	Cam
	Telesync
	Telecine
	Screener
	Regional
	Workprint
)

The sources the arrs' patterns name; SourceUnknown is a name none matched.

func (Source) Family

func (s Source) Family() Family

Family is the one subflux-owned source mapping: a raw HD capture is TV, a regional release a pre-release.

Directories

Path Synopsis
Package netregex runs .NET-flavour regular expressions with .NET's match semantics, as dlclark/regexp2 defines them, in polynomial time.
Package netregex runs .NET-flavour regular expressions with .NET's match semantics, as dlclark/regexp2 defines them, in polynomial time.

Jump to

Keyboard shortcuts

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