Force same genre folder for all movies of a collection

All about user-defined episode / movie / file name format expressions
Post Reply
OOmatrixOO
Posts: 10
Joined: 29 Jun 2014, 09:01

Force same genre folder for all movies of a collection

Post by OOmatrixOO »

Hi.
I want to sort all files according to genre/collection folders with TheMovieDB.

I use this:

Code: Select all

H:/{genres[0]}/{collection.upperInitial().replace('Reihe', 'Collection', 'Filmreihe', 'Collection', 'Serie', 'Collection')}/{n.upperInitial().replace(':', ' - ')} ({y}) {genres}
The Problem is, that movies in one collection have something different first genre.

Example The Blade Collection:
H:\Horror\Blade Collection\Blade (1998) [Horror, Action].mkv
H:\Science Fiction\Blade Collection\Blade II (2002) [Science Fiction, Horror, Action, Thriller].mkv
H:\Science Fiction\Blade Collection\Blade - Trinity (2004) [Science Fiction, Action, Horror, Thriller, Abenteuer, Fantasy].mkv

What can i do that all movies of an collection moves in the same folder?

Thaml you.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: specific genre folder

Post by rednoah »

Yeah, I don't have a solution for that...

In this specific case I'd just do this:

Code: Select all

{genres.sort()[0]}
Order genres alphabetically, hope that it somehow works out.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: specific genre folder

Post by rednoah »

Or this?

Code: Select all

{model.findAll{ it.collection == collection }.genres.flatten().countBy{it}.sort{it.value}.keySet().last()}
(if you can figure out how/why this one works you'll get a prize)
:idea: Please read the FAQ and How to Request Help.
OOmatrixOO
Posts: 10
Joined: 29 Jun 2014, 09:01

Re: specific genre folder

Post by OOmatrixOO »

Code: Select all

{genres.sort()[0]}
This doesnt work for me. Do I need to add anything else?

Code: Select all

{model.findAll{ it.collection == collection }.genres.flatten().countBy{it}.sort{it.value}.keySet().last()}
This is not perfect but ok.

Thanks.
Post Reply