Skip to content

Name Templates

Name templates control how files are named and organized when imported into a library. They use Go template syntax ({{ }}) with access to metadata about the media, quality, and release.

Template Types

Templates differ depending on the media type:

Movies have two template fields:

  • Directory template. The folder name (e.g., {{.Media.CleanTitle}} ({{.Media.Year}}))
  • File template. The filename (e.g., {{.Media.CleanTitle}} ({{.Media.Year}}) [{{.Quality.Resolution}}])

Series have three template fields:

  • Show template. The top-level folder (e.g., {{.Media.Title}} ({{.Media.Year}}))
  • Season template. The season subfolder (e.g., Season {{.Media.Season}})
  • File template. The episode filename

File extensions are added automatically. You don't need to include them in your template.

Available Variables

Media

VariableDescriptionExample
{{.Media.Title}}Original titleBreaking Bad
{{.Media.CleanTitle}}Title with unsafe characters removed21 Jump Street
{{.Media.Year}}Release year2008
{{.Media.TmdbID}}TMDB identifier1396
{{.Media.Type}}Media typemovie or series
{{.Media.Season}}Season number (zero-padded)01
{{.Media.Episode}}Episode number (zero-padded)05
{{.Media.EpisodeTitle}}Episode nameGray Matter

Quality

VariableDescriptionExample
{{.Quality.Full}}Complete quality stringBluray-2160p Remux
{{.Quality.Resolution}}Resolution1080p
{{.Quality.Source}}Source typeBluRay, WEB-DL, HDTV

Release

VariableDescriptionExample
{{.Release.ReleaseGroup}}Release groupGROUP
{{.Release.Edition}}Special editionExtended Cut

MediaInfo (Post-Download)

These variables are only available after the file has been downloaded and analyzed:

VariableDescriptionExample
{{.MediaInfo.VideoCodec}}Video codecH.265
{{.MediaInfo.VideoBitDepth}}Bit depth10
{{.MediaInfo.AudioCodec}}Audio codecTrueHD
{{.MediaInfo.AudioChannels}}Channel layout7.1
{{.MediaInfo.HDR}}HDR formatHDR10, Dolby Vision
{{.MediaInfo.Container}}File containerMKV

Template Functions

Two functions are available for sanitizing values:

  • clean removes filesystem-unsafe characters and returns empty string for "unknown" values. Use this for optional fields like episode titles: {{clean .Media.EpisodeTitle}}
  • sanitize removes filesystem-unsafe characters but always returns a value.

Conditional Sections

Use Go template if blocks to include text only when a value is present:

{{if .Release.Edition}} {edition-{{.Release.Edition}}}{{end}}

This outputs {edition-Extended Cut} only when there's an edition value, and nothing otherwise.

Presets

Arrflix includes two built-in presets to get you started:

Simple

A clean, minimal naming scheme.

Movie:

Directory: {{.Media.CleanTitle}} ({{.Media.Year}})
File:      {{.Media.CleanTitle}} ({{.Media.Year}}) [{{.Quality.Resolution}}]

Result: The Matrix (1999)/The Matrix (1999) [1080p].mkv

Series:

Show:    {{.Media.Title}} ({{.Media.Year}})
Season:  Season {{.Media.Season}}
File:    {{.Media.Title}} - S{{.Media.Season}}E{{.Media.Episode}} - {{.Media.EpisodeTitle}} [{{.Quality.Resolution}}]

Result: Breaking Bad (2008)/Season 01/Breaking Bad - S01E05 - Gray Matter [720p].mkv

A detailed scheme following TRaSH Guides conventions, including codec, audio, and HDR information.

Movie example:

21 Jump Street (2012) {tmdb-9559}/
  21 Jump Street (2012) [Bluray-2160p Remux][TrueHD 7.1][HDR10][H.265]-GROUP.mkv

Series example:

Breaking Bad (2008)/Season 01/
  Breaking Bad - S01E05 - Gray Matter [Bluray-1080p][DTS 5.1][H.264]-GROUP.mkv

Default Templates

Each media type (movie and series) can have one template marked as the default. When no policy specifies a template, the default is used.