Page 1 of 1

Move to a different folder if name includes specific string

Posted: 13 Apr 2017, 20:16
by pjburnhill
Sorry if this is a daft question, but how would I move specific media to another folder (i.e. not /Movies) if the name includes a specific string (like '.KORSUB.', '.HC.' or '.HARDCODED.')?

Currently using this:

Code: Select all

/usr/bin/filebot -script fn:amc --output "/GD/Media/Plex" --action move -non-strict "/GD/Media/Plex/Incoming/Film" --def @/root/.filebot/args.txt -no-xattr --def subtitles=en --def pushbullet= --def storeReport=y --def clean=y --def "ut_label=Movie" --def unsorted=y --log-file amc_movies.log --conflict override

Re: Move to a different folder if name includes specific string

Posted: 14 Apr 2017, 03:25
by rednoah
1
Destination path is up to your format:

Code: Select all

f =~ /KORSUB|HC|HARDCODED/ ? 'Not Movies' : 'Movies'
@see viewtopic.php?f=5&t=4191


2.
You may need to read up on the --def excludeList option.

Re: Move to a different folder if name includes specific string

Posted: 14 Apr 2017, 21:59
by pjburnhill
rednoah wrote:1
Destination path is up to your format:

Code: Select all

f =~ /KORSUB|HC|HARDCODED/ ? 'Not Movies' : 'Movies'
@see viewtopic.php?f=5&t=4191

2.
You may need to read up on the --def excludeList option.
Thanks! Was totally unaware that conditional structures were supported.

2. Did you mean read up on --def excludeList as it's not included in my command? I don't include it as I only process finished downloads and move them to appropriate folders, never processing same files twice.

Re: Move to a different folder if name includes specific string

Posted: 15 Apr 2017, 02:07
by rednoah
2.
What happens if a file cannot be identified or just can't be moved to the destination folder for some reason?

Re: Move to a different folder if name includes specific string

Posted: 15 Apr 2017, 10:54
by pjburnhill
rednoah wrote:2.
What happens if a file cannot be identified or just can't be moved to the destination folder for some reason?
I am using the --def unsorted=y and I haven't had an issue with not being able to be moved into the Films folder. The incoming folder and the Films folder are on the same drive with unlimited storage, so I assume that shouldn't really happen?

But I guess there's no harm in using --def excludeList I guess.

Re: Move to a different folder if name includes specific string

Posted: 15 Apr 2017, 12:02
by rednoah
With unsorted it's probably fine. But there's always unexpected corner cases. That's why I'd always recommend adding excludeList regardless of what you're doing if your input folder is constant.