amc conflict override problem

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

amc conflict override problem

Post by kim »

windows + amc / CLI with
--action move --conflict override --def artwork=y

from log
Skipped [FILEHERE.mp4] because [FILEHERE.mp4] already exists

so problem is:
1. if path+filename is the same (not changed)
then NO download of any artwork (pics + nfo)
even if NO artwork (pics + nfo) already
aka ALL is Skipped

2. if path+filename is NOT the same (changed)
file get new format and
then if there are artwork (pics + nfo), only the nfo is updated

am I using it wrong or ?
conflict override vs conflict auto, difference ?
conflict override = always override ?
conflict auto = if "better" override ?
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc conflict override problem

Post by rednoah »

I see. I guess that's how it might behave.

Fixed.

@see https://github.com/filebot/scripts/comm ... b4f731aeb3
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: amc conflict override problem

Post by kim »

I changed the 2 from false to true:
but 1. problem is still there :(

so problem is:
"1. if path+filename is the same (not changed)
then NO download of any artwork (pics + nfo)
even if NO artwork (pics + nfo) already
aka ALL is Skipped"
No difference ?

"2. if path+filename is NOT the same (changed)"
rename OK
artwork (pics + nfo) updated OK

3.
also it looks like in the log if "Failure (°_°)" then it don't make \n aka new line like if "Done ヾ(@⌒ー⌒@)ノ"
Clean clutter files and empty folders
Finished without processing any files
Failure (°_°)
Run script...
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc conflict override problem

Post by rednoah »

1.
Looking into this, I did find a few minor bugs. But it seems to be working fine. If I process the same file multiple times with --conflict override, nfo xml is definitely rewritten every time.


2.
btw these system properties now allow you to get alot more internal output, and the latest jar will also give you full stacktraces for cought script exceptions:

Code: Select all

-Dnet.filebot.logging.debug=INFO

Code: Select all

-Dnet.filebot.logging.debug=ALL
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: amc conflict override problem

Post by kim »

After switch from http to https
I really needed better logging (a way to debug) so NICE :D

I added this to "filebot.l4j.ini"... it works
# log level
-Dnet.filebot.logging.debug=ALL

1. problem # 1 again in "new log" (I changed the names in log)
Using persistent disk cache C:\Program Files\FileBot\cache\0
Run script [C:\Program Files\FileBot\amc.groovy] at [Tue Apr 12 15:43:44 CEST 2016]
Parameter: artwork = y
Parameter: clean = y
Parameter: skipExtract = y
Argument: D:\_DoWnLoaD\Done
Input: D:\_DoWnLoaD\Done\Movies\MOVIENAME (2015)\MOVIENAME.2015.mkv
Exclude: D:\_DoWnLoaD\Done\Movies\MOVIENAME (2015)\fanart.jpg
Exclude: D:\_DoWnLoaD\Done\Movies\MOVIENAME (2015)\folder.jpg
Exclude: D:\_DoWnLoaD\Done\Movies\MOVIENAME (2015)\movie.nfo
Group: [mov:MOVIENAME 2015] => [MOVIENAME.2015.mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [D:\_DoWnLoaD\Done\Movies\MOVIENAME (2015)\MOVIENAME.2015.mkv]
Rank [MOVIENAME 2015] => [MOVIENAME (2015)]
Skipped [D:\_DoWnLoaD\Done\Movies\MOVIENAME (2015)\MOVIENAME.2015.mkv] because [D:\_DoWnLoaD\Done\Movies\MOVIENAME (2015)\MOVIENAME.2015.mkv] already exists
Processed 0 files
Clean clutter files and empty folders
Finished without processing any files
Failure (°_°)


2. problem # 2 If you compare it to # 1 this one has (I changed the folderName to force a rename+get artwork):
[MOVE] Rename (from -> to)
Processed 1 files
Fetching movie artwork for ... to ...
Generate Movie NFO ...
Fetch resource ... (info)
Fetch resource ... (img)
Fetching (the img's)
Delete (pics + nfo + old folder)
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc conflict override problem

Post by rednoah »

You're using --action skip, so if the file is skipped, then the corresponding artwork task is skipped as well.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: amc conflict override problem

Post by kim »

No, as I wrote
"windows + amc / CLI with
--action move --conflict override --def artwork=y"

All:
--log all --log-file amc.log --action move --conflict override --encoding UTF-8 --def artwork=y --def clean=y --def skipExtract=y
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc conflict override problem

Post by rednoah »

I guess the only reason why --conflict override might behave like --conflict skip is when input/output file is the same.

This is just an odd way of testing with an artificial scenario that can't actually happen. The amc script does not support processing files in-place and input/output folders are not supposed to overlap.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: amc conflict override problem

Post by kim »

not good I think... then how do I update artwork AND rename ?

artwork part I can use the artwork.groovy but what about the rename part ?

it really wound be best if all in one (2in1)
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc conflict override problem

Post by rednoah »

The reason it doesn't work in this specific case is because no renaming is going on. In the case you only need the artwork scripts and that should work fine.

How can a file be in your amc structure if it hasn't been moved into said structure by the amc script in the first place?
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: amc conflict override problem

Post by kim »

Lets say I want to update info/data in nfo AND/OR rename (e.g. if my rename format or any data has changed)

Using amc: how would you go about doing this, without 1st moving it and then have amc move it back ?


In my head override means just that... override:
--conflict skip (to be on the safe side)
--conflict auto (ok, I update pics+nfo if better/more but don't rename... not sure what it does?)
--conflict override (Full ON... override ALL... I know what Im doing.... and if not FACEPALM)
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc conflict override problem

Post by rednoah »

Well, for updating the info and artwork there's separate scripts.

Renaming files might work, but if the folder structure changes you'll end up with empty folders. Processing files in-place is not supported and may or not work. Also, why would you change your format? Continuously processing files over and over is not recommended. Just stick with one format.

--conflict auto has no idea effect on artwork processing. It's there for importing files into an existing structure and keep the better one. So what to do when you have the same movie twice.

All the scrips are made to be run once on files. They're not designed for continuous library maintenance.


EDIT:


If you're processing files that have already been processed, the amc script is definitely not the best way to do it. I would recommend simple -rename --db xattr (assume that xattr has been set by filebot) to reduce unnecessary load on external services like TheTVDB/TheMovieDB.

The artwork script might also benefit from a few modifications so that it doesn't re-download all the artwork when all you want is update the nfo files.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: amc conflict override problem

Post by kim »

"The artwork script might also benefit from a few modifications so that it doesn't re-download all the artwork when all you want is update the nfo files."

I don't know how to do this
from htpc maybe?

Code: Select all

		copyIfPossible(movieDir.resolve('folder.jpg'), movieDir.resolve('folder.jpg'))
		copyIfPossible(movieDir.resolve('fanart.jpg'), movieDir.resolve('fanart.jpg'))

def copyIfPossible(File src, File dst) {
	if (src.exists() && !dst.exists()) {
		src.copyAs(dst)
	}
}
sry to be a pain... but again I still don't understand why "override" only means "override" IF rename part is NOT skipped (fail if skipped )... making "override" = null... I need a --conflict JUSTDOIT ;)
making "override"
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: amc conflict override problem

Post by rednoah »

1.
You'd have add a check if the file already exists, and not do anything if it does. Search for "saveAs" in the htpc script.


2.
If you rename /A/B/C.xyz to /A/B/C.xyz it's not skipped because that file already exists, it's skipped because from/to is the same therefore "rename" has the same effect as doing nothing there for it's skipped. If you have manually replaced the original /A/B/C.xyz with /someotherfile.xyz then it's your fault for not using the amc script to do that in the first place. If you had processed /someotherfile.xyz to /A/B/C.xyz with amc script, then nfo would have been update at that point.

It's either a stupid use case, or a really weird corner case that only affects your specific setup. Either way, if you want it, you either need to code it yourself, or make a really good case why this is a normal use case that would affect typical users.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: amc conflict override problem

Post by kim »

"You'd have add a check if the file already exists, and not do anything if it does. Search for "saveAs" in the htpc script."

Meaning:
I need to change my htpc file only ?
I need to change my artwork file only ?
I need to change my artwork AND htpc files ?
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: amc conflict override problem

Post by kim »

looks like its not working
I need more ?
I can't see what I need to change (if any) in artwork file

from htpc

Code: Select all

	if (!outputFile.exists()) {
		log.finest "FROM htpc fetchMovieArtwork outputFile - Downloading $selection.url => $outputFile"
		return selection.url.saveAs(outputFile)
	}
Post Reply