renamer

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: 3 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 renamer applies naming format templates to produce filesystem-safe filenames for downloaded media files.

Index

Constants

View Source
const (
	DefaultEpisodeFormat      = "{Series Title} - S{Season:00}E{Episode:00} - {Episode Title} {Quality Full}"
	DefaultSeriesFolderFormat = "{Series Title} ({Release Year})"
	DefaultSeasonFolderFormat = "Season {Season:00}"
	DefaultMovieFormat        = "{Movie Title} ({Release Year}) {Quality Full}"
	DefaultMovieFolderFormat  = "{Movie Title} ({Release Year})"
)

Default format constants used when no explicit format is configured.

Variables

This section is empty.

Functions

func ApplyEpisodeFormat

func ApplyEpisodeFormat(format string, series Series, episode Episode, quality Quality, colon ColonReplacement) string

ApplyEpisodeFormat returns the formatted filename (without extension).

func ApplyFolderFormat

func ApplyFolderFormat(format string, title string, year int) string

ApplyFolderFormat returns the series/movie root folder name.

func ApplyMovieFormat

func ApplyMovieFormat(format string, movie Movie, quality Quality, colon ColonReplacement) string

ApplyMovieFormat returns the formatted filename (without extension).

func ApplySeasonFolderFormat

func ApplySeasonFolderFormat(format string, seasonNumber int) string

ApplySeasonFolderFormat returns the season sub-folder name.

func CleanTitle

func CleanTitle(title string, colon ColonReplacement) string

CleanTitle strips characters that are problematic on common filesystems.

Types

type ColonReplacement

type ColonReplacement string

ColonReplacement controls how colons in titles are handled when producing filesystem-safe filenames.

const (
	ColonDelete    ColonReplacement = "delete"
	ColonDash      ColonReplacement = "dash"
	ColonSpaceDash ColonReplacement = "space-dash"
)

type Episode

type Episode struct {
	SeasonNumber  int
	EpisodeNumber int
	Title         string
}

Episode holds episode-level metadata the renamer needs.

type Movie

type Movie struct {
	Title string
	Year  int
}

Movie holds movie-level metadata the renamer needs.

type Quality

type Quality struct {
	Name  string `json:"name"`  // e.g. "Bluray-1080p x265"
	Codec string `json:"codec"` // e.g. "x265"
}

Quality holds the quality info needed for renaming.

type Series

type Series struct {
	Title string
	Year  int
}

Series holds series-level metadata the renamer needs.

Jump to

Keyboard shortcuts

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