Rename Method - Copy Action triggering Move

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
resudafox
Posts: 2
Joined: 03 Mar 2017, 02:29

Rename Method - Copy Action triggering Move

Post by resudafox »

OS: Windows 8.1
Filebot Version: 4.7.8
Command used to call the script: filebot -script F:\Media\ProcessSeriesFolder.groovy "<Directory>"

Greetings,

I wanted to ask a quick question regarding the rename method. I have this pretty simple script that renames and copies series to an external drive and then fetches the subtitles, if any, from opensubtitles.

Since the last update I noticed the script stopped copying and started moving the files to the destination folder. Here is what the log reads

Code: Select all

Rename episodes using [TheTVDB]
Fetching episode data for [The Flash (2014)]
[MOVE] From [C:\Downloads\Completed\The.Flash.2014.S03E13.720p.HDTV.X264-DIMENSI
ON[rarbg]\The Flash (2014) - 3x13.mkv] to [F:\Media\Series\The Flash (2014)\Seas
on 3\The Flash (2014) - 3x13 - Attack on Gorilla City (1).mkv]
Processed 1 files
I'm calling the rename method in the following manner:

Code: Select all

rename (file:videos, action:'copy', output:destinationFolder, db:'TheTVDB', query:series, strict:false)
Here is the complete script:

Code: Select all

args.eachMediaFolder{ dir ->

	def mediaFolder = "F:\\Media\\Series"
	def videos = dir.listFiles{ it.isVideo() }
	def query = _args.query ?: detectSeriesName(videos)
	def sxe = videos.findResult{ parseEpisodeNumber(it) }
	
	if (query == null) {
		query = dir.dir.hasFile{ it.name =~ /Season/ && it.isDirectory() } ? dir.dir.name : dir.name
	}
	
	println "$dir => Search by $query"
	def options = TheTVDB.search(query, Locale.ENGLISH)
	if (options.isEmpty()) {
		println "TV Series not found: $query"
		return
	}
	
	// sort by relevance
	options = options.sortBySimilarity(query, { it.name })
	
	// auto-select series
	def series = options[0]
	
	// auto-detect season
	def season = sxe && sxe.season > 0 ? sxe.season : 1
	
	def destinationFolder = "$mediaFolder\\$series\\Season $season"
	rename (file:videos, action:'copy', output:destinationFolder, db:'TheTVDB', query:series, strict:false)
	getSubtitles(folder:destinationFolder,db:'opensubtitles',query:'series',lang:'English')
}
Any help provided is appreciated!

Thanks!
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Rename Method - Copy Action triggering Move

Post by rednoah »

I see. I can confirm the issue. Looks like the --action command-line parameter always takes precedence.

Fixed with r4893.
:idea: Please read the FAQ and How to Request Help.
resudafox
Posts: 2
Joined: 03 Mar 2017, 02:29

Re: Rename Method - Copy Action triggering Move

Post by resudafox »

Thanks! After copying the corresponding jar the issue was fixed. :-D
Post Reply