rename only unprocessed files

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
zthaynes
Posts: 3
Joined: 04 Mar 2015, 19:36

rename only unprocessed files

Post by zthaynes »

Hello all... My name is Zach and I am a filebot noob :) That being said I am not completely computer illiterate, I grew up using the windows that ran on top of dos... I frequently try out different linux distros (and go back to windows)... I will normally try and try and try and try until I figure something out.... I'm just smart enough to be dangerous, and it has been three days now.

I'm tired.

Here is my setup: (winxp)
1 - qbittorrent downloads a particular video automatically via rss feeds, then launches a batch file.
2 - batch script pulls all video files to the root folder (e:\) and deletes everything else
(I know... but that's the way I like it)
3 - batch script deletes any file smaller than 700kb that is more than 21 days old
(thus keeping movie files and deleting old tv shows)
4 - batch script converts any avi file to mp4 using ffmpeg
(to allow play on roku via serviio)
5 - batch script renames files using filebot
(to allow serviio to "see" all tv series)

Number five is giving me a headache.

I can easily do something like: filebot --rename "e:\" -non-strict and (almost) everything in the drive gets its name formatted so that serviio knows what to do with it. The problem is that I also have serviio set to show me new files... it only shows 10 new files... and that is based on the "modified" time... AND... every time this script runs, every file is modified.

There is a script you can run with the cli called "amc" (I know you all know it). This script is supposed to (among other things) allow me to run filebot only on unprocessed files. It appears to have been written in or for a "nix" os because your paths have to be forward slashes. It also appears I don't know what i'm talking about because it seems to work fine for everyone else in windows.

Here is the cli input:
filebot -script fn:amc --output "e:/" --log-file amc.log --action rename -non-strict "e:/" --def excludeList=amc.txt

Here is the cli output:
Java HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.
Locking C:\Documents and Settings\zthaynes\Application Data\FileBot\logs\amc.log
Parameter: excludeList = amc.txt
Argument: E:\
Using excludes: E:\amc.txt (0)
Ignore hidden: E:\
No files selected for processing
Failure (┬░_┬░)


I have tried several variations of this, including running from c:\progra~1\filebot\, running from E:\ and calling filebot from it's path, using "/" as the input and output path, using "e:\" instead of "e:/", using "\" instead of "/", etc, etc... I cannot for the life of me figure out what i'm doing wrong. (i'm also not sure why the log file is amc.log, and we are excluding from amc.txt... but hey.

Can someone please tell me what I am doing wrong here?
User avatar
rednoah
The Source
Posts: 23030
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rename only unprocessed files

Post by rednoah »

1.
Calling -rename on EVERYTHING is a BAD idea, and most likely a HUGE waste of TheMovieDB/TheTVDB resources, thus likely to get you BANNED.

2.
Using amc is a good idea since amc allows you to specify an exclude list to avoid getting BANNED.

3.
It's highly discouraged to use the drive root for anything (since there's lots of other hidden system files which you don't want to process I presume) and the amc really doesn't like it if input == output (at the very least everything gets processed twice -> get you banned).

So use E:/Downloads for input and use E:/Media for output.
:idea: Please read the FAQ and How to Request Help.
zthaynes
Posts: 3
Joined: 04 Mar 2015, 19:36

Re: rename only unprocessed files

Post by zthaynes »

So... will rename do it then, or do I need to use copy and then delete the old files from the input folder from my batch script? Either way will this allow the script to function and is my syntax correct?

Fyi: sorry for posting to the wrong area... can the mods move this?
zthaynes
Posts: 3
Joined: 04 Mar 2015, 19:36

Re: rename only unprocessed files

Post by zthaynes »

I have googled until I can't google anymore. For anyone that is interested... I figured out a solution all on my own. :D Here is a snippet from the batch file I created.


@echo off
cls
::FIND ANY MP4 FILE IN ANY SUB FOLDER
for /D %%d in (E:\*) do if exist "%%d\*.mp4" (
::RENAME THOSE FILES
filebot -rename "%%d" -non-strict && (
::MOVE THOSE FILES TO THE ROOT DIRECTORY
move /Y "%%d\*.mp4" e: && (
::DELETE THE ORIGINAL FOLDER
rmdir /S /Q "%%d" )))

::FIND ANY FILE MORE THAN 21 DAYS OLD AND DELETE IT
forfiles -pe: -m*.mp4 -d-21 -c"cmd /c del /F /Q @FILE

Obviously this is not going to help anyone that wants to setup a file/directory structure based on show title, season, etc... But it does serve the purpose of hitting each file only once, because once they have been moved to root, they will not be identified in the for loop. I'm sure some more experienced coders can add upon this, OR (more likely) someone will come along and show how to accomplish this the correct way in the amc script.

Thanks for the help anyways!
Post Reply