Page 1 of 1
keep original movie nfo
Posted: 22 Aug 2016, 20:50
by SuperDOS
Hi,
I'm trying to keep the original release nfo when renaming movies and after editing amc.groovy as below
// process only media files
Code: Select all
input = input.findAll{ f -> (f.isVideo() && !tryQuietly{ f.hasExtension('iso') && !f.isDisk() }) || (f.isMovie() && f.hasExtension('nfo')) ||f.isSubtitle() || (f.isDirectory() && f.isDisk()) || (music && f.isAudio()) }
nfo files will be included for movies but get error when running
Code: Select all
[MOVE] Rename [M:\_unpack\Movie.2016.1080p.BluRay.x264-GROUP\Movie.2016.1080p.BluRay.x264-GROUP.nfo] to [M:\Movies\Movie (2016)\Movie.nfo]
Code: Select all
[MOVE] Failed to rename [M:\_unpack\Movie.2016.1080p.BluRay.x264-GROUP\Movie.2016.1080p.BluRay.x264-GROUP.nfo]
not sure what's happening.
Re: keep original movie nfo
Posted: 23 Aug 2016, 01:27
by rednoah
No idea. What's the complete log? Does it work for video files? There's no reason move wouldn't work for nfo files.
Re: keep original movie nfo
Posted: 23 Aug 2016, 07:03
by SuperDOS
here's the log with some test files:
Code: Select all
Run script [amc.groovy] at [Tue Aug 23 08:56:16 CEST 2016]
Parameter: music = n
Parameter: artwork = n
Parameter: extras = n
Parameter: skipExtract = n
Parameter: clean = y
Parameter: subtitles = en
Parameter: deleteAfterExtract = y
Parameter: seriesFormat = TV-Shows/{n}/{'s'+s.pad(2)}/{n} - {episode.special ? s.pad(2)+"x"+special.pad(2) : s.pad(2)+"x"+e.pad(2)} - {t.replaceAll(/[`...................?]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
Parameter: movieFormat = Movies/{n} ({y})/{n}{" CD$pi"}
Argument: M:\rename
Read archive [Subs.rar] and extract to [M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs]
Extracting files [M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup.idx, M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup.rar]
Read archive [the.matrix.1999-coolgroup.rar] and extract to [M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup\Subs]
Extracting files [M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup\Subs\the.matrix.1999-coolgroup.sub]
Input: M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup.idx
Input: M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup\Subs\the.matrix.1999-coolgroup.sub
Input: M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.mkv
Input: M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.nfo
Exclude: M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.sfv
Exclude: M:\rename\the.matrix.1999-coolgroup\Sample\the matrix-sample.avi
Exclude: M:\rename\the.matrix.1999-coolgroup\Screens\coolgroup.jpg
Exclude: M:\rename\the.matrix.1999-coolgroup\Screens\screen1.png
Group: [moM:the matrix 1999] => [the.matrix.1999-coolgroup.idx, the.matrix.1999-coolgroup.sub, the.matrix.1999-coolgroup.mkv, the.matrix.1999-coolgroup.nfo]
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.mkv
Rename movies using [TheMovieDB]
Auto-detect movie from context: [M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.mkv]
Auto-detect movie from context: [M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.nfo]
[MOVE] Rename [M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.nfo] to [M:\Movies\The Matrix (1999)\The Matrix.nfo]
[MOVE] Failed to rename [M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.nfo]
Processed 0 files
M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.nfo -> M:\Movies\The Matrix (1999)\The Matrix.nfo: The process cannot access the file because it is being used by another process.
Delete archive M:\rename\the.matrix.1999-coolgroup\Subs\Subs.rar
Delete archive M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup.rar
Clean clutter files and empty folders
Delete M:\rename\the.matrix.1999-coolgroup\Sample\the matrix-sample.avi
Delete M:\rename\the.matrix.1999-coolgroup\Screens\coolgroup.jpg
Delete M:\rename\the.matrix.1999-coolgroup\Screens\screen1.pngDelete M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup.idx
Delete M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup\Subs\the.matrix.1999-coolgroup.sub
Delete M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup\Subs
Delete M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs\the.matrix.1999-coolgroup
Delete M:\rename\the.matrix.1999-coolgroup\Subs\Subs\Subs
Delete M:\rename\the.matrix.1999-coolgroup\Subs\Subs
Delete M:\rename\the.matrix.1999-coolgroup\Subs
Delete M:\rename\the.matrix.1999-coolgroup\Screens
Delete M:\rename\the.matrix.1999-coolgroup\Sample
Finished without processing any files
Failure (.._..)
not sure why the seriesFormat look different in the log, here's what in the amc_args.txt
Code: Select all
music=n
artwork=n
extras=n
skipExtract=n
clean=y
subtitles=en
deleteAfterExtract=y
seriesFormat=TV-Shows/{n}/{'s'+s.pad(2)}/{n} - {episode.special ? s.pad(2)+"x"+special.pad(2) : s.pad(2)+"x"+e.pad(2)} - {t.replaceAll(/[`´‘’?]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
movieFormat=Movies/{n} ({y})/{n}{" CD$pi"}
and the command is:
Code: Select all
filebot.exe -script amc.groovy M:\rename --action move -non-strict --log-file filebotrename.log --log-lock no --def @"C:\Program Files\Filebot\amc_args.txt" --output M:\
I noticed now in the log it says:
Code: Select all
M:\rename\the.matrix.1999-coolgroup\the.matrix.1999-coolgroup.nfo -> M:\Movies\The Matrix (1999)\The Matrix.nfo: The process cannot access the file because it is being used by another process.
And don't understand why it would be used by another process, is filebot reading the nfo maybe? because it's not open by any other program.
Re: keep original movie nfo
Posted: 23 Aug 2016, 12:37
by rednoah
You can use Process Explorer to see which process owns which file handles. If you're using a torrent client then it's probably the torrent client that is keeping the file open for seeding.
Re: keep original movie nfo
Posted: 23 Aug 2016, 14:08
by SuperDOS
weird, nothing is using these files, monitored with procmon but couldn't find anything off.
There's no torrent client using these files or any other files I've tried with.
filebot works perfectly if I don't include nfo so Is my modification of the groovy.amc correct?
Re: keep original movie nfo
Posted: 23 Aug 2016, 18:15
by rednoah
I guess then filebot itself is somehow keeping a file handle.
I is checking nfo files for information so maybe it's not correctly closing file handle somewhere.
Re: keep original movie nfo
Posted: 23 Aug 2016, 20:51
by SuperDOS
I'm think you're right,
removed (f.isMovie() so it's only:
Code: Select all
// process only media files
input = input.findAll{ f -> (f.isVideo() && !tryQuietly{ f.hasExtension('iso') && !f.isDisk() }) || f.hasExtension('nfo') ||f.isSubtitle() || (f.isDirectory() && f.isDisk()) || (music && f.isAudio()) }
Which I guess it don't treat nfo files as movies or something(?)
now it renamed the nfo file as well, the only issue I have is that it will do this for tv shows as well which I don't want.
maybe I can add !(f.isSeries() ?
Re: keep original movie nfo
Posted: 24 Aug 2016, 02:23
by rednoah
Those methods are not meant to be used on nfo files. It probably won't work.
Re: keep original movie nfo
Posted: 24 Aug 2016, 05:58
by SuperDOS
correct.
tried some more and it didn't work now either, file in use.
Guess it reads the nfo at some point and doesn't always have time to close it.
Is there some way you can disable filebot to read the nfo?
Re: keep original movie nfo
Posted: 24 Aug 2016, 07:11
by rednoah
Not really, but I'd consider this kind of resource leak a bug that needs to be fixed anyway.
The latest revision should fix this issue, but I might not be able to upload new builds for the next few weeks.
Re: keep original movie nfo
Posted: 24 Aug 2016, 08:30
by SuperDOS
Thanks I'll try the new version when it's out.
Also I'm amazed that you are able to answer so quickly here, really appreciate it!