Page 1 of 1

Renaming Sports

Posted: 07 Oct 2017, 09:06
by b0ssem
Helly guys,

I have some sport episodes that i want to rename. The metadata for them are not in thetvdb etc, so they cant be found and renamed by that. So i was wondering if there is some other way to automatically rename them.

At the moment im using simple command line to rename my other shows and movies

Code: Select all

filebot -script fn:amc -rename --output N:\Done --format {plex[1]}/{plex[3]} --action copy -non-strict "N:\TV-IN" --log-file amc.log --def skipExtract=y --def excludeList=amc.txt
But i need something that will rename my sport shows also.

The original name looks like this

The output format i wish to have is this
NFL - 2017-10-02 - Washington Redskins vs Kansas City Chiefs

Is there any way to accomplish this? If so please come with some examples.


Re: Renaming Sports

Posted: 11 Oct 2017, 09:03
by rednoah
FileBot does have support for generic batch renaming, but it's not something that works out-of-the-box like with movies and episodes.

Since all the information is already in the original filename, you could parse and rearrange the bits and pieces of the filename via a custom format. Basic Groovy / Regex skills are required.

@see viewtopic.php?t=2072


e.g. test case:

Code: Select all

	def string = 'NFL.2017.10.02.Washington.Redskins.VS.Kansas.City.Chiefs.720p.HDTV.x264-DHD'
	def match = string =~ /^(.+).(\d{4}.\d{2}.\d{2}).(.+).(?:\d{3,4}p)/

	def name = match[0][1]
	def date = match[0][2]
	def title = match[0][3].space(' ').replace('VS', 'vs')

	return [name, date, title].join(' - ')

Re: Renaming Sports

Posted: 12 Oct 2017, 09:50
by b0ssem
Thanks rednoah, great support as always!

Sorry for the noob questions, i try to read other posts and stuff on the forum. But some things i still dont really understand.

So how do i define that this regex ONLY should be used for this specific files? I have TV-Shows, movies and sports. How can i define that this pattern should only be applied on my sports?


Re: Renaming Sports

Posted: 12 Oct 2017, 10:06
by rednoah
There are many options. The post above explains how it works with the GUI, but the custom format still applies.

Have your own script decide what files are sports (according to your own logic) and then call filebot with custom options for sports (i.e. with --db xattr -non-strict option which allows you to process generic files) or call the amc script as usual.

If you just want to use the amc script, then you could use the --def unsortedFormat option for your sports / unsorted format logic. In this case you'd have to pass in --def ut_label=other to make sure files fall through auto-detection and get processed with the unsorted format. You'd also have to make sure that your unsorted format works for sports files as well as gracefully dealing with non-sports unsorted files.

Either way. Some command-line skills will be required. Things probably won't work out of the box without a bit of trial and error. ;)