Change : to -
Change : to -
Hello;
Since I use Filebot (many years ago now) I think something should be changed and I write it only now.
When we rename files from Movie DB, some name are labelled with [:] (ie https://i.imgur.com/SAbXSRp.png )
But on windows, a name with [:] is not a valid name so Filebot ask to remove those [:] ( https://i.imgur.com/0vD8Mvx.png )
The problem is I should rename them after Filebot run and add a [-] instead of the double [space] that Filebot created when he had deleted the [:]
Is it possible to patch Filebot to not remove [:] but write [-] instead ?
Regards
Since I use Filebot (many years ago now) I think something should be changed and I write it only now.
When we rename files from Movie DB, some name are labelled with [:] (ie https://i.imgur.com/SAbXSRp.png )
But on windows, a name with [:] is not a valid name so Filebot ask to remove those [:] ( https://i.imgur.com/0vD8Mvx.png )
The problem is I should rename them after Filebot run and add a [-] instead of the double [space] that Filebot created when he had deleted the [:]
Is it possible to patch Filebot to not remove [:] but write [-] instead ?
Regards
Re: Change : to -

The {plex} binding will do that implicitly:
Code: Select all
{plex}

If you have your own custom format, then I recommend using the String.colon(String replacement) convenience method:
Code: Select all
{n.colon(' - ')}
Re: Change : to -
The format that I use is simple: {n} ({y})
Will try {n.colon(' - ')} ({y}) tomorrow.
Thank you.
Will try {n.colon(' - ')} ({y}) tomorrow.
Thank you.
Re: Change : to -
I recommend using the {plex} format, since that'll implicitly take care of all of all the corner cases, not just the colon : replacement.
e.g. absolute plex path:
e.g. plex file name:
e.g. absolute plex path:
Code: Select all
X:/Media/{plex}
Code: Select all
{plex.name}
Re: Change : to -
cortx, here's the format I use for my movies...
I'll explain some of it:
I use "P:" drive as my Plex drive, and have Junction points to folders on other drives linked in the root of "P:"
A couple of examples of root movie folders are "P:\_01\Movies" and "P:\_02\Movies." The folders "_01" and "_02" are the junction points I was talking about, and they lead to a folder named "MEDIA" on the root of other drives. The list of two digit numbers you see "01|02|03|etc" are valid junctions that can be used.
The part that should be of particular interest to you is this:
rednoah told me about that little gem a couple of years back. '.validateFileName()' will take the filename and make sure it's valid by stripping (or replacing?) any illegal character for the file system in use. As you can see, I'm also using the '.colon()' option to change colons to something more appropriate, but even without it, it wouldn't cause an issue.
If you decide to give the above code a try, then if you have a static root path that you pass along to filebot when calling on it, be sure to change the last line to this:If you don't, then it will include a drive letter as part of the structure, causing issues. Either supply it via parameter to filebot, or via format, but not both.
Code: Select all
{
def vol="P", drive="01", drives="01|02|03|04|05|35|43|44"
def releaseType='', replaceFinds="CGI", collectionsFolder="_", collectionsFile="P:/collections.txt", alt="wolf"
def year=y, name=n.removeAll(/\s*\(\d{4}\)$/).colon(' - ').validateFileName(), group=any{group}{any{original}{fn}.match(/(?:-)([a-z\d]{1,15})$/)}{}
def sub=any{"${collectionsFolder}/${any{readLines(collectionsFile).find{it=~imdbid}.after(':').before(/[:#\t*]/)}{collection}.replaceAll(/(\s(${replaceFinds})\s)/,' ').colon(" - ").validateFileName()}"}{}
def root="${vol}:\\_${any{file.path.match(/(?<=^${vol}:?(\\dev)?\\_)(${drives})(?=\\)/)}{drive}}${any{file.path.match(/(\/${alt}\//)}{'/'}}"
def releaseInfo(text) { return text.removeAll(/(${text.stripReleaseInfo().replaceAll(/ /,'.+')})[.)]*/).removeAll(/(^|\.)\[?[\da-f]{8}\]?/) }
def release=allOf{allOf{source.upper()}{vf}{hd}{vc.match(/(hevc|[xh]\.?26\d)/).replaceAll(/[xh]\.?265/,'HEVC')}{bitdepth+"bit"}{ac}.join('.')}{group}.join('-')
def releases=[file:releaseInfo(fn), original:any{releaseInfo(original)}{}]
def part=any{fn.lower().find(/(?<=[. ](part|cd)[. ]?)\d+(?=[. ]|$)/)}{original.lower().find(/(?<=[. ](part|cd)[. ]?)\d+(?=[. ]|$)/)}
def path=[
movie: "MOVIES",
sub: any{sub}{az}{n.match(/^(?:the|a )?.*?([\da-z])/).replaceAll(/\d/,"0-9")},
folder: (sub?"${year} - ${name}":"${name} (${year})"),
file: allOf{allOf{"${name} (${year})"}{any{releases[releaseType]}{release}}{"(CD".concat(part)+")"}{"[${crc32}]"}{"CD".concat(part)}.join('.')}{subt}.join()
]
return allOf{root}{path.values().join('/')}.join('/')
}
I use "P:" drive as my Plex drive, and have Junction points to folders on other drives linked in the root of "P:"
A couple of examples of root movie folders are "P:\_01\Movies" and "P:\_02\Movies." The folders "_01" and "_02" are the junction points I was talking about, and they lead to a folder named "MEDIA" on the root of other drives. The list of two digit numbers you see "01|02|03|etc" are valid junctions that can be used.
The part that should be of particular interest to you is this:
Code: Select all
name=n.removeAll(/\s*\(\d{4}\)$/).colon(' - ').validateFileName()
If you decide to give the above code a try, then if you have a static root path that you pass along to filebot when calling on it, be sure to change the last line to this:
Code: Select all
return {path.values().join('/')}
Re: Change : to -
Hey Rednoah,rednoah wrote: ↑18 Aug 2019, 05:38 I recommend using the {plex} format, since that'll implicitly take care of all of all the corner cases, not just the colon : replacement.
e.g. absolute plex path:e.g. plex file name:Code: Select all
X:/Media/{plex}
Code: Select all
{plex.name}
I'm just starting to know the system behind the Filebot renaming but when I use the {plex.name} code, my subtitles get the .eng addition to their name which causes it to not work in VLC anymore.
For example, now I'm using this string:
Code: Select all
{plex.name} [{genre}, {director}, {vf}]/{plex.name} [{genre}, {director}, {vf}]
Code: Select all
Bad Boys (1995).eng [Action, Michael Bay, 1080p]/Bad Boys (1995).eng [Action, Michael Bay, 1080p]
Thx in advance!
Re: Change : to -
Try this:Bexorcist wrote: ↑20 Dec 2020, 17:01This gives me the following result for the SRT file of a movie:Code: Select all
{plex.name} [{genre}, {director}, {vf}]/{plex.name} [{genre}, {director}, {vf}]
Is there a way to get rid of the '.eng' part or to get it to show in the end so it will work with VLC?Code: Select all
Bad Boys (1995).eng [Action, Michael Bay, 1080p]/Bad Boys (1995).eng [Action, Michael Bay, 1080p]
Code: Select all
{ny} [{genre}, {director}, {vf}]/{plex.name} [{genre}, {director}, {vf}][subt]
Re: Change : to -
{plex} will include the language suffix, so you can't use {plex} if you don't want the language suffix.
Not using {lang} or {subt} in your custom format will do the trick:

Code: Select all
Movies/{ny}/{ny}
Re: Change : to -
[/quote]
Try this:
[/quote]
This gives me the following result:
Not really what I'm after. 
Main reason I want to use the Plex.name is to get the colon (:) replaced.
Try this:
Code: Select all
{ny} [{genre}, {director}, {vf}]/{plex.name} [{genre}, {director}, {vf}][subt]
This gives me the following result:
Code: Select all
Bad Boys (1995) [Action, Michael Bay, 1080p]/Bad Boys (1995).eng [Action, Michael Bay, 1080p][subt]

Main reason I want to use the Plex.name is to get the colon (:) replaced.
Yeah, but that would not get rid of the colon (:) issues, would it? Main reason I want to use the Plex.name is to get the colon (:) replaced. If I could get the .eng at the end it would work though.rednoah wrote: ↑21 Dec 2020, 02:34 {plex} will include the language suffix, so you can't use {plex} if you don't want the language suffix.
Not using {lang} or {subt} in your custom format will do the trick:
Code: Select all
Movies/{ny}/{ny}
Re: Change : to -
e.g. DIY
Code: Select all
ny.colon(/ - /)
Re: Change : to -
OK, Thx a lot. Isn't there a way to use {plex.name} and get the language indicator as the extension? I managed to do so with the series renaming.
Re: Change : to -
{plex} will indeed add the language indicator by default to the end of the file path, so what you're asking for seems to be the default behaviour.
Re: Change : to -
Well, with subs the .eng is placed in the middles (see example). Problem is with my formula the parent folder is changed with the language indication as well.
I'm still having a problem though. When renaming movies/series on other HDD's my renamed files/folders are moved every time. Isn't there a way to command the software to just rename the parent folder instead of moving it or creating it somewhere else?
Re: Change : to -
1.
plex.derive() can be used to insert additional information after the file name but before the subtitle language suffix and file extension.
2.
e.g.
3.
If you follow the {plex} format examples, then this will work out-of-the-box:
Code: Select all
{plex.derive{" by $director"}{" [$vf, $vc, $ac]"}.name}

2.
However, the {plex} format is indeed ill-suited if you need to customize every single level of the file path. If you want custom folder naming, then custom code is the easiest way to do it.
e.g.
Code: Select all
X:/Movies/
{ny.colon(/ - /)} {allOf{genre}{director}{vf}}
/
{ny.colon(/ - /)} {allOf{genre}{director}{vf}}
{subt}
3.
That's not possible for various reasons discussed at length in other threads. The gist is to organize files into a new pristine folder structure.
Re: Change : to -
My fault, I used [ ] instead of { }.Bexorcist wrote: ↑21 Dec 2020, 08:18This gives me the following result:Try this:Code: Select all
{ny} [{genre}, {director}, {vf}]/{plex.name} [{genre}, {director}, {vf}][subt]
Code: Select all
Bad Boys (1995) [Action, Michael Bay, 1080p]/Bad Boys (1995).eng [Action, Michael Bay, 1080p][subt]
Code: Select all
{ny} [{genre}, {director}, {vf}]/{plex.name} [{genre}, {director}, {vf}]{subt}
Though to be honest, if you're using Plex (you should if you aren't), it's unnecessary to do all that. For the most part, my movies are named with the name of the movie, the year, a few technical specs, and the CRC32 hash (used not only to test integrity, but also prevent naming conflicts).
Code: Select all
Example format: Bad Boys (1995).BLURAY.2160p.UHD.HDR10.HEVC.10bit.AAC-Tigole.[6C78E0B7].mkv