[AMC] Waiting for seeding to finish - Move not Copy

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
WinterDavid
Posts: 2
Joined: 24 Jan 2014, 00:13

[AMC] Waiting for seeding to finish - Move not Copy

Post by WinterDavid »

Hi,

Whenever I call AMC from utorrent after download - copy works fine, Move does not, I assume from the seeding locking the file.

So I thought I would introduce a delay into the script to give time for utorrent to finish and release the file, I've tried a few various things with no luck.

Introducing a sleep command into the .groovy is no good, the script still tries to lock the file as soon as it is called.

So I tried to put the filebot -script fn:amc etc etc , into a batch file with a TIMEOUT DOS command in front for a specified time.

Problem is the %D %K and so on in the utorrent parameters, how do I then pass those along to the batch file? they seem to not be passed along correctly.

I do have log files, but I've tried so many various permutations, at this point, the log files would show 20 different outputs, and I'm wondering if theres a more general solution?

so in the utorrent Run Program field I put something like

Code: Select all

D:\utorrent.bat "%L" "%S" "%N" "%K" "%F" "%D"
and then in the Bat file I put;

Code: Select all

TIMEOUT 90
filebot -script fn:amc --output "F:/video/Categories" --log-file amc.log --action move --conflict override -non-strict --def music=y --def xbmc=xbmc subtitles=en artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
I read somewhere after a google search that the utorrent commands such as %K etc are converted to numbers when passed to a batch file, in order of when they were called?
so I replaced them with numbers, and it jumbled up with sometimes the title being listed fine, but ut_file coming back as %F and that seemed a dead end.


I do hope I'm missing something very stupid and obvious, I have googled and searched for hours, safe to say scripting and coding of any sort is alien to me....


Perhaps I'm going about it the wrong way completely, I think I probably am, essentially, I just want the filebot script to wait until the seeding is complete, and I've probably tried to go about it in a very roundabout way.

Any Ideas?
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [AMC] Waiting for seeding to finish - Move not Copy

Post by rednoah »

Does utorrent have a "Finished" state that works? This switch makes the script abort if ut_state is anything but the given value:

Code: Select all

--def ut_state_allow=11
You can try setting this switch and launching the script onStateChange hopefully state 11 is in fact Seeding Finished. Just says Finished in the docs.

PS: The script most certainly does not lock any files until it starts processing them, obviously.
:idea: Please read the FAQ and How to Request Help.
WinterDavid
Posts: 2
Joined: 24 Jan 2014, 00:13

Re: [AMC] Waiting for seeding to finish - Move not Copy

Post by WinterDavid »

Hi,

Yeah I thought the solution would probably be based around utorrent rather than the script,

And as for the script locking the file - it says its being locked as soon as the cmd window pops up, although whether the script fails due to utorrent already using it, or another reason is hard to ascertain.

Thanks for the answer,

I will look more at run on state change - finished, to trigger the script, I think I was making it much harder than it needs to be.
User avatar
rednoah
The Source
Posts: 22998
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [AMC] Waiting for seeding to finish - Move not Copy

Post by rednoah »

It's locking the file it says it's locking, namely the log file, as to make sure only one filebot instance is processing at any given time.
:idea: Please read the FAQ and How to Request Help.
Post Reply