Resolving ambiguity

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
MasinAD
Posts: 2
Joined: 24 Dec 2022, 22:10

Resolving ambiguity

Post by MasinAD »

I have a few episodes of season 26 of the classic Doctor Who series. I want to process them with

Code: Select all

[masin@selena Season 26]$ filebot -rename --db TheTVDB --lang German *mkv
Rename episodes using [TheTVDB] with [Airdate]
Lookup via [Doctor Who]
Fetching episode data for [Doctor Who (2005)]
└─ 313 episodes
Fetching episode data for [Doctor Who]
└─ 755 episodes
Fetching episode data for [Doctor Who (2009)]
└─ 16 episodes
Fetching episode data for [Doctor Who Extra]
└─ 27 episodes
Fetching episode data for [Doctor Who: Shada]
└─ 6 episodes
Multiple Options: /home/masin/MediathekView/Doctor Who/Season 26/26e12.mkv: [Doctor Who (2005), Doctor Who, Doctor Who (2009), Doctor Who Extra, Doctor Who: Shada]
Multiple Options: /home/masin/MediathekView/Doctor Who/Season 26/26e13.mkv: [Doctor Who (2005), Doctor Who, Doctor Who (2009), Doctor Who Extra, Doctor Who: Shada]
Multiple Options: /home/masin/MediathekView/Doctor Who/Season 26/26e14.mkv: [Doctor Who (2005), Doctor Who, Doctor Who (2009), Doctor Who Extra, Doctor Who: Shada]
* Consider using -non-strict to enable advanced auto-selection
* Consider using --filter "id in [78804]" or --q "Doctor Who (2005)" to select one specific series
* Consider using --mode interactive to enable interactive mode
Failed to identify or process any files
Failure (×_×)⌒☆
The most straightforward way would be to provide --q "Doctor Who". But: Filebot then resolves this ambiguity using "Doctor Who (2005)" which fails because the titles don't match:

Code: Select all

[masin@selena Season 26]$ filebot -rename --db TheTVDB --lang German --q "Doctor Who" *mkv
Rename episodes using [TheTVDB] with [Airdate]
Lookup via [Doctor Who]
Fetching episode data for [Doctor Who (2005)]
└─ 313 episodes
Episode numbers do not strictly match: Doctor Who (2005) - 1x12 - Böser Wolf (1) <=> /home/masin/MediathekView/Doctor Who/Season 26/26e12.mkv
Episode numbers do not strictly match: Doctor Who (2005) - 1x13 - Getrennte Wege (2) <=> /home/masin/MediathekView/Doctor Who/Season 26/26e13.mkv
Episode numbers do not strictly match: Doctor Who (2005) - Special 14 - Der rote Garten <=> /home/masin/MediathekView/Doctor Who/Season 26/26e14.mkv
* Consider using -non-strict to enable advanced auto-selection
Failed to identify or process any files
Failure (×_×)⌒☆
Using the id in a --filter argument might help but how do I get this id without browsing through TheTVDB? Also using --mode interactive might help but it defeats the purpose of working on the command line if I have to do so much manual labor.

Ideally, it would be great to specify the exact series name as used by the configured db. But how?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Resolving ambiguity

Post by rednoah »

Sample Files:

Code: Select all

/home/masin/MediathekView/Doctor Who/Season 26/26e12.mkv
/home/masin/MediathekView/Doctor Who/Season 26/26e13.mkv
/home/masin/MediathekView/Doctor Who/Season 26/26e14.mkv



Any one of the following options will make filebot work for the given sample files:


Option A: Use -non-strict to enable advanced auto-selection

Code: Select all

-non-strict

Code: Select all

$ filebot -rename -r INPUT --db TheTVDB -non-strict --output OUTPUT --format "{plex.id}" --log INFO --action TEST
[TEST] from [INPUT/Doctor Who/Season 26/26e12.mp4] to [OUTPUT/TV Shows/Doctor Who {tvdb-76107}/Season 26/Doctor Who - S26E12 - Survival.mp4]

Option B: Lookup by ID

Code: Select all

--q 76107

Code: Select all

$ filebot -rename -r INPUT --db TheTVDB --q 76107 --output OUTPUT --format "{plex.id}" --log INFO --action TEST
[TEST] from [INPUT/Doctor Who/Season 26/26e12.mp4] to [OUTPUT/TV Shows/Doctor Who {tvdb-76107}/Season 26/Doctor Who - S26E12 - Survival.mp4]

Option C: Filter by Name

Code: Select all

--filter "n == /Doctor Who/"

Code: Select all

$ filebot -rename -r INPUT --db TheTVDB --filter "n == /Doctor Who/" --output OUTPUT --format "{plex.id}" --log INFO --action TEST
[TEST] from [INPUT/Doctor Who/Season 26/26e12.mp4] to [OUTPUT/TV Shows/Doctor Who {tvdb-76107}/Season 26/Doctor Who - S26E12 - Survival.mp4]



TIP:

You'll want to rename and organize files with the {plex.id} format so that you can reliably re-process your files in the future.
:idea: Please read the FAQ and How to Request Help.
MasinAD
Posts: 2
Joined: 24 Dec 2022, 22:10

[SOLVED] Re: Resolving ambiguity

Post by MasinAD »

Thanks, rednoah, this will help a lot in the future. Unexpectedly, I just should have done it without --q "Doctor Who" but with -non-strict to make it work. Strange that providing more information leads to worse results :-).

Re your tip: I prepare my files for jellyfin and the linked page mentions the manual for the {plex} binding applied equally for the {jellyfin} binding. Would be a good fit, but my filebot doesn't seem to know about it

Code: Select all

[masin@selena Season 26]$ filebot -rename --db TheTVDB -non-strict --format "{jellyfin.id}" --action TEST --log INFO *mkv
groovy.lang.MissingPropertyException: No such property: jellyfin for class: Script1
net.filebot.format.SuppressedThrowables: Expression yields empty value: Binding "jellyfin": No such property
	at net.filebot.format.ExpressionFormat.format(Unknown Source)
	at net.filebot.format.ExpressionFormat.format(Unknown Source)
	at net.filebot.cli.CmdlineOperations.formatMatch(Unknown Source)
	at net.filebot.cli.CmdlineOperations.getRenameMap(Unknown Source)
	at net.filebot.cli.CmdlineOperations.renameSeries(Unknown Source)
	at net.filebot.cli.CmdlineOperations.rename(Unknown Source)
	at net.filebot.cli.ArgumentProcessor.runCommand(Unknown Source)
	at net.filebot.cli.ArgumentProcessor.run(Unknown Source)
	at net.filebot.Main.main(Unknown Source)
Caused by: net.filebot.format.BindingException: Binding "jellyfin": No such property
	at net.filebot.format.ExpressionEngine.evaluateScriptlet(Unknown Source)
	... 9 more
Caused by: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: jellyfin for class: Script1
	... 10 more
Caused by: groovy.lang.MissingPropertyException: No such property: jellyfin for class: Script1
	at Script1.run(Script1.groovy:1)
	... 10 more

Code: Select all

[masin@selena Season 26]$ filebot -version
FileBot 4.9.6 (r9125) / OpenJDK Runtime Environment 11.0.17
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Resolving ambiguity

Post by rednoah »

rednoah wrote: 12 Sep 2016, 10:03 Jellyfin Naming Standard (requires FileBot r9282)

The {jellyfin} binding and the {plex} binding work exactly the same, with slightly different implementation details, e.g. series name and series folder formatting and [tmdb-12345] ID tag formatting.
MasinAD wrote: 25 Dec 2022, 23:40

Code: Select all

$ filebot -version
FileBot 4.9.6 (r9125) / OpenJDK Runtime Environment 11.0.17
{jellyfin} has been added recently and will require the latest revision, or at least FileBot r9282 or higher:
viewtopic.php?t=1609


Please use {emby} instead for the time being. That's almost identical to {jellyfin} except ID markers use {...} instead of [...] but Jellyfin is probably smart enough to work with either pattern.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Resolving ambiguity

Post by rednoah »

MasinAD wrote: 25 Dec 2022, 23:40 Strange that providing more information leads to worse results :-).
That is a very real problem in documentation. We once didn't have enough documentation, so users asked for more. We now have too much, too detailed, too technical, etc, so users don't read it anymore. The latter is better than the former at the very least. :lol:
:idea: Please read the FAQ and How to Request Help.
Post Reply