Documentation
¶
Overview ¶
Package renamer applies naming format templates to produce filesystem-safe filenames for imported TV episode files.
Index ¶
- Constants
- func ApplyEpisodeFormat(format string, series Series, episode Episode, quality plugin.Quality, ...) string
- func ApplyFolderFormat(format string, series Series, colon ColonReplacement) string
- func ApplySeasonFolderFormat(format string, seasonNumber int) string
- func CleanTitle(title string, colon ColonReplacement) string
- func DestPath(libraryRoot, episodeFormat, seriesFolderFormat, seasonFolderFormat string, ...) string
- type ColonReplacement
- type Episode
- type Series
Constants ¶
const ( DefaultEpisodeFormat = "{Series Title} - S{Season:00}E{Episode:00} - {Episode Title} {Quality Full}" DefaultDailyEpisodeFormat = "{Series Title} - {Air Date} - {Episode Title} {Quality Full}" DefaultAnimeEpisodeFormat = "{Series Title} - S{Season:00}E{Episode:00} - {Absolute Episode:000} - {Episode Title} {Quality Full}" DefaultSeriesFolderFormat = "{Series Title} ({Release Year})" DefaultSeasonFolderFormat = "Season {Season:00}" )
Default format constants used when a library has no explicit format configured.
Variables ¶
This section is empty.
Functions ¶
func ApplyEpisodeFormat ¶
func ApplyEpisodeFormat(format string, series Series, episode Episode, quality plugin.Quality, colon ColonReplacement) string
ApplyEpisodeFormat returns the formatted filename (without extension) for the given series, episode, quality, and format string.
Supported tokens:
{Series Title} → series.Title
{Series CleanTitle} → filesystem-safe series title
{Original Title} → series.OriginalTitle
{Release Year} → series.Year
{Season:00} → zero-padded season number (e.g. "01")
{Episode:00} → zero-padded episode number (e.g. "05")
{Absolute Episode:000} → zero-padded absolute number (e.g. "005")
{Episode Title} → episode.Title
{Air Date} → episode.AirDate
{Quality Full} → quality.Name
{MediaInfo VideoCodec} → quality.Codec
func ApplyFolderFormat ¶
func ApplyFolderFormat(format string, series Series, colon ColonReplacement) string
ApplyFolderFormat returns the series root folder name.
Supported tokens: {Series Title}, {Series CleanTitle}, {Original Title}, {Release Year}.
func ApplySeasonFolderFormat ¶
ApplySeasonFolderFormat returns the season sub-folder name.
Supported token: {Season:00}.
func CleanTitle ¶
func CleanTitle(title string, colon ColonReplacement) string
CleanTitle strips characters that are problematic on common filesystems while preserving readability. The colon strategy controls how colons in the title are handled.
func DestPath ¶
func DestPath( libraryRoot, episodeFormat, seriesFolderFormat, seasonFolderFormat string, series Series, episode Episode, quality plugin.Quality, colon ColonReplacement, ext string, ) string
DestPath returns the absolute destination path for an imported episode file.
libraryRoot / ApplyFolderFormat(...) / ApplySeasonFolderFormat(...) / ApplyEpisodeFormat(...) + ext
Types ¶
type ColonReplacement ¶
type ColonReplacement string
ColonReplacement controls how colons in series/episode titles are handled when producing filesystem-safe filenames.
const ( // ColonDelete removes colons: "Title: Subtitle" → "Title Subtitle" ColonDelete ColonReplacement = "delete" // ColonDash replaces colons with a dash: "Title: Subtitle" → "Title- Subtitle" ColonDash ColonReplacement = "dash" // ColonSpaceDash replaces ": " with " - ": "Title: Subtitle" → "Title - Subtitle" ColonSpaceDash ColonReplacement = "space-dash" // ColonSmart is offered by the settings UI; it behaves as ColonSpaceDash // (": " → " - ", any other ":" → "-"). ColonSmart ColonReplacement = "smart" )