TV Shows trying replace certain abbreviated names

Support for Windows users
Post Reply
FxProgrm
Posts: 2
Joined: 17 Sep 2023, 18:27

TV Shows trying replace certain abbreviated names

Post by FxProgrm »

Thanks for a great tool, definitely helps move things along quicker.

I am not sure exactly which release I had been using before this issue came up.

I have the following expression that had been working to replace abbreviated titles to
their full name, but seems to have stopped working. IE: Sct -> Secret -- Scts -> Secrets -- Brnds -> Brands

Format: Select all

{n.replaceAll(/[*]/,'').replace(':':' -','\'':'',',':'','!':'','?':'','&':'and','ô':'o','Sct':'Secret','Scts':'Secrets','Assembld':'Assembled','Brnds':'Brands')} {s00e00} - {t.replaceAll(/[*]/,'').replace(';':'','\'':'',',':'','.':'','?':'','!':'','&':'and','’':'\'','é':'e',':':' -','*':'$','•':'','ô':'o','ñ':'n')}
Example Names:

Code: Select all

Sct.Celebrity.Renovation.S03E06.mkv
Marvel.Studios.Assembld.S02E02.mkv
The.Mega-Brnds.That.Built.America.S01E02.mkv

Code: Select all

FileBot 5.0.3 (r9760)
JNA Native: 6.1.4
MediaInfo: 22.12
7-Zip-JBinding: 16.02
Tools: fpcalc/1.5.0
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2023-09-10 (r939)
Groovy: 4.0.11
JRE: OpenJDK Runtime Environment 17.0.6
JVM: OpenJDK 64-Bit Server VM
CPU/MEM: 12 Core / 4.3 GB Max Memory / 175 MB Used Memory
OS: Windows 10 (amd64)
STORAGE: NTFS [OS] @ 573 GB | NTFS [Games] @ 261 GB
Package: MSI
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TV Shows trying replace certain abbreviated names

Post by rednoah »

In Episode Mode, {n} is the series name, and not the file name, i.e. since {n} is Secret Celebrity Renovation there is no "Sct" to replace.


:idea: The code itself would work if {n} were to be an abbreviated name:

Format: Select all

{ "Sct.Celebrity.Renovation".replace('Sct':'Secret','Scts':'Secrets','Assembld':'Assembled','Brnds':'Brands') }

Code: Select all

Secret.Celebrity.Renovation




:?: Are trying to improve series search and lookup? A custom Episode format conceptually cannot help you there.


:idea: Your custom format is used to format Episode matches that FileBot has already found, and notably does not in any way shape or form describe the file paths you have, and thus has no effect on FileBot finding the right Episode matches in the first place.


:idea: You could use Plain File Mode to rewrite file paths ahead of time though, and then process them normally in Episode mode.
:idea: Please read the FAQ and How to Request Help.
FxProgrm
Posts: 2
Joined: 17 Sep 2023, 18:27

Re: TV Shows trying replace certain abbreviated names

Post by FxProgrm »

Thanks for the quick reply. The intent was to replace the shortened series name so that it would match when using TheTVDB for episodes matching Airdate and Static or Opportunistic options.

My sample was not relaying the full filename
Sct.Celebrity.Renovation.S03E06.1080p.WEB.h264-EDITH.mkv

When attempting to match I get "Celebrity (2023) S01E06 - #sorrynotsorry #life_is_unfair" as a red match.
Screenshot

Thanks.
User avatar
rednoah
The Source
Posts: 23002
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: TV Shows trying replace certain abbreviated names

Post by rednoah »

FxProgrm wrote: 18 Sep 2023, 04:12 Thanks for the quick reply. The intent was to replace the shortened series name so that it would match when using TheTVDB for episodes matching Airdate and Static or Opportunistic options.
Episode Mode cannot match the file at hand. There is nothing you can do about it. Your custom format code has no effect on matching. The red highlighting means that FileBot thinks that the match might be wrong, which is the correct assessment in this case.


:arrow: One option is manually entering the correct series name. Please read Q: How do I fix misidentified files? for details.


:arrow: Another option is pre-renaming files, either manually, or automatically using Plain File Mode using your custom replacements, and then using Episode Mode on the now better-named files in a second step.
:idea: Please read the FAQ and How to Request Help.
Post Reply