Companion Files

How-to guides, frequently asked questions, not-so-obvious features, etc
Post Reply
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Companion Files

Post by rednoah »

FileBot does support processing companion files alongside their primary media file. FileBot may be able to process companion files more or less well depending on how files are named and organized.



Type 1 Companion Files

If companion files are derived-by-name and thus linked-by-name to the corresponding primary media file, then FileBot will automatically match them to the the same Movie or Episode object and process all of them as a group:

Console Output: Select all

Avatar.mp4
Avatar-info.xml
Avatar-poster.jpg
Avatar-description.txt

e.g. using {ny} as custom format:

Format: Select all

{ ny }

Console Output: Select all

Avatar.mp4
Avatar.xml
Avatar.jpg
Avatar.txt

:idea: In this case, companion files are matched to the same Movie or Episode object as the primary media file, and so the format will likely produce the same destination path for each file. If you want to preserve custom tags (or introduce them) then you will have to modify your custom naming scheme accordingly.


e.g. using a custom format that matches trailing patterns such as -poster from the current file name:

Format: Select all

{ ny }{ '.' + fn.match(/-([a-z]+)$/) }

Console Output: Select all

Avatar.mp4
Avatar.info.xml
Avatar.poster.jpg
Avatar.description.txt
Screenshot




Type 2 Companion Files

Alternatively, you can also use the Import companion files post-processing feature to simply copy along any files or folders that were left behind in the original folder:
Screenshot
rednoah wrote: 14 Sep 2019, 20:35 Copy companion files (e.g. trailers, subtitles, artwork, etc) along from the original folder to the new location:

Shell: Select all

--apply import



:idea: Type 2 Companion Files cannot be matched to Episode / Movie information and thus cannot be formatted with your Episode / Movie custom format. You may be able to use Plain File Mode to pre-rename files to convert Type 2 Companion Files to Type 1 Companion Files and then take it from there. The Rename subtitle files to match the name of a nearby video file example is almost exactly what we need here, and can easily be repurposed for this particular task:

Format: Select all

{ mediaFile.dir }/{ mediaFile.nameWithoutExtension }-{ fn }



:idea: Note that FileBot differentiates primary video files (e.g. movie files) from companion video files (e.g. trailer files) via file size and video length limits. Please read Clutter File Size and Video Length Limits for details.
:idea: Please read the FAQ and How to Request Help.
Post Reply