Putting The, at the end of a file name with The at the beginning of the title?

All your suggestions, requests and ideas for future development
Post Reply
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Putting The, at the end of a file name with The at the beginning of the title?

Post by boe »

I think it can already do this but I don't know how. Can someone tell me how to move the location of "The" from the beginning of a file name?
For example if I have:

The Rock (1996).mkv
The Rundown (2003).mkv

I would like the file names to be:
Rock, The (1996).mkv
Rundown, The (2003).mkv

Thanks
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by boe »

Fantastic! Thanks!

Code: Select all

{n.sortName('$2, $1')} ({y}){subt}
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by boe »

Sorry - I thought I got it but I would like to do the same for TV shows. Currently I'm using
{ny}/Season {s} ({episodelist.findAll{it.season == s}.airdate.year.min()})/{n} - {s00e00} - {t} {vf} but I want the TV show top folder to have THE in the title at the end. E.g. Exorcist, The (2016)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by rednoah »

You can use this snippet in your episode format as well:

Code: Select all

{n.sortName('$2, $1')} ({y})
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by boe »

Thanks - sorry I don't understand. Can you give me the full line based on - {ny}/Season {s} ({episodelist.findAll{it.season == s}.airdate.year.min()})/{n} - {s00e00} - {t} {vf} - I have no idea where that code goes in for {n.sortName('$2, $1')} ({y})
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by rednoah »

This is the default name/year binding:

Code: Select all

{ny}
This is your special name/year expression:

Code: Select all

{n.sortName('$2, $1')} ({y})
Use the GUI Format Editor to play with it. It'll take you seconds to figure it out by yourself via trial and error even if you have no idea what you're doing. ;)
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by boe »

For anyone interested - I tried
{n.sortName('$2, $1')}/Season {s} ({episodelist.findAll{it.season == s}.airdate.year.min()})/{n} - {s00e00} - {t} {vf} - that doesn't work

I tried {n.sortName('$2, $1')} ({y})/Season {s} ({episodelist.findAll{it.season == s}.airdate.year.min()})/{n} - {s00e00} - {t} {vf} - that works.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by boe »

Hello,

I recently reformatted my computer and messed up something on my TV show formula. I use filebot to fix the details, rename the file and move it to the correct folder.
I tried this G:/TVCurrent/{n.replaceTrailingBrackets().sortName('$2, $1')} ({y}) /Season {s} ({episodelist.findAll{it.season == s}.airdate.year.min()})/{n} - {s00e00} - {t} {vf}

And I got an xml error
http://imgur.com/a/KzCxu
Image

I notice the code works with the TVMaze data source but no longer with theTVDB which I had been using in the past. Unfortunately for whatever reason the naming is slightly off if I use TVMaze. Strangely it also works on some series such as If I choose The flash with no date or The Flash (1967) just not the 2014 series
ZeroByDivide
Posts: 170
Joined: 16 Dec 2014, 01:39

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by ZeroByDivide »

That's because TVDB's xml is messed up for a lot of shows, has been going on like this for at least a week now.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: Putting The, at the end of a file name with The at the beginning of the title?

Post by boe »

Good to know - I thought it was because of some typo in my code when I reformatted my computer.
Post Reply