Media Management#

Naming, file management and root folder configuration.

sonarr:
  settings:
    media_management:
      ...

For more information on how to configure these options correctly, refer to these guides from WikiArr and TRaSH-Guides.

rename_episodes: bool = False class-attribute instance-attribute #

Rename imported files to the defined standard format.

Sonarr will use the existing file name if renaming is disabled.

replace_illegal_characters: bool = True class-attribute instance-attribute #

Replace illegal characters within the file name.

If set to False, Sonarr will remove them instead.

standard_episode_format: NonEmptyStr = '{Series TitleYear} - S{season:00}E{episode:00} - {Episode CleanTitle} [{Preferred Words }{Quality Full}]{[MediaInfo VideoDynamicRangeType]}{[Mediainfo AudioCodec}{ Mediainfo AudioChannels]}{MediaInfo AudioLanguages}{[MediaInfo VideoCodec]}{-Release Group}' class-attribute instance-attribute #

File renaming format for a standard episode file.

The default specified here is the current TRaSH-Guides recommended format, but it will not be applied to the Sonarr instance unless it is explicitly defined in the configuration file.

daily_episode_format: NonEmptyStr = '{Series TitleYear} - {Air-Date} - {Episode CleanTitle} [{Preferred Words }{Quality Full}]{[MediaInfo VideoDynamicRangeType]}{[Mediainfo AudioCodec}{ Mediainfo AudioChannels]}{MediaInfo AudioLanguages}{[MediaInfo VideoCodec]}{-Release Group}' class-attribute instance-attribute #

File renaming format for a daily episode file.

The default specified here is the current TRaSH-Guides recommended format, but it will not be applied to the Sonarr instance unless it is explicitly defined in the configuration file.

anime_episode_format: NonEmptyStr = '{Series TitleYear} - S{season:00}E{episode:00} - {absolute:000} - {Episode CleanTitle} [{Preferred Words }{Quality Full}]{[MediaInfo VideoDynamicRangeType]}[{MediaInfo VideoBitDepth}bit]{[MediaInfo VideoCodec]}[{Mediainfo AudioCodec} { Mediainfo AudioChannels}]{MediaInfo AudioLanguages}{-Release Group}' class-attribute instance-attribute #

File renaming format for an anime episode file.

The default specified here is the current TRaSH-Guides recommended format, but it will not be applied to the Sonarr instance unless it is explicitly defined in the configuration file.

series_folder_format: NonEmptyStr = '{Series TitleYear}' class-attribute instance-attribute #

Renaming format for a series folder.

The default specified here is the current TRaSH-Guides recommended format, but it will not be applied to the Sonarr instance unless it is explicitly defined in the configuration file.

season_folder_format: NonEmptyStr = 'Season {season:00}' class-attribute instance-attribute #

Renaming format for a season folder of a series.

The default specified here is the current TRaSH-Guides recommended format, but it will not be applied to the Sonarr instance unless it is explicitly defined in the configuration file.

specials_folder_format: NonEmptyStr = 'Specials' class-attribute instance-attribute #

Renaming format for a specials folder of a series.

The default specified here is the current TRaSH-Guides recommended format, but it will not be applied to the Sonarr instance unless it is explicitly defined in the configuration file.

multiepisode_style: MultiEpisodeStyle = MultiEpisodeStyle.range class-attribute instance-attribute #

Formatting style for the episode numbers of a multi-episode media file.

create_empty_series_folders: bool = False class-attribute instance-attribute #

Create missing series folders during disk scan.

delete_empty_folders: bool = False class-attribute instance-attribute #

Delete empty series and season folders during disk scan and when episode files are deleted.

episode_title_required: EpisodeTitleRequired = EpisodeTitleRequired.always class-attribute instance-attribute #

Prevent importing for up to 48 hours if the episode title is in the naming format and the episode title is TBA.

Values:

  • always
  • bulk-season-releases
  • never
sonarr:
  settings:
    media_management:
      episode_title_required: "always"
skip_free_space_check: bool = False class-attribute instance-attribute #

Skip the free space check for the series root folder.

Only enable when Sonarr is unable to detect free space from your series root folder.

minimum_free_space: int = Field(100, ge=100) class-attribute instance-attribute #

Prevent import if it would leave less than the specified amount of disk space (in megabytes) available.

Minimum value is 100 MB.

Use hard links when trying to copy files from torrents that are still being seeded.

Occasionally, file locks may prevent renaming files that are being seeded. You may temporarily disable seeding and use Sonarr's rename function as a work around.

import_extra_files: bool = False class-attribute instance-attribute #

Import matching extra files (subtitles, .nfo file, etc) after importing an episode file.

unmonitor_deleted_episodes: bool = False class-attribute instance-attribute #

Episodes deleted from disk are automatically unmonitored in Sonarr.

propers_and_repacks: PropersAndRepacks = PropersAndRepacks.do_not_prefer class-attribute instance-attribute #

Whether or not to automatically upgrade to Propers/Repacks.

Values:

  • prefer-and-upgrade
  • do-not-upgrade-automatically
  • do-not-prefer
sonarr:
  settings:
    media_management:
      propers_and_repacks: "do-not-prefer"

Use 'Do not Prefer' to sort by preferred word score over propers/repacks. Use 'Prefer and Upgrade' for automatic upgrades to propers/repacks.

analyze_video_files: bool = True class-attribute instance-attribute #

Extract video information such as resolution, runtime and codec information from files.

This requires Sonarr to read parts of the file, which may cause high disk or network activity during scans.

rescan_series_folder_after_refresh: RescanSeriesFolderAfterRefresh = RescanSeriesFolderAfterRefresh.always class-attribute instance-attribute #

Rescan the series folder after refreshing the series.

Values:

  • always
  • after_manual_refresh
  • never
sonarr:
  settings:
    media_management:
      rescan_series_folder_after_refresh: "always"

NOTE: Sonarr will not automatically detect changes to files if this option is not set to always.

change_file_date: ChangeFileDate = ChangeFileDate.none class-attribute instance-attribute #

Change file date on import/rescan.

Values:

  • none
  • local-air-date
  • utc-air-date
sonarr:
  settings:
    media_management:
      change_file_date: "none"
recycling_bin: Optional[NonEmptyStr] = None class-attribute instance-attribute #

Episode files will go here when deleted instead of being permanently deleted.

recycling_bin_cleanup: int = Field(7, ge=0) class-attribute instance-attribute #

Files in the recycle bin older than the selected number of days will be cleaned up automatically.

Set to 0 to disable automatic cleanup.

set_permissions: bool = False class-attribute instance-attribute #

Set whether or not chmod should run when files are imported/renamed.

If you're unsure what this and the chmod/chown series of attributes do, do not alter them.

chmod_folder: ChmodFolder = ChmodFolder.drwxr_xr_x class-attribute instance-attribute #

Permissions to set on media folders and files during import/rename. File permissions are set without execute bits.

This only works if the user running Sonarr is the owner of the file. It's better to ensure the download client sets the permissions properly.

Values:

  • drwxr-xr-x/755
  • drwxrwxr-x/775
  • drwxrwx---/770
  • drwxr-x---/750
  • drwxrwxrwx/777
sonarr:
  settings:
    media_management:
      chmod_folder: "drwxr-xr-x"
chown_group: Optional[str] = None class-attribute instance-attribute #

Group name or gid. Use gid for remote file systems.

This only works if the user running Sonarr is the owner of the file. It's better to ensure the download client uses the same group as Sonarr.

root_folders: Set[NonEmptyStr] = set() class-attribute instance-attribute #

This allows you to create a root path for a place to either place new imported downloads, or to allow Sonarr to scan existing media.

sonarr:
  settings:
    media_management:
      root_folders:
        - "/path/to/rootfolder"
delete_unmanaged_root_folders: bool = False class-attribute instance-attribute #

Delete root folder definitions from Sonarr if they are not explicitly defined in Buildarr.

Before enabling this option, ensure all the root folders you want Sonarr to scan are defined in Buildarr, as Sonarr might remove imported media from its database when root folder definitions are deleted.

New in version 0.1.2.