Renaming Sports

All about user-defined episode / movie format expressions
Post Reply
b0ssem
Posts: 12
Joined: 20 Mar 2017, 07:56

Renaming Sports

Post by b0ssem » 07 Oct 2017, 09:06

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
NFL.2017.10.02.Washington.Redskins.VS.Kansas.City.Chiefs.720p.HDTV.x264-DHD

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.

Thanks!

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

Re: Renaming Sports

Post by rednoah » 11 Oct 2017, 09:03

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


EDIT:

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(' - ')
}
:idea: Please read the FAQ and How to Request Help.

b0ssem
Posts: 12
Joined: 20 Mar 2017, 07:56

Re: Renaming Sports

Post by b0ssem » 12 Oct 2017, 09:50

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?

Thanks!

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

Re: Renaming Sports

Post by rednoah » 12 Oct 2017, 10:06

There are many options. The post above explains how it works with the GUI, but the custom format still applies.


1.
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.


2.
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. ;)
:idea: Please read the FAQ and How to Request Help.

Post Reply