parser

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package parser implements a comprehensive, unified release name parser. It extracts title, year, video quality, audio, edition, release group, language, and marker information from a single Parse() call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTitle

func ParseTitle(name string) (title string, year int)

ParseTitle is a public helper that extracts the show/movie title and year from a raw filename or release name.

func QualityName

func QualityName(q plugin.Quality) string

QualityName returns the human-readable label for q, the same one the parser gives a release title (e.g. "Bluray-1080p x265 HDR10"). Used where a Quality is rebuilt from stored fields and has no Name yet.

Types

type EpisodeInfo

type EpisodeInfo struct {
	Season          int    // 0 if not found
	Episodes        []int  // empty if season pack or daily/anime only
	AbsoluteEpisode int    // for anime absolute numbering
	AirDate         string // "2024-01-15" for daily shows
	IsSeasonPack    bool   // true if "S01" with no episode number
	IsDaily         bool
	IsAnime         bool
}

EpisodeInfo holds parsed season/episode data from a release title.

func ParseEpisodeInfo

func ParseEpisodeInfo(input string) EpisodeInfo

ParseEpisodeInfo extracts TV episode metadata from a raw release title. It tries each format in priority order and returns on the first match.

type Language

type Language string

Language identifies a detected language tag.

const (
	LangEnglish    Language = "english"
	LangFrench     Language = "french"
	LangGerman     Language = "german"
	LangSpanish    Language = "spanish"
	LangItalian    Language = "italian"
	LangPortuguese Language = "portuguese"
	LangRussian    Language = "russian"
	LangJapanese   Language = "japanese"
	LangKorean     Language = "korean"
	LangChinese    Language = "chinese"
	LangHindi      Language = "hindi"
	LangArabic     Language = "arabic"
	LangDutch      Language = "dutch"
	LangNordic     Language = "nordic"
	LangSwedish    Language = "swedish"
	LangDanish     Language = "danish"
	LangFinnish    Language = "finnish"
	LangNorwegian  Language = "norwegian"
	LangPolish     Language = "polish"
	LangTurkish    Language = "turkish"
	LangMulti      Language = "multi"
)

type ParsedRelease

type ParsedRelease struct {
	// Identity
	Title        string
	Year         int
	ReleaseGroup string

	// Episode info (TV-specific)
	EpisodeInfo EpisodeInfo

	// Video quality
	Resolution plugin.Resolution
	Source     plugin.Source
	Codec      plugin.Codec
	HDR        plugin.HDRFormat

	// Audio
	AudioCodec    plugin.AudioCodec
	AudioChannels plugin.AudioChannels

	// Edition
	Edition string // canonical name, e.g. "Director's Cut"

	// Languages
	Languages []Language

	// Revision
	Revision Revision

	// Markers / Flags
	IsHybrid       bool
	Is3D           bool
	IsHardcodedSub bool
	IsScene        bool
	IsSample       bool
	IsInternal     bool
	IsLimited      bool
	IsSubbed       bool
	IsDubbed       bool
	IsProper       bool
	IsRepack       bool

	// Source metadata
	RawTitle string // original input before normalization

	// Name is the human-readable quality label (e.g. "Bluray-1080p x265 HDR10").
	QualityName string
}

ParsedRelease is the comprehensive result of parsing a release name.

func Parse

func Parse(input string) ParsedRelease

Parse extracts all metadata from a release name or filename. It is a pure function with no external dependencies.

func (ParsedRelease) Quality

func (p ParsedRelease) Quality() plugin.Quality

Quality returns the backward-compatible plugin.Quality struct.

type Revision

type Revision struct {
	Version int  // 1 = original, 2 = PROPER/REPACK, 3 = PROPER2, etc.
	IsReal  bool // REAL tag present
}

Revision tracks PROPER/REPACK/REAL status.

Jump to

Keyboard shortcuts

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