Conditional formatting looking for same

All about user-defined episode / movie / file name format expressions
Post Reply
datanate
Posts: 3
Joined: 12 Nov 2015, 02:57

Conditional formatting looking for same

Post by datanate »

Hello,
I am new to the board but because I cannot figure this out I am reaching out. I have seen conditional statement posts but I cannot find how to handle this specifically.

I want to name a folder with an expression of Series.Name - Season.X - Year.Resolution.AudioCodec.Container

I have the expression I want for this however for the resolutions of files within the folder:
if resolutions are different say "MIXED"
else show the regular {resolution}


Can anyone help me?
User avatar
rednoah
The Source
Posts: 23027
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional formatting looking for same

Post by rednoah »

1.
So... you'd like filebot to automatically move files that have previously been processed, when moving new files, so that somehow old and new files end up in the same folder?

That is absolutely not supported. You're messing with time, cause and effect, and causality in general. Don't do that! :P


2.
As for conditional statements, that's a completely different, and entirely solvable issue:

Code: Select all

{vf == '1080p' ? 'FULL-HD' : 'SOMETHING-ELSE'}
:idea: Please read the FAQ and How to Request Help.
datanate
Posts: 3
Joined: 12 Nov 2015, 02:57

Re: Conditional formatting looking for same

Post by datanate »

1.
I'd like filebot to just know what I am thinking and magically things happen! Maybe that can be in the next beta. 8-)

2. I need to clarify my naming scheme. I am wanting more extact resolution showing video size. The {resolution} binding specifically.

My current formatting expression is

Code: Select all

{n.upperInitial().space('.')} - {'Season '+s} - {airdate.year}.{resolution}.{ac}.{cf}\{n.upperInitial().space('.')} - ({s00e00.lower()}).{t.upperInitial().space('.').replaceAll(',')} - {airdate.year}.{resolution}.{ac}"
The files will each have the resolution (e.g. "1280x270"). But I have some dvd rips that have different resolutions. I'm not sure who ripped them but I need to have exact resolutions on the file.

Image

So when episodes are not all the same dimensional size I'd like that Folder to Have the {resolution} binding say "mixed". In this case be
America's.Test.Kitchen - Season.5 - 2005.MIXED.MP3.AVI
User avatar
rednoah
The Source
Posts: 23027
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional formatting looking for same

Post by rednoah »

1.
Yep, and once my mindreading AI is working reasonably well, I'll go buy Apple & Google & Facebook with all the investment money I get! Yes... good plan! :lol:

2.
If you rename files one after another then it's impossible. But if it's before you rename any file, when you rename all these files in a single batch, then things get more possible.

FileBot does allow you to access the renaming context (i.e. what you see in the GUI: file/episode matches) so you might make it work with something like this:

Code: Select all

{model.resolution.unique().size > 1 ? 'MIXED' : resolution}
Keep in mind that model.resolution means you're retrieving mediainfo for all files, for each file. So if you have 20 files, it'll mean that mediainfo is called 400 times, and so on, so things will be noticeably slower.

Here's a somewhat related post:
viewtopic.php?f=5&t=3115#p17376
:idea: Please read the FAQ and How to Request Help.
datanate
Posts: 3
Joined: 12 Nov 2015, 02:57

Re: Conditional formatting looking for same

Post by datanate »

Wow. 400x slower. Thinking about what I am trying to do that makes sense. I'm doing this via SSH / CLI. I may need to just rethink my strategy.
Upon more research maybe something like a groovy script would be more advantageous? Something to name the file and then look at the files to name the folder. .... food for thought.

Since I have your attention though => here is a new conundrum (I can make a new thread if you deem it appropriate)

After I rename files (again SSH with CLI), I then make a torrent (using rtorrent). This torrent gets rejected when uploaded to tracker for illegal characters. However this is not the case. When I manually type in the exact same file name string to test - I don't get a rejected torrent file.

Is this somehow tied to text encoding? I renamed within my FTP client (which I believe is using UTF-8) during this test. If you view my above post there are no actual illegal chars. Something is just weird and I am confused.

[*]Details:[*]
SSH into a Debian seedbox. Create torrent in the rutorrent gui for rtorrent (and also same with deluge). The private tracker I am using gave me the idea to manually type the filename which was successful.
User avatar
rednoah
The Source
Posts: 23027
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional formatting looking for same

Post by rednoah »

1.
Only 20x slower, but it's going up exponentially, so having 20 (20x20=400) elements in the list will be much much much faster than having 100 (100x100=10000) elements. I wouldn't worry about this though, until you've actually tried and confirmed this to be a problem.

2.
As long as there's only simple A-Z characters it doesn't even matter what encoding you're using, because binary representation will be the same in most common encodings. It'll make a difference once you have umlauts, accents, and exotic character sets. But FileBot/Java should be using UTF-8 as default filesystem encoding, but that may depend on your system locale settings.
:idea: Please read the FAQ and How to Request Help.
Post Reply