Group issue & using ut_title?

All about user-defined episode / movie / file name format expressions
Post Reply
User avatar
mihawk90
Power User
Posts: 51
Joined: 18 Mar 2014, 00:41

Group issue & using ut_title?

Post by mihawk90 »

Hey there again,

while trying to enhance my naming a little I ran into an issue.

My files for this release are in the format:

Code: Select all

(Hi10)_Code_Geass_-_01_(BD_1080p)_(Coalgirls)_(Dual_Audio)_(DC1BBB7A).mkv
Now Coalgirls is on the list, but it's not picked up for use with {group}. Even just using a simple "{sxe} [{group}]" doesn't work (just to make sure nothing interferes). When I rername one of the files to this for testing:

Code: Select all

(Coalgirls)_Code_Geass_-_01_(BD_1080p)_(Hi10)_(Dual_Audio)_(DC1BBB7A).mkv
This works perfectly fine, so I guess Filebot expects the group at the start of the filename? I thought it was supposed to use whatever group came last :)

It's actually a problem with this particular release-group. Coalgirls is not the release-group in this case, Hi10 is. Hi10anime takes subs from various sources and reworks them for their own release.


And there we are at the second issue already. I'm trying to get an expression to work that looks for "[Hi10" in the passed ut_title (using AMC) and puts it in front of the group, but I can't get it to work.

Using this works fine in the GUI and in the commandline:

Code: Select all

{sxe} [{fn =~ /\(Hi10/ ? 'Hi10 via '+{group} : 'test'}] {episodes*.absolute*.pad(3).join('-')} [{crc32}]
But I would prefer using the ut_title since that is under my control. Using this format doesn't work though:

Code: Select all

{sxe} [{ut.title =~ /\[Hi10/ ? 'Hi10 via '+{group} : 'test'}] {episodes*.absolute*.pad(3).join('-')} [{crc32}]
I thought the ut_ parameters were put into the ut object here: https://github.com/filebot/scripts/blob ... roovy#L116 But apparently I'm off on that :)
I've also tried using "ut_title" and just "title" but neither worked. It doesn't even give me the "test" (which works in the GUI too), so I'm a little lost here. I mean how can the expression be neither true nor false?

It also works perfectly fine in the groovy pad (didn't even know this was a thing until now :) ):

Code: Select all

group = "TestGroup";
ut_title = "Code Geass: Lelouch of the Rebellion [Hi10]";
ut_title =~ /\[Hi10/ ? 'Hi10 via '+group : 'test'
------------------------------------Result-----------------------------------
Result: Hi10 via TestGroup
Complete console output:

Code: Select all

PS C:\Users\tarulia> filebot -script fn:amc --log-file "C:\Users\tarulia\Downloads\BitTorrent\_organized\amc.log" --acti
on test --conflict override -non-strict --filter "s == 1 && e == 1" --def "ut_label=TV_old" "ut_title=Code Geass: Lelouc
h of the Rebellion [Hi10]" "ut_kind=multi" "ut_dir=C:\Users\tarulia\Downloads\BitTorrent\Code Geass- Lelouch of the Rebe
llion" "seriesFormat={sxe} [{ut.title =~ /\[Hi10/ ? 'Hi10 via '+{group} : 'test'}] {episodes*.absolute*.pad(3).join('-')
} [{crc32}]"
Locking C:\Users\tarulia\Downloads\BitTorrent\_organized\amc.log
Run script [fn:amc] at [Fri Dec 09 23:54:55 CET 2016]
Parameter: ut_label = TV_old
Parameter: ut_title = Code Geass: Lelouch of the Rebellion [Hi10]
Parameter: ut_kind = multi
Parameter: ut_dir = C:\Users\tarulia\Downloads\BitTorrent\Code Geass- Lelouch of the Rebellion
Parameter: seriesFormat = {sxe} [{ut.title =~ /\[Hi10/ ? 'Hi10 via '+{group} : 'test'}] {episodes*.absolute*.pad(3).join
('-')} [{crc32}]
Input: C:\Users\tarulia\Downloads\BitTorrent\Code Geass- Lelouch of the Rebellion\(Hi10)_Code_Geass_-_01_(BD_1080p)_(Coa
lgirls)_(Dual_Audio)_(DC1BBB7A) - copy.mkv
Group: [tvs:code geass lelouch of the rebellion] => [(Hi10)_Code_Geass_-_01_(BD_1080p)_(Coalgirls)_(Dual_Audio)_(DC1BBB7
A) - copy.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Code Geass Lelouch of the Rebellion]
Fetching episode data for [Code Geass: Lelouch of the Rebellion]
Apply Filter: {s == 1 && e == 1}
Include [Code Geass: Lelouch of the Rebellion - 1x01 - The Day a New Demon was Born]
[TEST] Rename [C:\Users\tarulia\Downloads\BitTorrent\Code Geass- Lelouch of the Rebellion\(Hi10)_Code_Geass_-_01_(BD_108
0p)_(Coalgirls)_(Dual_Audio)_(DC1BBB7A) - copy.mkv] to [C:\Users\tarulia\Downloads\BitTorrent\Code Geass- Lelouch of the
 Rebellion\1x01 [] 001 [DC1BBB7A].mkv]
Processed 1 files
Done Òâ¥(´╝áÔîÆÒâ╝ÔîÆ´╝á)ÒâÄ
PS: I had a little issue when I forgot to escape the opening bracket of "[Hi10". The GUI would tell me "Suppressed: Unclosed group near index 4[Hi10 ^", but the command line didn't give me any hint on that. Just throwing that out there :)
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Group issue & using ut_title?

Post by rednoah »

1.
Looks like {group} will only match group names at the beginning or at the end of the filename nowadays. This seemed like a reasonable compromise to eliminate false positives.


2.
Hi10 cannot be considered as a group name because it's already blacklisted as format tag (such as AVC, AC3, etc).


3.
Scripts and format expressions use the same language, but they don't magically share the same runtime context or variables. You can access the --def parameters via the {defines} binding in the format.


4.
Never prototype formats on the command-line. Individual {expressions} within formats are supposed to return a value or fail depending on the data at hand. Only the GUI Format Editor will print warning messages which may (or may not indicate) that something isn't working as expected.

If you just want to check for a literal substring match, then you don't need to use regular expressions:

Code: Select all

"[Hi10] Hello World".contains('[Hi10]')
Unclosed group near index sounds like the regular expression is bad, so you can either brush up on your regex skills, or avoid regex altogether. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
mihawk90
Power User
Posts: 51
Joined: 18 Mar 2014, 00:41

Re: Group issue & using ut_title?

Post by mihawk90 »

1.
Is there any way to force searching for the group anywhere in the file-name, risking false positives on my own account?
/edit also, just testet a little. Group is found in Filebot 4.6.1, but 4.7 and following it doesn't work anymore (just saying even though it is technically working as intended)
/edit2 Actually... I can't even rename my already done episodes anymore :( I just noticed while I was fiddling around with a new expression. The group being Hatsuyuki, which is on the list too, Filepath is

Code: Select all

C:\Volumes\NAS 1-2 1TB\Videos\Anime\subbed\Naruto Shippuuden\18x14 [Hatsuyuki] 407 [13A6850E].mkv
2.
That's totally fine and understandable, and I didn't want to use Hi10 as the group anyway (I'd rather have the "real" group in there) :)

3.
Will try that out when I get home. I was thinking it would be available because "label" just worked out of the box. But then again I also saw "label" was re-defined in the AMC script anyway.
/edit as expected, works perfectly fine with defines.ut_title :) Thanks!

4.
Yeah, well, problem was that that specific parameter was only passed to the command-line in the first place. Will just use a string instead next time :)

5
About the unclosed group. I was intentionally only matching the opening bracket (as a part of the string), not a regex-group, so this was correct. I just forgot to escape the bracket hence why it was considered part of the regex. Will try the contain when I get home too. Reason being that sometimes Hi10 makes slight edits to the subs, in which case they are using Hi10-originalgroup as the group tag.
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Group issue & using ut_title?

Post by rednoah »

1.
Yes, it won't work unless the group name is either the first or the last word. If more people complain about the new behaviour, I may revert to how it worked originally.

But, do any groups actually name their release files like you do? Is there any source of anime where the group name isn't the first or last token in the filename? Because {group} will also grab the group name from the original filename (if stored in xattr) so for most (?) it'll just work even if the custom format puts the group name in a strange location (because FileBot will match it from the original name).
:idea: Please read the FAQ and How to Request Help.
User avatar
mihawk90
Power User
Posts: 51
Joined: 18 Mar 2014, 00:41

Re: Group issue & using ut_title?

Post by mihawk90 »

Mh, Hi10 releases aside I don't know, tbh I'm not following a whole lot of anime series so I can't say. The filename I posted above is their actual release-format, the Hatsuyuki thing was just a test to see if it would work.

The thing with xattr is it only works on unixoid systems as I understand, I think MS has a similar implementation in NTFS now but it doesn't appear to be working for me (the storage PC is currently running on Windows but I'm planning to install Linux soon-ish™, still waiting for a few BTRFS features). And even if it did it wouldn't be saved there since the group isn't recognized in the first place.

But anyway a force flag might be a useful thing if it's not too hard to implement and/or you get the time (I can still just use old versions if I REALLY need it for now), in case anyone ever runs into a similar issue (the old code is still in the repo I guess :) )


By the way, random thought unrelated to this, is Filebot caching which groups it detected most often so it doesn't have to go through the whole list everytime?
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Group issue & using ut_title?

Post by rednoah »

Haha, don't worry about regex performance. It's very very negligible, especially on a modern JVM. :D

Extended Attributes should work very well on Windows with NTFS drives. Even with SMB Network shares it mostly works (depending on the SMB implementation).
:idea: Please read the FAQ and How to Request Help.
User avatar
mihawk90
Power User
Posts: 51
Joined: 18 Mar 2014, 00:41

Re: Group issue & using ut_title?

Post by mihawk90 »

I guess it just doesn't work because a lot of the files (but I really can't remember which one) I processed back when I was still using my old unused macbook as my "fileserver" with the NFTS-3G (G3? idk) driver which probably didn't have it implemented at the time. Was never really an issue until now though since it always worked (I didn't update filebot for a long time). But yeah, if I really need the old behaviour back for some reason I can still just use an old version for now :)

Thanks for the hints as always though :)
Post Reply