Weird string...

Support for macOS users
Post Reply
misullivan
Posts: 11
Joined: 03 Apr 2020, 09:58

Weird string...

Post by misullivan »

Haven't used FB for a while - i'm gussing it got updated automatically via the App Store [Version 5.1.3 (10185)].... however this just happened:

Movie Mode part of a long format string:
...

Format: Select all

[{hd.replace(/HD/, vf)+"-"}
...

Gave the result:

[F1080p-

Where it used to give [1080p-

I fixed it with:

Format: Select all

[{hd.replace(/HD/, vf).replace(/F1080/, "1080")+"-"}
... but is this something new or...?

Best regards,

Michelle
User avatar
rednoah
The Source
Posts: 23343
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Weird string...

Post by rednoah »

:?: What exactly is your format trying to do in a weird roundabout way?

:?: If you want {vf} then why not just use {vf}? {vf} will give you 1080p in this case, i.e. the value you seemingly want.

:?: If you want {vf} in certain conditions only then why not use conditions?



:idea: Perhaps you're trying to achieve something like this? SD for 240p, 360p, and below, but 720p for 720p, 1080p for 1080p, and so on:

Format: Select all

{ hd == 'SD' ? 'SD' : vf }


:idea: {hd} is more specific in newer versions, e.g. if {hd} yields FHD and your code replaces HD for some reason, then the leading F remains unchanged:
rednoah wrote: 18 Feb 2023, 03:41 • Enhanced {hd} with support for additional HD resolutions (i.e. UHD / QHD / FHD / HD / SD)
:idea: Please read the FAQ and How to Request Help.
misullivan
Posts: 11
Joined: 03 Apr 2020, 09:58

Re: Weird string...

Post by misullivan »

Ahh ok .. the 'FHD' now makes sense why this was happening..

This format string was from way back when I first started using FB... slightly modified as I went along, and yes the answer is now:

Format: Select all

{ hd == 'SD' ? 'SD' : vf }
That's exactly what I want.

Thanks again for an awesome product.

PS: For a feature request if it's not already implemented (not checked yet)... command line loadable format string file(s) where the Movie/Episode/Music/etc selector will automatically choose the correct format from your loaded config file.

Also the 'Validate' seems to knock out all ':' (colons) in the path and filename.. I would rather have them removed from the path but not the filename.. anyway to select that or maybe configurable to a regex (eg: ':' -> ' -' so 'Star Trek: Picard' becomes 'Star Trek - Picard')
User avatar
rednoah
The Source
Posts: 23343
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Weird string...

Post by rednoah »

misullivan wrote: 29 Jul 2024, 10:26 PS: For a feature request if it's not already implemented (not checked yet)... command line loadable format string file(s) where the Movie/Episode/Music/etc selector will automatically choose the correct format from your loaded config file.
That is what the amc script does, though if you must use simple filebot -rename call then you can write a single format that works for Movie/Episode/Music/etc all at the same time.



misullivan wrote: 29 Jul 2024, 10:26 Also the 'Validate' seems to knock out all ':' (colons) in the path and filename.. I would rather have them removed from the path but not the filename.. anyway to select that or maybe configurable to a regex (eg: ':' -> ' -' so 'Star Trek: Picard' becomes 'Star Trek - Picard')
You can choose to do so in your custom format. Your custom format generates the file path you want. See Replace : colon with - dash for details and examples.



:!: If you are using Windows, then you cannot have : colon in the file name / folder name / anywhere except the X: drive letter prefix. If you are using macOS, then things are even more complicated, so it's best to stick to universally valid file paths. See Target Unix Filesystem for details.
:idea: Please read the FAQ and How to Request Help.
misullivan
Posts: 11
Joined: 03 Apr 2020, 09:58

Re: Weird string...

Post by misullivan »

You can choose to do so in your custom format. Your custom format generates the file path you want. See Replace : colon with - dash for details and examples.
Yeah I wasn't thinking generally, was thinking as a custom action to 'Validate'... but of course you're right... (FYI... : works in OSX with \ escaping.. also works over most network shares.. at least here it does.)
misullivan
Posts: 11
Joined: 03 Apr 2020, 09:58

Re: Weird string...

Post by misullivan »

FYI: amc looks cool... not sure it will work for me (pretty sure it won't .. but that's because I'm a pain in the butt)
Post Reply