AMC script overwriting files when episode lookup fails

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
ramsundaram
Posts: 24
Joined: 13 Oct 2012, 18:32

AMC script overwriting files when episode lookup fails

Post by ramsundaram »

I use the AMC script to move my torrent downloads to my xbmc media player.

Sometimes the episode lookup fails, and returns an older episode name, and then the script overwrites the older episode with the later download. This means I lose the older episode, and the newer one doesn't show up in xbmc, so I'm not aware that it's been downloaded and transferred.

Is there any way I can ensure that in these cases, the older episode is not overwritten, but the newer one has additional characters added to it (something like -1)?

Ram
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC script overwriting files when episode lookup fails

Post by rednoah »

Easiest way is to specify --conflict skip. As for special renaming logic you'll have to modify the script an pass in your own rename logic.
:idea: Please read the FAQ and How to Request Help.
ramsundaram
Posts: 24
Joined: 13 Oct 2012, 18:32

Re: AMC script overwriting files when episode lookup fails

Post by ramsundaram »

Thanks. What does --conflict skip write to the logs when there's a conflict?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC script overwriting files when episode lookup fails

Post by rednoah »

Skipped or something to that account. The line should start with Skipped anyway.
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: AMC script overwriting files when episode lookup fails

Post by part timer »

I've always kept my conflict setting on skip, but I've found that when I get my emails after telling me about new files that have been downloaded and renamed, it will tell me that it has been renamed to something even if it has in fact skipped it. I wish that these emails could say skipped somewhere or show up in red font so they stand out and I know it's still sitting in the original folder.

The emails right now don't look any different if the rename passes or fails.

Can this be changed somehow please?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC script overwriting files when episode lookup fails

Post by rednoah »

Try changing this

Code: Select all

tr { [from.name, to.name, to.parent].each{ cell -> td{ nobr{ code(cell) } } } }
to

Code: Select all

tr { [from.name, to.exists() ? to.name : '', to.parent].each{ cell -> td{ nobr{ code(cell) } } } }
That easy hack should blank out table cell if the target file doesn't exist in the end.
:idea: Please read the FAQ and How to Request Help.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: AMC script overwriting files when episode lookup fails

Post by part timer »

Actually that is not the problem.
The problem is when something gets renamed, like say an episode. Then sometime later another episode gets named wrong or for some reason I get another copy of the same episode and it gets the same name. Rather than saying skipped, or giving any kind of hint, it just looks like it worked the way it was supposed to. Then if I look in the download folder it's still there because it got skipped. That new file already existed. So if I'm not paying attention this becomes a problem. I use the amc script and always have kind set to multi, which processes all the files in the directory that utorrent passes over, even if only one file was just downloaded. I like that this way it can pick up the leftovers if there are any, but eventually if some of the files go through enough times and keep skipping because they exist, there seems to be some that slip through the cracks and just disappear. Not in the folder it says they should be or the one they started in. One of them will be in the new folder but sometimes that "duplicate" is gone.

Then I check my email when I'm away to see which get renamed properly and flag the wrong ones to be reversed later in the history section of the gui. The problem with that is if it's been awhile and I get a lot if mail to go through I can have the same newly named file listed multiple times so when I go into the history I need to make sure I pick the right one to reverse. The history can show that 3 or however many, totally differently named original files can all be attempted to be renamed to the exact same thing. Only 1 should be, but sometimes it's accidentally overwritten somehow. Anyways, to go through the history you have to be sure before you hit reverse you have the right one highlighted or it can renamed to the wrong show.

Hopefully this makes sense to you. I'm not crazy.
part timer
Posts: 181
Joined: 09 May 2012, 23:35

Re: AMC script overwriting files when episode lookup fails

Post by part timer »

I'm wondering now if I could somehow parse data out of the to.parent field. I'd like to grab the imdb id out of it and put it into a url in another column as http://www.imdb.com/title/tt1884161 or whatever the number may be. Sounds easy to me for a programmer I think. Sounds crazy hard to me.

Here's my current format results in the to.parent field

C:\Users\S\Downloads\Done\Movies\Newest Testing\Assassins [1995] [Rated R] [Voted 6] [IMDB tt0112401 ]

Thanks so much for reading.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC script overwriting files when episode lookup fails

Post by rednoah »

If you could look into the logs and see if u can build a test setup for me to reproduce the problem. Otherwise I wouldn't know what to do. When dealing with episodes it might be related to you forcing kind=multi for single episode torrents.
:idea: Please read the FAQ and How to Request Help.
Post Reply