Page 1 of 1

filebot still detects using filename instead of dirname

Posted: 12 Mar 2013, 13:05
by maortal

Code: Select all

Parameter: clean = y
Parameter: artwork = y
Parameter: ut_dir = C:\Users\Maor\Videos\Rss\House.Of.Cards.2013.S01E03.720p.HDTV.x264-EVOLVE
Parameter: ut_file =
Parameter: ut_kind = %K
Parameter: ut_title = House.Of.Cards.2013.S01E03.720p.HDTV.x264-EVOLVE
Parameter: ut_label = TL
Parameter: ut_state = 5
Read archive [hoc.s01e03.720p.evolve.rar] to [C:\Users\Maor\Videos]
Extracting files [C:\Users\Maor\Videos\hoc.s01e03.720p.evolve.mkv]
Input: C:\Users\Maor\Videos\hoc.s01e03.720p.evolve.mkv
Group: [tvs:evolve] => [hoc.s01e03.720p.evolve.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [evolve, hoc]
Fetching episode data for [Evolve]
Fetching episode data for [Hockey Games]
Fetching episode data for [Hockey: A People's History]
Fetching episode data for [Revolver]
[MOVE] Rename [C:\Users\Maor\Videos\hoc.s01e03.720p.evolve.mkv] to [C:\Users\Maor\Videos\TV Sh
ows\Evolve\Season 1\hoc.s01e03.720p.evolve.mkv]
Processed 1 files
Fetching artwork for C:\Users\Maor\Videos\TV Shows\Evolve\Season 1 from TheTVDB
Fetching C:\Users\Maor\Videos\TV Shows\Evolve\folder.jpg => {id=814901, BannerMirror=http://th
etvdb.com/banners/, BannerPath=posters/83141-1.jpg, BannerType=poster, BannerType2=680x1000, L
anguage=en, RatingCount=0}
here's the latest log using the latest filebot... still i dont get it why it uses the filename that was extracted for matching...

Re: filebot still detects using filename instead of dirname

Posted: 12 Mar 2013, 13:27
by rednoah
You're welcome to only use the foldername or torrent label if that works for you. Your script. Your rules. ;)

Mine works just fine:

Code: Select all

Parameter: ut_kind = multi
Parameter: ut_dir = D:\testdata\AMC-TEST
Parameter: ut_title = AMC-TEST
Parameter: clean = y
Input: D:\testdata\AMC-TEST\House.Of.Cards.2013.S01E03.720p.HDTV.x264-EVOLVE\hoc.s01e03.720p.evolve.mkv
Group: [tvs:House Of Cards 2013] => [hoc.s01e03.720p.evolve.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [House Of Cards 2013, hoc]
Fetching episode data for [Hockey Games]
Fetching episode data for [House of Cards (2013)]
Fetching episode data for [Hockey: A People's History]
Fetching episode data for [House of Cards]
[COPY] Rename [D:\testdata\AMC-TEST\House.Of.Cards.2013.S01E03.720p.HDTV.x264-EVOLVE\hoc.s01e03.720p.evolve.mkv] to [D:\output\TV Shows\House of Cards (US)\Season 01\House of Cards - S01E03 - Chapter 3.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
PS: You messed it up when you extract the file directly into that temp folder, thus losing key information.

Re: filebot still detects using filename instead of dirname

Posted: 12 Mar 2013, 13:45
by maortal
yep i figured out that what was causing the problem...
the fact that i set output folder for the extract...
i'll fixed that
i did that so i could maintain the script progress incase some of the file moves have failed figured it will be less of a hassle to look into one dir instead of all torrent's dirs to see which one failed if any...

thanks

Re: filebot still detects using filename instead of dirname

Posted: 12 Mar 2013, 14:33
by maortal
is this what i'm suppose to change?

Code: Select all

def groups = input.groupBy{ f ->
	// skip auto-detection if possible
	if (forceIgnore(f))
		return []
	if (f.isAudio() && !f.isVideo()) // PROCESS MUSIC FOLDER BY FOLDER
		return [music: f.dir.name]
	if (forceMovie(f))
		return [mov:   detectMovie(f, false)]
	if (forceSeries(f))
		return [tvs:   detectSeriesName(f) ?: detectSeriesName(ut_dir)]
	if (forceAnime(f))
		return [anime: detectSeriesName(f) ?: detectSeriesName(f.dir.listFiles{ it.isVideo() })]
this will force it look at the torrent dir no? instead of all files in current dir?

Re: filebot still detects using filename instead of dirname

Posted: 12 Mar 2013, 14:43
by rednoah
Nope, this is preprocessing. Grouping files by likely category and item. If anything you wanna look at rename(file: files, ...) later own where renaming actually happens. As you can see it's not passing in the query parameter but assuming that rename(...) itself will figure it out, especially since files are already grouped which makes matching more reliable for each rename group.

Why not preserve the foldername or ut_title in your temp folder? e.g. extract(..., output:"path/to/temp/${ut_title}")

Re: filebot still detects using filename instead of dirname

Posted: 12 Mar 2013, 14:45
by maortal
i dont mind doing that...
but will it be cleaned when the script is done?
the clean=y takes cares of stuff like that?

Re: filebot still detects using filename instead of dirname

Posted: 12 Mar 2013, 14:50
by maortal
changing to

Code: Select all

if (forceSeries(f))
		return [tvs:   detectSeriesName(ut_dir) ?: detectSeriesName(f)]
worked but i guess there is the rename part i need to change also..
it downloads the correct metadata but the folder name is still Evolve

Code: Select all

Read archive [hoc.s01e03.720p.evolve.rar] to [C:\Users\Maor\Videos]
Extracting files [C:\Users\Maor\Videos\hoc.s01e03.720p.evolve.mkv]
Input: C:\Users\Maor\Videos\hoc.s01e03.720p.evolve.mkv
Group: [tvs:House Of Cards 2013] => [hoc.s01e03.720p.evolve.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [evolve, hoc]
Fetching episode data for [Evolve]
Fetching episode data for [Revolver]
Fetching episode data for [Hockey Games]
Fetching episode data for [Hockey: A People's History]
[MOVE] Rename [C:\Users\Maor\Videos\hoc.s01e03.720p.evolve.mkv] to [C:\Users\Maor\Videos\TV Sh
ows\Evolve\Season 1\hoc.s01e03.720p.evolve.mkv]

Re: filebot still detects using filename instead of dirname

Posted: 12 Mar 2013, 14:55
by maortal
rednoah wrote:Nope, this is preprocessing. Grouping files by likely category and item. If anything you wanna look at rename(file: files, ...) later own where renaming actually happens. As you can see it's not passing in the query parameter but assuming that rename(...) itself will figure it out, especially since files are already grouped which makes matching more reliable for each rename group.

Why not preserve the foldername or ut_title in your temp folder? e.g. extract(..., output:"path/to/temp/${ut_title}")
i did what you suggested.. it worked well except for the part which i still have House.Of.Cards.2013.S01E03.720p.HDTV.x264-EVOLVE in my temp dir...

thats the clean that doesnt work...

Code: Select all

if (clean) {
	if (['COPY', 'HARDLINK'].find{ it.equalsIgnoreCase(_args.action) } && extractedFiles?.size() > 0) {
		_log.info 'Clean temporary extracted files'
		// delete extracted files
        
		extractedFiles.each{

			if(it.isFile()) {
				_log.finest "Delete $it"
				it.delete()
			}
		}
		// delete remaining empty folders
		extractedFiles*.dir.unique().findAll{ it.listFiles().length == 0 }.each{
            if(it.isDirectory()) {
				_log.finest "Delete $it"
				it.delete()
			}
		}
	}
	
	// deleting remaining files only makes sense after moving files
	if ('MOVE'.equalsIgnoreCase(_args.action)) {
		_log.finest 'Clean clutter files and empty folders'
		include('fn:cleaner', [:], !args.empty ? args : ut_kind == 'multi' && ut_dir ? [ut_dir as File] : [])
	}
}

Re: filebot still detects using filename instead of dirname

Posted: 13 Mar 2013, 04:16
by rednoah
Looks good time me. Just check the output and maybe add some printlns to help you find the problem.