AMC Python Scrip Change Default Db?

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
INUlobo
Posts: 2
Joined: 17 Mar 2019, 17:08

AMC Python Scrip Change Default Db?

Post by INUlobo »

Is it possible to change the default renaming database? I know in command line you can just do --db TVMaze. I am not the greatest with python so any help would be great.

Code: Select all

import sys
import subprocess


# configuration
output = 'F:\_SortingEpisodes'


# custom formats (use / instead of \ as directory separator)
movieFormat  = 'F:/_SortingMovies/{y} - {n} {genres}/{y} - {n} {genres}'
seriesFormat = 'G:/_NewEpisodes/TV Series - {n}/{n} (Season {s.pad(2)})/{n} - {s00e00} - {t}'
#animeFormat  = 'E:/_Drop/TV Series - {n}/{n} (Season {s.pad(2)})/{n} - {s00e00} - {t}'
musicFormat  = '''{plex}'''


# required args
label, state, title, kind, file, directory = sys.argv[1:7]


command = [
	'filebot', '-script', 'fn:amc',
	'--output', output,
	'--action', 'duplicate',
	'--conflict', 'skip',
	'-non-strict',
	'--log-file', output + '/amc.log',
	'--def',
		'unsorted=n',
		'music=n',
		'artwork=n',
		'subtitles=en',
		'movieFormat='  + movieFormat,
		'seriesFormat=' + seriesFormat,
		#'animeFormat='  + animeFormat,
		'musicFormat='  + musicFormat,
		'ut_label=' + label,
		'ut_state=' + state,
		'ut_title=' + title,
		'ut_kind='  + kind,
		'ut_file='  + file,
		'ut_dir='   + directory
]


# execute command only for certain conditions (disabled by default)
'''
if state not in ['5', '11']:
	print('Illegal state: %s' % state)
	sys.exit(0)
'''


# execute command (and hide cmd window)
subprocess.run(command, creationflags=0x08000000)
User avatar
rednoah
The Source
Posts: 19011
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC Python Scrip Change Default Db?

Post by rednoah »

Yes, you can use --def seriesDB for that.


:idea: It's a recently added option, so you will need use the latest FileBot 4.9.0 (beta) for that.
:idea: Please read the FAQ and How to Request Help.
Post Reply