Documentation
¶
Overview ¶
Package renamer applies naming format templates to produce filesystem-safe filenames for imported movie files.
Index ¶
- Constants
- func Apply(format string, m Movie, q plugin.Quality) string
- func ApplyWithOptions(format string, m Movie, q plugin.Quality, colon ColonReplacement) string
- func CleanTitle(title string) string
- func CleanTitleColon(title string, colon ColonReplacement) string
- func DestPath(libraryRoot, fileFormat, folderFormat string, m Movie, q plugin.Quality, ...) string
- func FolderName(format string, m Movie) string
- type ColonReplacement
- type Movie
Constants ¶
const DefaultFileFormat = "{Movie Title} ({Release Year}) {Quality Full}"
DefaultFileFormat is used when a library has no naming_format set.
const DefaultFolderFormat = "{Movie Title} ({Release Year})"
DefaultFolderFormat is used when a library has no folder_format set.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply returns the formatted filename (without extension) for the given movie, quality, and format string. Substitution variables:
{Movie Title} → movie.Title
{Movie CleanTitle} → filesystem-safe version of movie.Title (delete colon strategy)
{Original Title} → movie.OriginalTitle
{Release Year} → movie.Year
{Quality Full} → quality.Name (e.g. "Bluray-1080p")
{MediaInfo VideoCodec} → quality.Codec (e.g. "x265")
{Edition} → movie.Edition (e.g. "Director's Cut"); empty when untagged
func ApplyWithOptions ¶
ApplyWithOptions is like Apply but allows specifying the colon replacement strategy.
func CleanTitle ¶
CleanTitle strips characters that are problematic on common filesystems while preserving readability. Colons are replaced with " - " (space-dash). Used for {Movie CleanTitle} with the default space-dash strategy.
func CleanTitleColon ¶
func CleanTitleColon(title string, colon ColonReplacement) string
CleanTitleColon is like CleanTitle but applies the specified colon replacement.
func DestPath ¶
func DestPath(libraryRoot, fileFormat, folderFormat string, m Movie, q plugin.Quality, colon ColonReplacement, sourceExt string) string
DestPath returns the absolute destination path for an imported file.
libraryRoot / FolderName(folderFormat, m) / ApplyWithOptions(fileFormat, m, q, colon) + ext
func FolderName ¶
FolderName returns the library sub-directory name for a movie using the given folder format template. Pass DefaultFolderFormat for the standard behaviour.
Types ¶
type ColonReplacement ¶
type ColonReplacement string
ColonReplacement controls how colons in movie titles are handled when producing filesystem-safe filenames.
const ( // ColonDelete removes colons: "Batman: Begins" → "Batman Begins" ColonDelete ColonReplacement = "delete" // ColonDash replaces colons with a dash: "Batman: Begins" → "Batman- Begins" ColonDash ColonReplacement = "dash" // ColonSpaceDash replaces ": " with " - ": "Batman: Begins" → "Batman - Begins" ColonSpaceDash ColonReplacement = "space-dash" // ColonSmart uses space-dash when followed by a space, dash otherwise. ColonSmart ColonReplacement = "smart" )