Trying to exclude a source subfolder filters out everything

Support for Windows users
Post Reply
theedoek
Posts: 1
Joined: 03 Sep 2024, 15:35

Trying to exclude a source subfolder filters out everything

Post by theedoek »

Files are downloaded on my Synology NAS in the home folder (\\NAS\home\) and Filebot has been installed using the Microsoft Store.
The home folder contains the fixed folders "Photos" and "WWW". Other folders are created dynamicaly after downloading files (e.g. TVShow1 and TVShow2, which each contain the corresponding tv show movie file):
  • Photos
  • WWW
  • TVShow1
  • TVShow2
I used to run Filebot manually through below commmand line. This worked fine until the fixed folders arrived.

Shell: Select all

filebot -rename -r \\NAS\home\ --db TheTVDB --format "F:/Series/{n.replace('Hawai\'i':'Hawaii',':':'')}/{'Season '+s}/{n.replace('Hawai\'i':'Hawaii',':':'')} {s00e00}" --action move --mode interactive
I want to exclude (at least) the "Photos" folder from the Filebot proces. After reading up on several forum posts I thought it would be best to use the file-filter option and altered the command line call to this:

Shell: Select all

filebot -rename -r \\NAS\home\ --db TheTVDB --format "F:/Series/{n.replace('Hawai\'i':'Hawaii',':':'')}/{'Season '+s}/{n.replace('Hawai\'i':'Hawaii',':':'')} {s00e00}" --action move --mode interactive --file-filter "fn =~ /Photos/"
When I run Filebot, it indicates that there are no input files though there are two more subfolders that do not meet the criteria and should therefor be processed (because of the -r option for recursive search):

Console Output: Select all

Current application revision (r10380) does not match cache revision (r10362)
Initialize new disk cache: C:\Users\Gebruiker\AppData\Roaming\FileBot\cache\0
No input files: [\\NAS\home\]
* Consider using --file-filter "true" to select all files
No input files
Failure (×_×)??

I'm obviously doing something wrong, but I don't see what it is. Any suggestions?
User avatar
rednoah
The Source
Posts: 23386
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Trying to exclude a source subfolder filters out everything

Post by rednoah »

:?: Why not just pass along the folders you want to process? You can use multiple input arguments and * glob patterns to easily pass multiple input arguments:

Shell: Select all

filebot -rename -r \\NAS\home\TVShow* ....




:!: --file-filter selects files from the input folders and not input folders themselves. {fn} is the file name which presumably does not contain the substring "Photos". Notably, --file-filter is highly inefficient for the specific use case of wholly excluding input folders, since filebot will first select all files from all input folders (which can be very slow on a remote network share) and then select / unselect files based on your --file-filter expression before processing.



:idea: You can check the entire file path for the non-existence of substrings "Photos" and "WWW" like so:

Shell: Select all

--file-filter "none{ f =~ /Photos|WWW/ }"

Console Output: Select all

$ filebot -mediainfo -r . --format "{f} | { none{ f =~ /Photos|WWW/ } }"
~/Photos/a.txt | false
~/test/b.txt | true
:idea: Please read the FAQ and How to Request Help.
Post Reply