Where do I find all the documentation?

All about user-defined episode / movie / file name format expressions
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

Please give me the filenames and how to reproduce this issue so I can try it myself and see what's going on.
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

Sent you a PM.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

For reproducing (forgot to include)..
Clear cache, just to be sure.
Start filebot. Click to edit format. Choose to select a file. Pick one of the non-working ones.

As said before, when doing the actual matching process to rename files (not editing format), it works fine. It's only in the binding area that it's being a problem.
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

I see.

So if you open the format editor by double-clicking the "New Name" list item it works? But when opening the format editor via "Edit Format" it doesn't work?

If you double-click a match you can prototype your format with real info/file data.

If you do click "Edit Format" you'll be working default sample info data "Avatar (2009) CD1" and a sample file (if you have set one). The sample info data can only be changed by selecting a sample file that has been tagged with metadata by FileBot.

When in doubt, check the bindings window to see what movie/episode info and file info you're working with.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

Here's a few recommendations for your format:

The colon function takes care of surrounding whitespace, so the replacement must contain surrounding whitespace if you want to keep it:

Code: Select all

n.colon(' - ')
I recommend the [ABCD1234] pattern, because tools like FileBot that deal with CRC32 checksums in the filename expect them to be in brackets:

Code: Select all

.[{crc32}]
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

1. Yes, works there just fine.

2. These are all files that have been processed previously with FileBot.

When I pick a new file to bind, I see if it's using the new file or the file it was already using. I have even let it sit a few minutes just to give it a chance to change.


Thanks, was used to doing ' -' and forgot that it removes a leading and trailing space. Updated it now.

Will there be any noticeable difference in how the files are treated by including the CRC32 inside of brackets?
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

I can't reproduce the issue. Something like this?

1. Start FileBot
2. Click "Edit Format"
3. Click "View Bindings" button (3rd one to the right)
4. Select "Media File"
5. What's happening now? Did "Name" change? What's not working? Which bindings exactly?


Wolfie wrote:Will there be any noticeable difference in how the files are treated by including the CRC32 inside of brackets?
If you use [ABCD1234] then you'll be able to check the CRC32 with FileBot (and other tools) and {crc32} won't need to be calculated every time if it's in the filename.
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

rednoah wrote:I can't reproduce the issue. Something like this?

1. Start FileBot
2. Click "Edit Format"
3. Click "View Bindings" button (3rd one to the right)
4. Select "Media File"
5. What's happening now? Did "Name" change? What's not working? Which bindings exactly?
When I do that, the new file is selected but the bindings remain the same. If I click to use it and then go to change the view the bindings again, it sometimes takes a moment as if it's trying to use the file I chose (which is still selected) before resorting back to the bindings already in use. So the file I last picked remains picked, just the bindings never update/change.

rednoah wrote:
Wolfie wrote:Will there be any noticeable difference in how the files are treated by including the CRC32 inside of brackets?
If you use [ABCD1234] then you'll be able to check the CRC32 with FileBot (and other tools) and {crc32} won't need to be calculated every time if it's in the filename.
Oh wonderful. I already changed it but wanted to know what, if any, true difference it would make. Not having to recalculate the hash each time is a definite winner.
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

Once you select a "Media File" that will definitely change the sample file and all file bindings (e.g. vc, ac, fn, etc). If "Name" doesn't change then the sample info hasn't changed and info bindings (e.g. n, y, id, etc) won't change. If "Name" doesn't change, then "Use Bindings" won't give you new sample data to work with in the sample editor.

In your case, when you click "Use Bindings" it's probably just stuck on cancelling the CRC32 computation for a bit.
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

I had thought about that, which is why I've even waited a few minutes to see if it would make a difference. However, the same files that worked before continue to work near instantly even after doing a -clear-cache.
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

So you're saying:

Binding Dialog shows "Name" = "Spectre (2015)" and shows [n = Specter, y = 2015, etc] but when you click "Use Bindings" it doesn't take and you get the default sample bindings "Avatar (2009)" [n = Avatar, y = 2009, etc] like this? What exactly is not working? What is showing? What should be shown instead?

Please add some screenshots. I have honestly no idea what the problem you're describing might be.
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

No, the 'Media File' field is filled in with the selected file. Everything else (Name: and Preview:) remain unchanged.

Interesting though. Despite the files having been processed through FileBot before, when I tried it on a file that was re-processed, that file loads up fine. Maybe the metadata didn't save on some of the files. Will have to keep an eye on it to see if there is any sort of a pattern.
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

Wolfie wrote:No, the 'Media File' field is filled in with the selected file. Everything else (Name: and Preview:) remain unchanged.
That would be the default behaviour. Since the info object hasn't changed, bindings like n or y won't change. If you scroll down you will find that file bindings like fn or gigabytes will have changed. Changing the sample file path doesn't change the sample info object (unless there is xattr metadata).

e.g.

Code: Select all

$ filebot -script fn:xattr .
Avatar (2009).mp4
	net.filebot.filename: Avatar.mp4
	net.filebot.metadata: {"@type":"net.filebot.web.Movie","year":2009,"imdbId":499549,"tmdbId":19995,"language":"en","id":19995,"name":"Avatar","aliasNames":[]}
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

I'm going to keep an eye on it. The reason I'm doing all this mass changing is the result of realizing that I had copied some files over without running them through filebot (simply had names, no hash or other information). Once that's all done, if I find files that are doing that, I'll let you know. This way, they are certain to have been processed and thus should have the metadata with it.

Of course, now I'm going to have to convert the format expression to the .bat file. But there's some time before I need to take that step, still planning out the juggling of files to make things much simpler to deal with.
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

Wolfie wrote:convert the format expression to the .bat file
@files are the sane way of passing complex arguments: viewtopic.php?f=3&t=3244
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

THAT is a god send! Will definitely make use of that.

Here is my current expression (still tweaking it)...

Code: Select all

...path.../Movies/{def cleanName=n.colon(" - ").validateFileName();A:{any{"_ COLLECTIONS _/".concat(any{MC:{readLines('P:/collections.txt').find{ it =~ imdbid }.after(':').match(/(.*?)(?:[:#\t*]|$)/)}}{collection})+"/${y} - ${cleanName}"}{if (minutes <= 60 && info.runtime.toInteger() < 75) ("_ MINI MOVIES _/${cleanName} (${y})")}{"${az}/${cleanName} (${y})"}+"/${cleanName} (${y})"}}{'.'+certification}{'.'+resolution}{'.'+source}{if (fn.find(/[. ]CD\d+[. ]/)) '.CD'+pi}{'.'+any{minutes+'m'}{info.runtime+(info.runtime.toInteger().toString()==info.runtime ? "m" : '')}}{".[${crc32}]"}
You'll notice I made a slight alteration to the collections readLines. It's to allow me to optionally include comments/notes at the end of a line, in case I want something to remind me of what is included (without actually naming everything). I might decide to break the James Bond listings based on the actor of the main character (and include those who weren't in more than two films). That would give me four lines and I'd know which titles are included. Then could also allow me to rename the collection more easily based on that knowledge.

For the .CD#, have it checking the file to see if it's already included. Sometimes, having a couple of different copies of something gets it trying to do .cd1 and .cd2 when they are individual copies rather than parts to combine. This lets me avoid that happening. Granted, there is a chance of a grouping being misnamed, but I'm confident it will be a rare situation if it happens at all.

Then the time of the video. Came across one where the 'minutes' wasn't working, so added in a backup method along with a fix to the chance of 'runtime' not being simply a value. That lack of a time for the video isn't filebot's fault, it's a DVD structured folder.

I have one more tweak in mind for the 'mini' minute check, but will need to find something to test it on first.

Maybe I'm missing something, but I tried to use .match() on {folder} in an attempt to use the same initial structure (there are currently three library areas due to it being on different drives that aren't part of Storage Spaces yet). However, it gets really mad at me saying that it's not supported (I guess?) to use .match on {folder}. Is that right? Is there a way to follow the same/similar root structure? I see there are ways to pick based on free space or first letter of the title, was hoping there would be a way to keep it on the same path without having to change the start of the line based on which library I'm working on.
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

1.
Wouldn't this be more readable?

Code: Select all

{'1: TEST # COMMENT'.after(':').before('#')}
2.
String.match() is only defined for String objects, but folder will give you a File object, hence:

Code: Select all

{folder.path.match(/.../)}
3.
You will find examples for Sort into drive with the most free space and Sort into multiple drives based on initial letter here:
viewtopic.php?f=5&t=2

But if you just want to keep parts of the original path the something like this will do: e.g. keep the first 3 path components:

Code: Select all

{file[0..2]}
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

1. More readable but more restrictive. Being able to use <tab> or # or even * as a separator gives me options depending on my mood or even usage based on the collection.

2. Something new learned. Thank you again.

3. That helps a great deal more than you know! Awesome!
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Where do I find all the documentation?

Post by rednoah »

before() and after() do expect a regex, so before(/[#*\t]/) is fine. ;)

EDIT:

before() is also great for keeping parts of the path, and maybe even more readable: e.g. {f.path.before('Movies')}
:idea: Please read the FAQ and How to Request Help.
User avatar
Wolfie
Posts: 128
Joined: 27 Oct 2015, 02:59

Re: Where do I find all the documentation?

Post by Wolfie »

You're starting to spoil me dude... Keep it up! :D
Post Reply