Adding "three spaces" and a (1080p) after every filename

All about user-defined episode / movie format expressions
Post Reply
Fussifuss
Posts: 4
Joined: 07 May 2020, 16:46

Adding "three spaces" and a (1080p) after every filename

Post by Fussifuss »

Hello, i'm new to FileBot and the forum (purchased a lifetime license) today and have some questions regarding the file name format i use for my TV-Series collection since years.
From what i have figured out, the following code comes close to what i use in my TV-Series collection:

Code: Select all

{n.upperInitial()} - {'S'+s.pad(2)} E{e.pad(2)} - {t.upperInitial()}
It gives me:
The Series Name - S01 E02 - The Episode Name.mkv

There are just a few things missing that i can't find the solution for. And since i'm not familiar with Java coding at all, the learning curve is slippery steep :-D
I want the file name to be like this:
The Series Name - S01 E02 - The Episode Name"three spaces"(1080p).mkv

I ALWAYS put three "spaces" between the last letter of an episode name and the (1080p) or (720p), but i can't figure out the code to realize this.
There is no need to get the (1080p) or (720p) from the videos resolution with an automated routine and i would prefer to change it manually in the code when needed.
I have 95% in 1080p anyway.

I have furthermore no needs for a custom file path, since i'm pushing the renamed files through MKVToolNix to edit/name the video, sound and subtitle files after codec, format, bitrate and stuff in the video container.
I do save my TV-series to external USB HDD's, so there are no RAID-Servers or NAS devices involved (if someone's worried about the "three spaces" causing problems with SQL databases and Linux servers.

I really hope there is a solution to this.
FileBot seems extremely powerful in its abilities.
Awesome program (which i have yet only discovered like 2% of the possibilities it provides).

Thanks in Advance :-)

My OS is: macOS Mojave 10.14.6
System Disk format: APFS , journaled, case sensitive
USB Disks format: HFS+, journaled, case sensitive
FileBot Version: 4.9.1 (7372)
Database: TheTVDB
Preferences Matchmode: Opportunistic
Using the GUI
Alcohol doesn't solve problems, neither does milk.
kim
Power User
Posts: 1027
Joined: 15 May 2014, 16:17

Re: Adding "three spaces" and a (1080p) after every filename

Post by kim »

something like this

Code: Select all

{n.upperInitial()}{' - S' + s.pad(2)}{' E' + e.pad(2)}{' - ' + t.upperInitial()}{'   ('+ fn.match(/1080p|720p/) + ')'}
Fussifuss
Posts: 4
Joined: 07 May 2020, 16:46

Re: Adding "three spaces" and a (1080p) after every filename

Post by Fussifuss »

kim wrote: 07 May 2020, 19:15 something like this

Code: Select all

{n.upperInitial()}{' - S' + s.pad(2)}{' E' + e.pad(2)}{' - ' + t.upperInitial()}{'   ('+ fn.match(/1080p|720p/) + ')'}
I copypasted your code and it didn't do any changes.
It says: "Pattern not found"
So it's still on:
The Series Name - S01 E02 - The Episode Name.mkv
Alcohol doesn't solve problems, neither does milk.
User avatar
rednoah
The Source
Posts: 19015
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding "three spaces" and a (1080p) after every filename

Post by rednoah »

FileBot will strip away any sequence of space-like characters and replace them with a single space character irregardless of what your code produces. It's therefore not possible to add three spaces.
:idea: Please read the FAQ and How to Request Help.
Fussifuss
Posts: 4
Joined: 07 May 2020, 16:46

Re: Adding "three spaces" and a (1080p) after every filename

Post by Fussifuss »

rednoah wrote: 07 May 2020, 19:56 FileBot will strip away any sequence of space-like characters and replace them with a single space character irregardless of what your code produces. It's therefore not possible to add three spaces.
OK, i see.
But it doesn't either give me the " (1080p)" at the end with a single "space" character between the last letter of an episode name and the (1080p).
As i said, i don't need this (1080p) or (720p) to be automatically changed if i chose a video with a certain resolution. I would rather prefer it as a default file name that adds to every file i rename regardless of the resolution.
Like:
The Series Name - S01 E02 - The Episode Name (1080p).mkv

If i run into a 720p file/season, i would like to change it manually or use the saved pattern to match the resolution of the video.
Like:
The Series Name - S01 E02 - The Episode Name (720p).mkv

I would like to add this " (1080p)" to the code line i found working for me (if this is possible)?

Code: Select all

{n.upperInitial()} - {'S'+s.pad(2)} E{e.pad(2)} - {t.upperInitial()}
Is there a way to do this?
Alcohol doesn't solve problems, neither does milk.
User avatar
rednoah
The Source
Posts: 19015
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding "three spaces" and a (1080p) after every filename

Post by rednoah »

e.g.

Code: Select all

{n.upperInitial()} - {'S'+s.pad(2)} E{e.pad(2)} - {t.upperInitial()} (1080p)
:idea: Please read the FAQ and How to Request Help.
Fussifuss
Posts: 4
Joined: 07 May 2020, 16:46

Re: Adding "three spaces" and a (1080p) after every filename

Post by Fussifuss »

rednoah wrote: 07 May 2020, 20:24 e.g.

Code: Select all

{n.upperInitial()} - {'S'+s.pad(2)} E{e.pad(2)} - {t.upperInitial()} (1080p)
Wow, THANK YOU VERY MUCH !!!
It did work.
The thing is, that i tried this exact addition but it didn't give me any positive results earlier. That's the reason i opened a thread here.
I maybe forgot to apply the new code or did a wrong procedure. Who knows.
Thanks for the help and the quick response. I appreciate this very much.
I love it, when devs care about their projects as you do.
Surfed the forum since hours before i even registered and found you to be really caring and helping out with the issues and questions people have.
This is rare and precious. Kudos!!!
Alcohol doesn't solve problems, neither does milk.
User avatar
rednoah
The Source
Posts: 19015
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding "three spaces" and a (1080p) after every filename

Post by rednoah »

Fussifuss wrote: 07 May 2020, 20:35 I love it, when devs care about their projects as you do.
Surfed the forum since hours before i even registered and found you to be really caring and helping out with the issues and questions people have.
This is rare and precious. Kudos!!!
Cheers~ I'd appreciate a more professionally interesting question for next time though~ :lol:
:idea: Please read the FAQ and How to Request Help.
Post Reply