Show if target directory already exists

All your suggestions, requests and ideas for future development
Post Reply
ProXy
Posts: 4
Joined: 12 Oct 2017, 14:35

Show if target directory already exists

Post 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!
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Show if target directory already exists

Post 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
:idea: Please read the FAQ and How to Request Help.
ProXy
Posts: 4
Joined: 12 Oct 2017, 14:35

Re: Show if target directory already exists

Post 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.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Show if target directory already exists

Post 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'}
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Show if target directory already exists

Post 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.
I only work in black and sometimes very, very dark grey. (Batman)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Show if target directory already exists

Post 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}
:idea: Please read the FAQ and How to Request Help.
Post Reply