Page 1 of 1

Show if target directory already exists

Posted: 23 May 2020, 15:10
by ProXy
Hello,

sometimes I am replacing an existing movie with a version in better quality. At least I want to replace them. The extensions are sometimes different so FileBot won‘t show me an exclamation that the movie already exists. But it would be a smart function if there would be an indicator if the target directory already exists or FileBot will have to create it.

In my case, if the directory already exists, I can remove the old version of the movie.

Thank you!

Re: Show if target directory already exists

Posted: 23 May 2020, 15:26
by rednoah
Sorry, checking for nearby logical duplicates at rename time is not planned. However, there are tools that allow you to manage logical duplicates after renaming:
viewtopic.php?t=5#p23171

Re: Show if target directory already exists

Posted: 23 May 2020, 17:58
by ProXy
Yeah, but if FileBot would just show if the directory already exists this would be working as well. All movies are placed in its own directory (Plex style), so if the directory already exists there is also another version of the movie in it. So there is no need for duplicate checking, only checking the directory a movie is moved to.

Re: Show if target directory already exists

Posted: 23 May 2020, 19:28
by kim
maybe you can use this?

Code: Select all

{folder.exists() ? 'STOP' : 'Go on'}
or

Code: Select all

{f.parentFile.exists() ? 'STOP' : 'Go on'}

Re: Show if target directory already exists

Posted: 23 May 2020, 20:38
by devster
The duplicates script could also be an option, I believe it matches with extended attrs, not file names, so it would likely flag duplicates if both files were processed using FileBot even with different extensions/quality.

Re: Show if target directory already exists

Posted: 24 May 2020, 04:58
by rednoah
kim wrote: 23 May 2020, 19:28 maybe you can use this?

Code: Select all

{folder.exists() ? 'STOP' : 'Go on'}
or

Code: Select all

{f.parentFile.exists() ? 'STOP' : 'Go on'}
f and folder refer to the original file so this won't work, but the idea is good.


You can modify your format in such a way, so that it checks if some file or folder already exists, and then format extra information into the destination path accordingly.


e.g. this might a bit slow, because we check xattr for all files in the movie folder for each file, but it should work:

Code: Select all

{
	def movieFolder = '/path/to/Movies' as File
	def duplicateFolder = '/path/to/Duplicate Movies' as File

	id in movieFolder.files.metadata?.id
	? duplicateFolder
	: movieFolder
}
/{plex.tail}