Page 1 of 1

Resulting path+filename too long

Posted: 02 Apr 2021, 10:16
by Bazzu85
Hi,

for my pattern:

Code: Select all

{
	folder.toString().replace('\\'+n+'\\', '\\'+ny+'\\').replace(folder.name, folder.name.before('\\[')).replace(': ',' ').replace('?','')
}
 [
{vf}
{
	if (vc == 'x265' || vc == 'HEVC') ' HEVC' 
	else 
		if (vc == 'AVC' || vc == 'x264') ' x264'
		else ''
}
] [
{
	audioLanguages.collect { i -> "$i" }.join('+').upper()
}
]/
{
	ny.replace(':','').replace('?','')}
	- 
	{s00e00}
	{
		if (self.absolute > 0 && (folder.toString().contains('\\Anime\\') || folder.toString().contains('\\00 - AnimeGG\\'))) ' - ' + absolute.pad(3) else '' 
	}
	- 
	{
		t.replace(':','').replace('?','') 
	}
 [
{
	if (source != '') source + ' ' else ''
}
{vf}
{
	if (vc == 'x265' || vc == 'HEVC') ' HEVC' 
	else 
		if (vc == 'AVC' || vc == 'x264') ' x264'
		else ''
}
] [
{
	audioLanguages.collect { i -> "$i" }.join('+').upper()
}
]
{
	
}
the result for example:

Code: Select all

h:\Serie Tv\Come vendere droga online (in fretta) (2019)\Stagione 01 [1080p x264] [ITA+ENG]\Come vendere droga online (in fretta) (2019) - S01E06 - Se sei la persona più intelligente nella stanza, sei nella stanza sbagliata [NetflixHD 1080p x264] [ITA+ENG]
sometimes I have a file too long of 255 characters (file+path)
I made a temporary workaround using a if

Code: Select all

		if (t.length() < 60) 
			t.replace(':','').replace('?','')
		else
			t.replace(':','').replace('?','').substring(0, 60) + '...'
resulting in

Code: Select all

h:\Serie Tv\Come vendere droga online (in fretta) (2019)\Stagione 01 [1080p x264] [ITA+ENG]\Come vendere droga online (in fretta) (2019) - S01E06 - Se sei la persona più intelligente nella stanza, sei nella s... [NetflixHD 1080p x264] [ITA+ENG]
 
that is less of 255 characters

the question is...why filebot doesnt warn me of the too long path?
any suggestions to improve?
the 60 title length is a placeholder working for many files I think, that can vary based on show name obviosly.

Re: Resulting path+filename too long

Posted: 02 Apr 2021, 11:19
by rednoah
Bazzu85 wrote: 02 Apr 2021, 10:16 the question is...why filebot doesnt warn me of the too long path?
What does the warning say? Screenshot?

Re: Resulting path+filename too long

Posted: 02 Apr 2021, 12:07
by Bazzu85
rednoah wrote: 02 Apr 2021, 11:19
Bazzu85 wrote: 02 Apr 2021, 10:16 the question is...why filebot doesnt warn me of the too long path?
What does the warning say? Screenshot?
the problem is that filebot DON'T warn the user about it..

Re: Resulting path+filename too long

Posted: 02 Apr 2021, 12:30
by rednoah
FileBot will warn you about the ~250 character limit per file path component which is actively enforced by Windows Explorer and various Windows APIs. AFAIK, the ~250 character limit per file path no longer exists.


:idea: You can have file paths with up to ~4000 characters and more, but each file or folder name must not exceed ~250 characters. Those would be Windows Explorer limits rather than NTFS hard limits.

Re: Resulting path+filename too long

Posted: 20 Apr 2021, 10:13
by Bazzu85
rednoah wrote: 02 Apr 2021, 12:30 FileBot will warn you about the ~250 character limit per file path component which is actively enforced by Windows Explorer and various Windows APIs. AFAIK, the ~250 character limit per file path no longer exists.


:idea: You can have file paths with up to ~4000 characters and more, but each file or folder name must not exceed ~250 characters. Those would be Windows Explorer limits rather than NTFS hard limits.
yeah, in windows explorer I agree, but app like vlc and emby doesn't handle it well..
so I want to find a solution to shorten the resulting path in filebot..

Re: Resulting path+filename too long

Posted: 20 Apr 2021, 15:15
by rednoah
e.g. generate the destination file path and then truncate to 250 characters:

Code: Select all

Movies/{
[ allOf {ny}
        { allOf {vf}
                {group}
        }
, allOf {ny}
        {'CD'+pi}
        {lang}
]*.join(' ')
  .join('/')
  .truncate(250)
}
:idea: Your code shortens the file path. This example code just cuts off the file path at the 250 character limit, so if we'd imagine a worst case where the folder name alone is 250+ characters, then file name would be be cut off completely in that case.