Series - Fix inputs of 1of6 to S01E01

Support for Ubuntu and other Desktop Linux distributions
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

Many documentary episodes sourced form sites like MVGroup use a episode naming convention of '1of6' to identify different episodes (i.e BBC.The.Death.Of.Yugoslavia.1of6.PDTV.x264.MP3.MVGroup.Forum.mp4). This causes Filebot to fail 'CmdlineException: Failed to match files to episode data'.

My script is as follows:

Code: Select all

filebot -script fn:amc --output "/mnt/video/documentary/series" --db thetvdb --def --action test --conflict override --def artwork=n --def excludeList="/home/media/.filebot/series_amc.txt" --def unsorted=y --def unsortedFormat="/mnt/downloads/deluge/complete/flexget/movies/{fn}.{ext}" --def clean=y --def "seriesFormat=/mnt/video/documentary/series/{n}/{'Season '+s}/{n} - {s00e00} - {t}" "ut_dir=/mnt/video/documentary/unsorted" "ut_kind=multi" "ut_label=series" -no-xattr --log-file "/home/media/.filebot/amc.log" --def reportError=y > /home/media/.filebot/series_output.txt 2>&1
media@deluge:/mnt/video/documentary/unsorted$ cat /home/media/.filebot/series_output.txt
I created a test with the following input scenarios:

Test A
Input: /mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.1of6.PDTV.x264.MP3.MVGroup.Forum.mp4
Input: /mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.2of6.PDTV.x264.MP3.MVGroup.Forum.mp4

Test B
Input: /mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.S01E01.PDTV.x264.MP3.MVGroup.Forum.mp4
Input: /mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.S01E02.PDTV.x264.MP3.MVGroup.Forum.mp4

Results for Test A show Filebot failed to identify '1of6' or '2of6' as episode identifiers.

Code: Select all

$cat /home/media/.filebot/series_output.txt
Locking /home/media/.filebot/amc.log
Run script [fn:amc] at [Sat Oct 26 02:49:16 UTC 2019]
Parameter: artwork = n
Parameter: excludeList = /home/media/.filebot/series_amc.txt
Parameter: unsorted = y
Parameter: unsortedFormat = /mnt/downloads/deluge/complete/flexget/movies/{fn}.{ext}
Parameter: clean = y
Parameter: seriesFormat = /mnt/video/documentary/series/{n}/{'Season '+s}/{n} - {s00e00} - {t}
Parameter: ut_dir = /mnt/video/documentary/unsorted
Parameter: ut_kind = multi
Parameter: ut_label = series
Parameter: reportError = y
Use excludes: /home/media/.filebot/series_amc.txt (76)
Input: /mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.1of6.PDTV.x264.MP3.MVGroup.Forum.mp4
Input: /mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.2of6.PDTV.x264.MP3.MVGroup.Forum.mp4
Group: [Series:true] => [BBC.The.Death.Of.Yugoslavia.1of6.PDTV.x264.MP3.MVGroup.Forum.mp4, BBC.The.Death.Of.Yugoslavia.2of6.PDTV.x264.MP3.MVGroup.Forum.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [The Death of Yugoslavia]
Fetching episode data for [The Death of Yugoslavia]
CmdlineException: Failed to match files to episode data
Processing 2 unsorted files
[TEST] from [/mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.1of6.PDTV.x264.MP3.MVGroup.Forum.mp4] to [/mnt/downloads/deluge/complete/flexget/movies/BBC.The.Death.Of.Yugoslavia.1of6.PDTV.x264.MP3.MVGroup.Forum.mp4]
[TEST] from [/mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.2of6.PDTV.x264.MP3.MVGroup.Forum.mp4] to [/mnt/downloads/deluge/complete/flexget/movies/BBC.The.Death.Of.Yugoslavia.2of6.PDTV.x264.MP3.MVGroup.Forum.mp4]
Processed 2 files
Done ヾ(@⌒ー⌒@)ノ
Results for Test B show Filebot SUCESSFULLY identified the series.

Code: Select all

$ cat /home/media/.filebot/series_output.txt
Locking /home/media/.filebot/amc.log
Run script [fn:amc] at [Sat Oct 26 02:59:25 UTC 2019]
Parameter: artwork = n
Parameter: excludeList = /home/media/.filebot/series_amc.txt
Parameter: unsorted = y
Parameter: unsortedFormat = /mnt/downloads/deluge/complete/flexget/movies/{fn}.{ext}
Parameter: clean = y
Parameter: seriesFormat = /mnt/video/documentary/series/{n}/{'Season '+s}/{n} - {s00e00} - {t}
Parameter: ut_dir = /mnt/video/documentary/unsorted
Parameter: ut_kind = multi
Parameter: ut_label = series
Parameter: reportError = y
Use excludes: /home/media/.filebot/series_amc.txt (76)
Input: /mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.S01E01.PDTV.x264.MP3.MVGroup.Forum.mp4
Input: /mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.S01E02.PDTV.x264.MP3.MVGroup.Forum.mp4
Group: [Series:true] => [BBC.The.Death.Of.Yugoslavia.S01E01.PDTV.x264.MP3.MVGroup.Forum.mp4, BBC.The.Death.Of.Yugoslavia.S01E02.PDTV.x264.MP3.MVGroup.Forum.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [The Death of Yugoslavia]
Fetching episode data for [The Death of Yugoslavia]
[TEST] from [/mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.S01E01.PDTV.x264.MP3.MVGroup.Forum.mp4] to [/mnt/video/documentary/series/The Death of Yugoslavia/Season 1/The Death of Yugoslavia - S01E01 - Enter Nationalism.mp4]
[TEST] from [/mnt/video/documentary/unsorted/BBC.The.Death.Of.Yugoslavia.S01E02.PDTV.x264.MP3.MVGroup.Forum.mp4] to [/mnt/video/documentary/series/The Death of Yugoslavia/Season 1/The Death of Yugoslavia - S01E02 - The Road to War.mp4]
Processed 2 files
Done ヾ(@⌒ー⌒@)ノ
So my question is how can make Filebot convert wrongly labeled episode formats of '1of6' (i.e 1ofX) to the standard SXXEXX format so the media is correctly identified and renamed? I have searched the forums without luck.

Your help is much appreciated,

Here's my sysinfo:

Code: Select all

$ filebot -script fn:sysinfo
FileBot 4.8.5 (r6224)
JNA Native: 5.2.0
MediaInfo: 17.12
p7zip: p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz (806E9),ASM,AES-NI)
unrar: UNRAR 5.50 freeware
Chromaprint: fpcalc version 1.4.3
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-05-15 (r565)
Groovy: 2.5.6
JRE: OpenJDK Runtime Environment 11.0.4
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 2 Core / 3 GB Max Memory / 19 MB Used Memory
OS: Linux (amd64)
HW: Linux deluge 4.15.18-12-pve #1 SMP PVE 4.15.18-35 (Wed, 13 Mar 2019 08:24:42 +0100) x86_64 x86_64 x86_64 GNU/Linux
DATA: /home/media/.filebot
Package: DEB
License: FileBot License P926XXXX (Valid-Until: 2020-09-13)
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

-non-strict should do the trick.

e.g.

Code: Select all

filebot -rename *.mp4 --db TheTVDB -non-strict --action TEST
Rename episodes using [TheTVDB] with [Airdate Order]
Auto-detected query: [The Death of Yugoslavia]
Fetching episode data for [The Death of Yugoslavia]
[TEST] from [BBC.The.Death.Of.Yugoslavia.1of6.PDTV.x264.MP3.MVGroup.Forum.mp4] to [The Death of Yugoslavia - 1x01 - Enter Nationalism.mp4]
[TEST] from [BBC.The.Death.Of.Yugoslavia.2of6.PDTV.x264.MP3.MVGroup.Forum.mp4] to [The Death of Yugoslavia - 1x02 - The Road to War.mp4]
Processed 2 files
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

Thankyou. Yes ---- -non-strict fixed it. But as I understand when using "-non-strict" the unsorted mechanism will rarely be used, if at all. My thoughts were to use the default strict settings and manually process the undetermined files (unsorted).

BUT, I am reading about filters. A example would be this poorly labeled documentary file also from MVGroup: Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv

Test A - Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv

Code: Select all

$ cat /home/media/.filebot/series_output.txt
Locking /home/media/.filebot/amc.log
Run script [fn:amc] at [Sat Oct 26 08:19:07 UTC 2019]
Parameter: artwork = n
Parameter: excludeList = /home/media/.filebot/series_amc.txt
Parameter: unsorted = y
Parameter: unsortedFormat = /mnt/downloads/deluge/complete/flexget/movies/{fn}.{ext}
Parameter: clean = y
Parameter: seriesFormat = /mnt/video/documentary/series/{n}/{'Season '+s}/{n} - {s00e00} - {t}
Parameter: ut_dir = /mnt/video/documentary/unsorted
Parameter: ut_kind = multi
Parameter: ut_label = series
Parameter: reportError = y
Use excludes: /home/media/.filebot/series_amc.txt (76)
Input: /mnt/video/documentary/unsorted/Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv
Group: [Series:true] => [Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: []
Failed to detect query for files: [/mnt/video/documentary/unsorted/Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv]
CmdlineException: Failed to match files to episode data
Processing 1 unsorted files
[TEST] from [/mnt/video/documentary/unsorted/Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv] to [/mnt/downloads/deluge/complete/flexget/movies/Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
According to theTVDb site Smithsonian has 5 series listed BUT only 1 'continuing' series: https://www.thetvdb.com/search?q=smithsonian&l=en. So if I rename the file to Smithsonian Channel Documentaries - Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv Filebot correctly identifies the file.



Test B - Smithsonian Channel Documentaries - Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv

Code: Select all

$ cat /home/media/.filebot/series_output.txt
Locking /home/media/.filebot/amc.log
Run script [fn:amc] at [Sat Oct 26 08:45:13 UTC 2019]
Parameter: artwork = n
Parameter: excludeList = /home/media/.filebot/series_amc.txt
Parameter: unsorted = y
Parameter: unsortedFormat = /mnt/downloads/deluge/complete/flexget/movies/{fn}.{ext}
Parameter: clean = y
Parameter: seriesFormat = /mnt/video/documentary/series/{n}/{'Season '+s}/{n} - {s00e00} - {t}
Parameter: ut_dir = /mnt/video/documentary/unsorted
Parameter: ut_kind = multi
Parameter: ut_label = series
Parameter: reportError = y
Use excludes: /home/media/.filebot/series_amc.txt (76)
Input: /mnt/video/documentary/unsorted/Smithsonian Channel Documentaries - Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv
Group: [Series:true] => [Smithsonian Channel Documentaries - Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Smithsonian Channel Documentaries]
Fetching episode data for [Smithsonian Channel Documentaries]
Fetching episode data for [Travel Channel Documentaries]
Fetching episode data for [History Channel Documentaries]
Fetching episode data for [Discovery Channel Documentaries]
Fetching episode data for [Channel 4 (UK) Documentaries]
[TEST] from [/mnt/video/documentary/unsorted/Smithsonian Channel Documentaries - Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv] to [/mnt/video/documentary/series/Smithsonian Channel Documentaries/Season 2017/Smithsonian Channel Documentaries - S2017E06 - Panama's Animal Highway.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
My question is can I use --filter "!readLines('''/home/media/.filebot/includeSeries.txt''').contains(n)" where the text line lists replacement mapping or alias corrections:
`Smithsonian` >> `Smithsonian Channel Documentaries - `

If this can be done it would be brilliant. It would greatly improve results especially for documentary content.

Again. Brilliant product.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

1.
Works out of the box as far as I can tell, since FileBot will just check all episodes of all related TV Shows, and then pick the one where the episode title (in absence of episode numbers) matches best:

Code: Select all

filebot -rename *.mkv --db TheTVDB -non-strict --action TEST
Rename episodes using [TheTVDB] with [Airdate Order]
Auto-detected query: [Smithsonian Channel Documentaries]
Fetching episode data for [Smithsonian Channel Documentaries]
Fetching episode data for [Travel Channel Documentaries]
Fetching episode data for [History Channel Documentaries]
Fetching episode data for [Discovery Channel Documentaries]
Fetching episode data for [Channel 4 (UK) Documentaries]
[TEST] from [Smithsonian Channel Documentaries - Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv] to [Smithsonian Channel Documentaries - 2017x06 - Panama's Animal Highway.mkv]
Processed 1 files


2.
The --filter option cannot be used for "if it says A, assume it says B" kinda logic. It works specifically on the episode level, and is only applied after FileBot has already guessed all the series options from the file name.

--filter can of course be be (ab)used to include only episodes for a specific series, but that neither ensures that this series is included in series lookup step in the first place, nor does it prevent FileBot from fetching episode lists of other potentially matching shows:

Code: Select all

--filter 'n == /Smithsonian Channel Documentaries/'

:idea: A smarter and more generic approach to using --filter is to include / exclude based on series status, assuming you only process Continuing shows:

Code: Select all

--filter 'info.status == /Continuing/'


3.
Additional alias mappings can be done, but only by requesting those changes here, and then waiting for patches to be applied globally for everyone:
viewtopic.php?f=3&t=360
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

The original file was named "Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv" --- here it fails. And unfortunately most of the media is named like this.
Only when I manually rename the file (give it a nudge in the right direction) to "Smithsonian Channel Documentaries - Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv" does your software perform a successful identification and renaming. That's why I was thinking along the lines of remapping the word Smithsonian.
Could one use {n.replace('x','y')} ---- or is this only applied after FileBot has already guessed all the series options from the file name?

Code: Select all

$ cat /home/media/.filebot/series_output.txt
Locking /home/media/.filebot/amc.log
Run script [fn:amc] at [Sat Oct 26 15:33:55 UTC 2019]
Parameter: artwork = n
Parameter: excludeList = /home/media/.filebot/series_amc.txt
Parameter: unsorted = y
Parameter: unsortedFormat = /mnt/downloads/deluge/complete/flexget/movies/{fn}.{ext}
Parameter: clean = y
Parameter: seriesFormat = /mnt/video/documentary/series/{n}/{'Season '+s}/{n} - {s00e00} - {t}
Parameter: ut_dir = /mnt/video/documentary/unsorted
Parameter: ut_kind = multi
Parameter: ut_label = series
Parameter: reportError = y
Use excludes: /home/media/.filebot/series_amc.txt (78)
Input: /mnt/video/documentary/unsorted/Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv
Group: [Series:true] => [Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: []
Failed to detect query for files: [/mnt/video/documentary/unsorted/Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv]
CmdlineException: Failed to match files to episode data
Processing 1 unsorted files
[TEST] from [/mnt/video/documentary/unsorted/Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv] to [/mnt/downloads/deluge/complete/flexget/movies/Smithsonian.Panamas.Animal.Highway.720p.HDTV.x264.AAC.MVGroup.org.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

2elles wrote: 26 Oct 2019, 15:45 Could one use {n.replace('x','y')} ---- or is this only applied after FileBot has already guessed all the series options from the file name?
{n} is the series name, which isn't known until the file has been matched to an episode.


:idea: You can of course pre-rename files, in plain file mode, in which case {n} is just the current file name: viewtopic.php?t=2072
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

Thank you for adding the `Smithsonian` >> `Smithsonian Channel Documentaries` mapping. I guess my filebot mapping files may update in the weeks or days coming. Is there a way to force update? My Filebot is installed in a Proxmox Ubuntu 18.04 LXC container using this install method:

Code: Select all

apt install curl -y &&
bash -xu <<< "$(curl -fsSL https://raw.githubusercontent.com/filebot/plugins/master/installer/deb.sh)"
Again thank you for great product and your help.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

Upgrading to the latest beta should also force an update for all internal indices:
https://get.filebot.net/filebot/BETA/


:idea: Using --filter is probably a better short-term and better generic solution (e.g. age filter) though.
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

Back rewriting my whole config.
Iam wanting to store my non-credential variables in a separate yml file (not my variables.yml). My questions are:
1) Can I have two variables' yml files? If so, can I have a import example for my config.yml?
2) Can I put something like 'include: variables_regex.yml' in my default variables.yml file?

I tried many scenarios to achieve this without luck. I figured the "variables:" the plugin only supports one external file.

My variables_regex.yml looks like this (the second external file):

Code: Select all

# Variables
mvgroup:
  # Regex - video metadata keywords (MVGroup)
  # Lookahead for first metadata keyword in a string (hdtv, 720p,1080p etc)
  quality_metadata_regex: '(?=\.(\d{3,4}[pi]|hdtv|web[-_]?dl|x265|h265|x264|h264|hdtv\.pdtv\.dvd|blu[-_]?ray))'
  
  # Regex - Broadcaster name only (MVGroup)
  # Lookahead for first word only that identifies a broadcaster (i.e bbc,nhk)
  broadcaster_name_regex: '(?:(bbc\.(?!documentaries)|ch[0-9]?\.|itv\.(?!documentaries)|nhk\.(?!documentaries|world\.documentaries)|s4c\.|sbs\.|ng\.|uktv\.|sky\.|bskyb\.|dw\.(?!documentaries)|canal\.|\(cit\)\.|%28CIT%29\.|arte\.|pbs\.(?!documentaries|specials)|cnn\.|national\.geographic\.)'
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

FileBot does not support *.yml configuration files of any kind. You seem to be referring to configuration files for some other software tool?
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

rednoah wrote: 16 Mar 2023, 11:46 FileBot does not support *.yml configuration files of any kind. You seem to be referring to configuration files for some other software tool?
Oops. Alzheimer's kicking in. Yes, it's a FlexGet question. Sorry for disturbing you.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

No worries. Feel free to check in every few years. :)
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

My return was earlier than expected -- a few days. :) Here is my scenario.I have sorted my MVGroup RSS into distinct categories and labeled them into an list array.
  • type03 - series (files with s00e00)
    type04 - movies (files with no form of s00e00 but includes (year)
    type05 - unsorted (mixed content of series or movies)
My problem is with 'type05'.

Example of 'type05' source filenames are:

Code: Select all

/mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Paul.Whitehouse.Our.Troubled.Rivers.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/Ch4 - Dispatches - Undercover.Ambulance.NHS.in.Chaos.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Expedition.Volcano.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/Ober.Ost.The.Forgotten.Colony.in.the.Heart.of.Europe.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/ITV - Morse.and.the.Last.Endeavour.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/See.No.Evil.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/Borscht.The.Secret.Ingredient.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/Ch4 - The.Piano.The.Final.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/The.KGB.Connections.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/Ch4 - Nazanin.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Ceiliuradh.Na.Feile.Padraig.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/NHK - Cycle.Around.Japan - Tokyos.Islands.Niijima.and.Hachijojima.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Giving.it.Stick.mkv:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/FT - Legend.of.Sam.mp4:null_entry:/mnt/downloads/unsorted:type05
/mnt/downloads/torrent/complete/flexget/documentary/unsorted/NHK - Dive.in.Tokyo - Yanaka.Building.on.the.Past.mkv:null_entry:/mnt/downloads/unsorted:type05
In testing I am using this file:

Code: Select all

src_path="/mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan.mkv"
unsorted_path="/mnt/downloads/unsorted"
storage_video="/mnt/video"
# Rename tmpl - Series
series_fmt="{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[\`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part \$1')} - [{\"\$hd\"}{\" \$vf\"}{\" \$vc\"}{\" \$ac\"}{\" \$channels\"}{\" \$hdr\"}]{'.'+lang}"
# Rename tmpl - Movie
movie_fmt="{n} ({y})/{n} ({y}){' CD'+pi} - [{\"\$hd\"}{\" \$vf\"}{\" \$vc\"}{\" \$ac\"}{\" \$channels\"}{\" \$hdr\"}]{'.'+lang}"
# Rename tmpl - Unsorted
unsorted_fmt="{file.structurePathTail}"

filebot -script fn:amc "$src_path" \
--output "$storage_video" \
--action test \
--conflict "auto" \
--q "70106" \
--def artwork="n" \
--def extras="n" \
--def unsorted="y" \
--def unsortedFormat="$unsorted_path/{file.structurePathTail}" \
--def series.DB=TheMovieDB::TV movie.DB=TheMovieDB -no-xattr \
--def seriesFormat="documentary/series/$series_fmt" \
--def movieFormat="documentary/movies/$movie_fmt" \
--def reportError=y \
-non-strict
With the above config I thought FileBot would try for either a movie or series matching using tmdb. My result is:

Code: Select all

Parameter: artwork = n
Parameter: extras = n
Parameter: unsorted = y
Parameter: unsortedFormat = /mnt/downloads/unsorted/{file.structurePathTail}
Parameter: series.DB = TheMovieDB::TV
Parameter: movie.DB = TheMovieDB
Parameter: seriesFormat = documentary/series/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')} - [{"$hd"}{" $vf"}{" $vc"}{" $ac"}{" $channels"}{" $hdr"}]{'.'+lang}
Parameter: movieFormat = documentary/movies/{n} ({y})/{n} ({y}){' CD'+pi} - [{"$hd"}{" $vf"}{" $vc"}{" $ac"}{" $channels"}{" $hdr"}]{'.'+lang}
Parameter: reportError = y
Argument[0]: /mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan.mkv
[TEST] --def unsorted is incompatible with --action TEST and has been disabled
Input: /mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan.mkv
Group: {Series=null} => [BBC - Our.World - My.Escape.from.Afghanistan.mkv]
Finished without processing any files
Done ¯\_(ツ)_/¯
And if I apply '--q "70106"' I also do not get a match:

Code: Select all

filebot -script fn:amc "$src_path" \
--output "$storage_video" \
--action test \
--conflict "auto" \
--def artwork="n" \
--def extras="n" \
--def unsorted="y" \
--def unsortedFormat="$unsorted_path/{file.structurePathTail}" \
--def series.DB=TheMovieDB::TV movie.DB=TheMovieDB -no-xattr \
--def seriesFormat="documentary/series/$series_fmt" \
--def movieFormat="documentary/movies/$movie_fmt" \
--def reportError=y \
--q "70106" \
-non-strict
Run script [fn:amc] at [Mon Mar 20 12:11:22 ICT 2023]

[PSA] Important Discussion of Proposed Changes:
https://www.filebot.net/forums/viewtopic.php?t=13406

Parameter: artwork = n
Parameter: extras = n
Parameter: unsorted = y
Parameter: unsortedFormat = /mnt/downloads/unsorted/{file.structurePathTail}
Parameter: series.DB = TheMovieDB::TV
Parameter: movie.DB = TheMovieDB
Parameter: seriesFormat = documentary/series/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')} - [{"$hd"}{" $vf"}{" $vc"}{" $ac"}{" $channels"}{" $hdr"}]{'.'+lang}
Parameter: movieFormat = documentary/movies/{n} ({y})/{n} ({y}){' CD'+pi} - [{"$hd"}{" $vf"}{" $vc"}{" $ac"}{" $channels"}{" $hdr"}]{'.'+lang}
Parameter: reportError = y
Argument[0]: /mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan.mkv
[TEST] --def unsorted is incompatible with --action TEST and has been disabled
Input: /mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan.mkv
Group: {Series=null} => [BBC - Our.World - My.Escape.from.Afghanistan.mkv]
Finished without processing any files
Done ¯\_(ツ)_/¯
But if I apply '--q "70106"' and '--def ut_label="series"' I do get a match:

Code: Select all

filebot -script fn:amc "$src_path" \
--output "$storage_video" \
--action test \
--conflict "auto" \
--def artwork="n" \
--def extras="n" \
--def unsorted="y" \
--def unsortedFormat="$unsorted_path/{file.structurePathTail}" \
--def series.DB=TheMovieDB::TV movie.DB=TheMovieDB -no-xattr \
--def seriesFormat="documentary/series/$series_fmt" \
--def movieFormat="documentary/movies/$movie_fmt" \
--def reportError=y \
--q "70106" \
-non-strict
Run script [fn:amc] at [Mon Mar 20 12:11:22 ICT 2023]

[PSA] Important Discussion of Proposed Changes:
https://www.filebot.net/forums/viewtopic.php?t=13406

Parameter: artwork = n
Parameter: extras = n
Parameter: unsorted = y
Parameter: unsortedFormat = /mnt/downloads/unsorted/{file.structurePathTail}
Parameter: series.DB = TheMovieDB::TV
Parameter: movie.DB = TheMovieDB
Parameter: seriesFormat = documentary/series/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')} - [{"$hd"}{" $vf"}{" $vc"}{" $ac"}{" $channels"}{" $hdr"}]{'.'+lang}
Parameter: movieFormat = documentary/movies/{n} ({y})/{n} ({y}){' CD'+pi} - [{"$hd"}{" $vf"}{" $vc"}{" $ac"}{" $channels"}{" $hdr"}]{'.'+lang}
Parameter: reportError = y
Argument[0]: /mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan.mkv
[TEST] --def unsorted is incompatible with --action TEST and has been disabled
Input: /mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan.mkv
Group: {Series=null} => [BBC - Our.World - My.Escape.from.Afghanistan.mkv]
Finished without processing any files
Done ¯\_(ツ)_/¯
So my question is why do I need '--def ut_label="series"'?

I am also considering inserting the --q arg into known files at the FlexGet pre-processing stage whenever possible using regex match. For example:
-- /mnt/downloads/torrent/complete/flexget/documentary/unsorted/BBC - Our.World - My.Escape.from.Afghanistan - [ID70106].mkv
Can I use --q "{fn.match(/ID(\d{1,9})/)}" in my script even if the arg [IDxxxxx] doesn't exist?

Thank you.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

You're using the amc script when you should be using filebot -rename and call that with either --db TheMovieDB (force Movie Mode) or --db TheMovieDB::TV (force Series Mode) depending on the type, Movie or Series. You can of course use the amc script but you're just adding lots and lots complexity but without using any of the benefits.


:arrow: If you don't explicitly specify Movie Mode or Series Mode then the amc script will try to classify the input automatically. However, a file name such as The.KGB.Connections doesn't tell us anything. No SxE numbers. No Year. Doesn't look like anything to me. Looks like the amc script chooses to do nothing in this case. That's why you don't want filebot to guess things when you already know the answer in advance, and so you'll want to use --def ut_label to pass that information along.


:idea: TMDB IDs are unique per Movie or Series and not globally unique. There is movie/500 and tv/500 and so --q 00500 isn't enough.




EDIT:

This line doesn't do anything because series.DB and movie.DB are not amc script options:

Code: Select all

--def series.DB=TheMovieDB::TV movie.DB=TheMovieDB
NOTE: you seem to have picked up the documentation for permanently configuring internals used by filebot -rename and Smart Mode: Automatic calls; but you also changed db to DB so it wouldn't even work for that.


:arrow: You are using the amc script this applies:
rednoah wrote: 09 Dec 2020, 11:11 :idea: If you are using the amc script, then there are dedicated script parameters for that:

Code: Select all

filebot -script fn:amc ... --def movieDB=TheMovieDB seriesDB=TheMovieDB::TV animeDB=TheMovieDB::TV
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

Your help is much appreciated.


Q1. Can you perform an unsorted option with 'filebot -rename'?

Q2. Trying to use a filter (includes/excludes) to pin down series IDs. For example:
-- "Imagine - Stephen.Frears.Director.for.Hire - [series BBC].mkv"
-- "Dispatches - Undercover.Ambulance.NHS.in.Chaos.mkv"

Where I know the series IDs for both and my belief is placing the ID lines in an includes file would avoid any potential mismatches. Or are the includes and excludes files just a whitelist and blacklist of IDs where the name is not queried?

My include/exclude tsv files are as follows:

Code: Select all

#  filter_default_include.tsv
# Always use  tab to separate 'id' from 'name'
6507    dispatches
6507    ch4 - dispatches
83231   dispatches
99750   imagine

#  filter_default_exclude.tsv
# Always use  tab to separate 'id' from 'name'
110356  My Name
110356  my name (2021)

My filebot cmds is:

Code: Select all

filebot -rename "$src_path" \
--output "$storage_video" \
--action test \
--conflict "auto" \
--db TheMovieDB::TV \
--apply artwork nfo metadata srt \
--filter "id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv') && id !in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_exclude.tsv')" \
--filter "true" \
--format "{plex.id}" \
-non-strict

Results:
media@flexget:~/.flexget/cookbook/recipe_00$ filebot -rename "$src_path" \
--output "$storage_video" \
--action test \
--conflict "auto" \
--db TheMovieDB::TV \
--apply artwork nfo metadata srt \
--filter "id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv') && id !in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_exclude.tsv')" \
--filter "true" \
--format "{plex.id}" \
-non-strict
--filter "id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv') && id input_amc_LIST=() csv('/home/media/.flexget/cookbook/recipe_00/filter_default_exclude.tsv')" \
* Consider using --mode interactive to enable interactive mode
Rename episodes using [TheMovieDB] with [Airdate Order]
Lookup via [Dispatches] []
Fetching episode data for [Dispatches]
└─ 332 episodes
Apply filter [true] on [332] options
Include [Dispatches - 1x01 - Dispatches]
Include [Dispatches - 1x02 - In The Red]
Include [Dispatches - 1x03 - AIDS - The Unheard Voices]
Include [Dispatches - 1x04 - Divided by Law]
# I pruned 100s of lines off for posting purposes
[332] options remaining
[TEST] from [/mnt/downloads/torrent/complete/flexget/documentary/series/Dispatches - Undercover.Ambulance.NHS.in.Chaos.mkv] to [/mnt/video/TV Shows/Dispatches {tmdb-6507}/Season 32/Dispatches - S32E02 - Undercover in Premier Inn.mkv]
Processed 1 file

# When using --db TheTVDB the match is:
[TEST] from [/mnt/downloads/torrent/complete/flexget/documentary/series/Dispatches - Undercover.Ambulance.NHS.in.Chaos.mkv] to [/mnt/video/TV Shows/Dispatches {tvdb-83231}/Season 2023/Dispatches - S2023E02 - Undercover Ambulance - NHS in Chaos.mkv]
Is my --filter line correct? It appears to be working but I am not 100% sure.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

Q1:
If you do not specify --db then filebot will try to automatically classify the input files as either Movie or Episode and process files accordingly. This is not recommended. Please read the console output for details:

Code: Select all

$ filebot -rename *.mp4
Classify media files
...
[MOVE] from [Alias.1x01.mp4] to [Alias - 1x01 - Truth Be Told.mp4]
...
[MOVE] from [Avatar.2009.mp4] to [Avatar (2009).mp4]

:!: Explicitly specifying either --db TheMovieDB for Movie Mode or --db TheMovieDB::TV for Series Mode is strongly recommended.




Q2:
You are not using a --filter because --filter true is the same as not specifying a --filter at all. Please read the console output for details:

Code: Select all

Apply filter [true] on [332] options
...
[332] options remaining
rednoah wrote: 21 Mar 2023, 05:41 :idea: If your --filter is wrong, and excludes all possible matches, then not using a --filter at all is useful for finding the cause of the problem. That's all there is to the help message above. --filter true is effectively the same as not specifying a --filter at all. If FileBot auto-detection is working for the files at hand, then --filter is not necessary, and may break things if the --filter expression is broken.



:arrow: use --filter to exclude specific series IDs:

Code: Select all

--filter 'id !in csv("/path/to/excludes.tsv")'
:!: Note that csv() works best with TAB separated values, and SPACE separated values (i.e. your excludes file sample above uses SPACE as separator) will not work:

Code: Select all

74380	Magnum, P.I. (1980)
72546	CSI: Crime Scene Investigation (2000)

:idea: As always, you will want to run tests in the Format Editor first, because the Format Editor will tell you if your --filter expression is working or not:

Image

Code: Select all

2046	Alias



Q3:
Do you know the ID for each file in advance? If so, then you can pass the ID via the --q option. Please read How do I process specific files with specific command-line options? for details.





EDIT:

:!: Note that the include/exclude tsv snippet above is using SPACES and not TAB. This may be a copy & paste error.

:!: The IDs in your include/exclude tsv snippet are also mostly wrong:
* https://www.themoviedb.org/tv/83231
* https://www.themoviedb.org/tv/99750
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

You are right! It's the Copy & Paste from vscode into a nano file. When I used tabs in nano it works:

Code: Select all

filebot -rename "$src_path" \
--output "$storage_video" \
--action test \
--conflict "auto" \
--db TheMovieDB::TV \
--apply artwork nfo metadata srt \
--filter "id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv')" \
--format "{plex.id}" \
-non-strict

Results:
media@flexget:~/.flexget/cookbook/recipe_00$ filebot -rename "$src_path" \
--output "$storage_video" \
--action test \
--conflict "auto" \
--db TheMovieDB::TV \
--apply artwork nfo metadata srt \
--filter "id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv')" \
--format "{plex.id}" \
-non-strict
* Consider using --mode interactive to enable interactive mode
Rename episodes using [TheMovieDB] with [Airdate Order]
Lookup via [Dispatches] []
Fetching episode data for [Dispatches]
└─ 332 episodes
Apply filter [id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv')] on [332] options
Include [Dispatches - 1x01 - Dispatches]
Include [Dispatches - 1x02 - In The Red]
Include [Dispatches - 1x03 - AIDS - The Unheard Voices]
.........
[332] options remaining
[TEST] from [/mnt/downloads/torrent/complete/flexget/documentary/series/Dispatches - Undercover.Ambulance.NHS.in.Chaos.mkv] to [/mnt/video/TV Shows/Dispatches {tmdb-6507}/Season 32/Dispatches - S32E02 - Undercover in Premier Inn.mkv]
Processed 1 file
But this filter throws an error and I do not know why.

Code: Select all

--filter "id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv') && id !in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_exclude.tsv')"

Results:
Syntax Error: Unexpected input: '() csv'

The following Groovy code is syntactically incorrect:
id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv') && id input_amc_LIST=() csv('/home/media/.flexget/cookbook/recipe_00/filter_default_exclude.tsv')

The shell may interpret special characters such as ", ', `, $ or ! so special care must be taken when passing complex Groovy expressions on the command-line.

Please pass complex Groovy expressions via external text files:
https://www.filebot.net/help/argument-files.html

Error (o_O)
--format: command not found
Also, on any failure to determine to show is there a unsorted function like in AMC?

EDIT

This seems to have fixed the error:

Code: Select all

--filter "id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv') && !(id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_exclude.tsv'))" 
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

The following Groovy code is syntactically incorrect:

Code: Select all

id in csv('/home/media/.flexget/cookbook/recipe_00/filter_default_include.tsv') && id input_amc_LIST=() csv('/home/media/.flexget/cookbook/recipe_00/filter_default_exclude.tsv')
You think you are passing !in but FileBot is telling you that you are actually passing input_amc_LIST=() because:

Code: Select all

The shell may interpret special characters such as ", ', `, $ or ! so special care must be taken when passing complex Groovy expressions on the command-line.
:!: :!: Read ! Bash History Expansion for details. :!: :!:



Compare & Contrast:

Code: Select all

$ echo "!in"
-sh: !in: event not found

Code: Select all

$ echo '!in'
!in
:arrow: '...' and "..." is not the same. Always use '...' when passing literal values.



FileBot further suggests to not use command-line arguments to pass complex values:

Code: Select all

Please pass complex Groovy expressions via external text files:
https://www.filebot.net/help/argument-files.html
:idea: If you write your filter with an external source file, then you write complex code with '...' and "..." and ! and $ etc in your text file, and then pass that along via a simple file path:

Code: Select all

--format /path/to/MyFilter.groovy
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

What a mess. My IDs were not from a consistent source. Certainly makes for interesting viewing :)
* ID 83231 - Documentary show: https://thetvdb.com/series/dispatches
* ID 83231 - Porn show: https://www.themoviedb.org/tv/83231

Can I use ';' as a IFS instead of 'tab' in the includes and excludes csv file?

And can I make the --q optional? Meaning no error if the filename doesn't have a ID .

Code: Select all

--q "{fn.match(/ID(\d{1,9})]/)}"
Your help is much appreciated.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

1.
; should work.

As always, you'll want to test that assumption in the Format Editor though:

Code: Select all

{ lines('ids.tsv') } | { csv('ids.tsv') }

Code: Select all

[2046;Alias] | {2046=Alias}


2.
You'll want to process files with ID and files without ID with separate commands. Please read How do I process specific files with specific command-line options? and How do I process only specific kinds of files? for details.

e.g. select only files that have an ID12345 pattern in the file name:

Code: Select all

--file-filter "fn.match(/ID(\d{1,9})]/)"
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

I am comfortable with bash scripts so running separate commands for --q is easy work for me.

Now trying to decipher 'filebot -rename' return value (exit status).
0 = ? ( I assume success too)
1 = success
3 = fail (Failed to identify or process any files)

My thoughts are to run another command with a different --db when exit value '3' occurs. TMDB is not always up to date with documentaries and I could script it to try TVDB or even IMDB for a match on failure while maintaining my chosen destination storage path per media type (series or movies etc).

Is there a list of exit codes?
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

0 = SUCCESS
1..99 = ERROR

Code: Select all

int SUCCESS = 0;
int ERROR = 1;
int BAD_LICENSE = 2;
int FAILURE = 3;
int DIE = 4;
int NOOP = 100;

:idea: If you want to try different databases, then I'd try one after another, run filebot if some files are left in the folder, don't run filebot if all files have been moved away already.

:!: If you use --action TEST then FileBot will never process any files and so the status is never 0 = SUCCESS because 0 = SUCCESS requires successful processing of at least 1 file. Notably, 0 = SUCCESS does not indicate that all files have been processed successfully, it merely indicates that some files have been processed.
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

Understood. Now writing a bash script to sequence process the files on fail: tmdb > tvdb > imdb > send to unsorted notify. Also, deploy the --q when available per db.
Can the --filter 'id in csv......' be an array? (i.e "${filter_include_tmdb_LIST[@]}" ) using ';' as a FS?

This ordeal is for documentaries because they are a headache to automate because of naming conventions used. It's as if the documentary posters are alien to standards or geriatrics like myself using a 1990s mindset. I am building it on a Proxmox CT using FlexGet and your great product. Will post it on Github when finished.

Do you have a donation bin or a spirited gift club? Because your assistance is outstanding.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Series - Fix inputs of 1of6 to S01E01

Post by rednoah »

:idea: Note that FileBot does not support IMDB.


:idea: --filter is a Groovy expression that yields either true or false for a given Episode or Movie object. You generally cannot pass bash data structures, because bash will always "flatten" it into a String value since that's the only kind of value that can be passed as command-line argument.


:idea: You could conceivably generate Groovy code and then pass that:

Code: Select all

'A' in ['A', 'B', 'C']

Code: Select all

'A' in 'A;B;C'.split(';')



2elles wrote: 24 Mar 2023, 17:35 Do you have a donation bin or a spirited gift club? Because your assistance is outstanding.
I appreciate the appreciation. You're welcome to buy licenses for a few of your friends if you wanna send some $$$ our ways. :lol:
:idea: Please read the FAQ and How to Request Help.
2elles
Posts: 16
Joined: 25 Oct 2019, 05:24

Re: Series - Fix inputs of 1of6 to S01E01

Post by 2elles »

So close but one issue in episode and movie renaming formats.

Using Filebot format I want to separate the genre 'documentary/news/history/biography' from other standard series paths:
-- Genre (documentary & news only) to "..../video/documentary/series" dir
-- Genre (all others) to "..../video/series" dir

For the series format, I cobbled this together:

Code: Select all

{ if (genre=('Documentary|News')) {'documentary/'}}{ ~plex.id % {" - [$hd $vf $vc $ac $channels $hdr]"} }{'.'+lang.ISO2}

Test Result:
documentary/Top Gear {tvdb-74608}/Season 13/Top Gear - S13E02 - Episode 2
And there lies the problem. Top Gear at TVDB has many genre labels - the first being 'Action' (i.e Action Adventure Comedy Documentary Sport Talk Show Travel). I want to narrow down the match to the first entry Genre[0] or primary genre label only.

Mainstream documentaries seem to have genre entries of only documentary and/or news.

I couldn't find a simple solution in the forum.

Edit:

Also tried this:

Code: Select all

{ genre = /Documentary|News/ ? 'documentary/series/' : 'series/' }{ ~plex.id % {" - [$hd $vf $vc $ac $channels $hdr]"} }{'.'+lang.ISO2}
I read this: viewtopic.php?p=23181#p23181
Which says 'genre' is the first out of many. Then what I am doing wrong?

Edit:

:) Top Gear is filed as a documentary series. Must be the funniest docu series ever produced.

So I settled for this:

Code: Select all

{ genre ==~ /Documentary|News/ ? 'documentary/series' : 'series/' }
Last edited by 2elles on 28 Mar 2023, 14:26, edited 5 times in total.
Post Reply