Restore multi-episode match from xattr

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

Re: Restore multi-episode match from xattr

Post by rednoah »

HellPhantom wrote: 30 Nov 2021, 11:25 So I can copy flash to spy vs spy folder on J: along with its hidden xatrr folder and it no longer works. Total commander which a use to manage storage notifies me of the total name being longer than 259 it is actually 272 but this is not the actual episode that is to long but the xattr files inside the hidden .xattr folder that exceeds the limit.

Image
All bets are off once anything other than Windows Explorer is used to manage files. The 260 file path limit shouldn't be an issue since Windows 10 2016-ish and so long paths should work out-of-the-box with most tools nowadays. Still can't have individual nodes with file names or folder names longer than 260 chars though.
https://docs.microsoft.com/en-us/window ... -and-later



HellPhantom wrote: 30 Nov 2021, 11:31 When I add run those config lines in the F5 Groovy pad is it permanently configured or only for that session.?
The command above is a CMD command. You'd close FileBot, then open CMD, then run the command, which in turn writes the configuration file, and then start FileBot which now starts up with the newly updated configuration file. Presumably (though completely untested) if run from within a running instance of FileBot, then the script will run and write the configuration file, but that will have no effect on the currently running FileBot instance, until you restart it.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Restore multi-episode match from xattr

Post by rednoah »

HellPhantom wrote: 30 Nov 2021, 12:31 if I manually rename a file I also have to remember to manually rename its xattr counterpart folder name inside the hidden .xattr folder at the very least for .xattr data to stay intact
Exactly that. Native file system xattr can be finicky, but at least they live and move and die with the "parent" file, automatically and guaranteed by the file system itself.
:idea: Please read the FAQ and How to Request Help.
HellPhantom
Posts: 49
Joined: 15 Apr 2020, 10:45

Re: Restore multi-episode match from xattr

Post by HellPhantom »

This still relates to me renaming or reworking existing movies / tv shows.

Probably just another shortcut I don't know.
So I am ending with quite a few entries not containing xattr data which is fine, so I can press F2 to get info from filename but some existing filenames it might be missing info from mediainfo.
My problem here and in some other scenario's are that I would like to add or refresh the mediainfo that is missing or outdated from those filenames and not re-match them.
The media info is nicely displayed in the tab under Filer similar to where xattr info exist.

Isn't there a nice hotkey when files are dropped in where you just press F4 and only mediainfo is read and applied ontop of what you have say after you pressed F3 or F2. This would be very nice for skipping re-matching and working or updating existing files that might have been changed (converted etc).

Ps. in your current hotkey's F4 has not been used yet (viewtopic.php?t=12703) This would be the perfect use :-)
HellPhantom
Posts: 49
Joined: 15 Apr 2020, 10:45

Re: Restore multi-episode match from xattr

Post by HellPhantom »

I am doing this alot.

Some conversion work especially on tv episodes I do later, like dropping subtitles, or unused languages, and when I add custom episodes that do not exist anywhere or be matched I have to always match it with the wrong episode to get the media info into my filename and then afterwards rename the file again.

Now I could press F2 get my info and Press say F4 to apply MediaInfo. My custom files would also contain MetaData applied with MP3Tag but I don't know if those can be read.
HellPhantom
Posts: 49
Joined: 15 Apr 2020, 10:45

Re: Restore multi-episode match from xattr

Post by HellPhantom »

I have always subtracted the length of the fullnames (path+filename and extra mediainfo and bits I add to filename excluding episode description) from 259 and what ever was left I assigned to the tv episodes description part and prevented it from exceeding 259 length so it plays nice with programs that can't handle longer filenames like plex.

I have only subtracted this bit ':net.filebot.metadata' an extra 21 of my available length equation and I can now successfully embed the xattr data into any filename I have tested so far without it giving an error because of the length.

I saw in the error it was added to the end after it says it can't find the file and it is exactly that extra length on top of what I had that made it fail.
WARNING: Failed to set xattr: No Such File: J:\Multimedia\TV\Spy vs. Spy (2010){tvdb-199861}\Season 04\Spy vs. Spy - S04E01_25 - Mixed Martial Arts & Igloo & Easter Egg Hunt & House Cannon & Wall Door & White Spy's Smart Pho (2013-04-01).[720p.x264.0.380Kbps].[2.0.AAC].[Unknown].mp4:net.filebot.metadata
I still don't know why it matters because I do not know were this is stored when stored natively or by system itself, unless it is secretly still stored as folders and files and adds to your existing filepath it should not really matter.

Edit: Extended attributes are not stored in the main data for files, but in the Attributes area of the volume metadata. As such they are out of reach of normal file tools, and can only be accessed using tools specifically intended to work with xattrs. Each file and folder can have an effectively unlimited number of xattrs.

I can only assume the main volume attributes area is suffering from the same 259 restriction although this must be more a bug than limitation because I work with filenames much longer that 259 on windows in my systems for a long time without issues [files used in system I have written not movies]. Sure I have not added xattr values but the apps I use and where they are used can all handle extended filenames so who ever implemented xattr values did not cater for what windows and ntfs can do perfectly.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Restore multi-episode match from xattr

Post by rednoah »

If you want to replace / update the media info in the file name then you can use Plain File Mode. Your plain file format just has to strip out media info from {fn} so that you can rewrite that part. You can make your life easy by putting the media info into a trailing [...] which can easily be matched and removed with a regular expression pattern:

Code: Select all

{fn.removeAll(/\[.+?\]$/)} [{vf}-{vc}-{ac}-{af}]
or use some kind of delimiter:

Code: Select all

{fn.before(/---/)} --- {vf} {vc} {ac} {af}
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Restore multi-episode match from xattr

Post by rednoah »

I can't reproduce issues with xattr not working. No issues with long paths on my Windows 10 machine.

Test Case:

1. Process movie file and format to long file path (i.e. write xattr to long file path)

Code: Select all

filebot -rename *.mkv --db TheMovieDB --format "{folder}/{'X'*245}/{'Y'*245}"
2. Check if we can read xattr metadata (i.e. read xattr from long file path)

Code: Select all

filebot -mediainfo -r . --format "PATH LENGTH = {f.path.length()} | METADATA = {object}"
PATH LENGTH = 503 | METADATA = Avatar (2009)
:idea: Please read the FAQ and How to Request Help.
HellPhantom
Posts: 49
Joined: 15 Apr 2020, 10:45

Re: Restore multi-episode match from xattr

Post by HellPhantom »

The xattr will keep bugging me so if I ever get to the bottom of it then I will post an update.

Sorry I don't understand your portion of Plain file mode, I might be missing some step.
If I take a file that was just downloaded say
Judy Justice S01E21
contains no mediainfo in filename or xattr and put it in Filebot and press F2 it shows only this name exactly as it was
Judy Justice S01E21
It does not seem to apply any naming convention or add any Mediainfo. How to get it to apply what it has without doing online match ?
Maybe if the mediainfo was already in filename I could understand removing it but I have many older files without this, looking almost like judy example.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Restore multi-episode match from xattr

Post by rednoah »

What does the Format Editor say? Double-Click ➔ Edit Format to check what format you're using, and if there are any errors when applying it the the specific file at hand.


:idea: In Plain File Mode, all file-based bindings (e.g. fn, vf, vc, etc) will work as usual, and binding specific to Episode-type or Movie-type objects will be undefined. So it should work.
:idea: Please read the FAQ and How to Request Help.
HellPhantom
Posts: 49
Joined: 15 Apr 2020, 10:45

Re: Restore multi-episode match from xattr

Post by HellPhantom »

I now feel completely stupid with egg on my face.

I always use TV, movie and music but somehow the F2 Plain File Mode did not register with me as it having its own File format.
I am doing a Tv episode so I am editing the TV format and my example in my format editor is working but not applying.

I am sorry for wasting your time.
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Restore multi-episode match from xattr

Post by rednoah »

No, worries. Best to use Double-Click ➔ Edit Format to open the Format Editor so it's automatically locked on the specific match type that is currently selected.
:idea: Please read the FAQ and How to Request Help.
Post Reply