Is there a way to get the genre of a collection?

Any questions? Need some help?
Post Reply
Punt
Posts: 3
Joined: 05 Jun 2019, 08:12

Is there a way to get the genre of a collection?

Post by Punt » 05 Jun 2019, 10:57

Title.

For example, I have
  • The Matrix 1999 (genre=Action)
  • The Matrix Roloaded 2003 (genre=Adventure)
  • The Matrix Revolutions 2003 (genre= Adventure)
Is it possible to order my films like
  • Films/Genre/ all films (less collection films)
  • Films/Genre/CollectionName/collection films
So that for example for Matrix it would be
Films/Adventure/TheMatrixCollection/ the 3 films

Because if I just use {genre}
it would be the genre of the film, and so The Matrix 1999 would be in /Action/TheMatrixCollection and the other two would be in /Adventure/TheMatrixCollection ...


+ Quick question : Is it possible to order alphabetically {audioLanguages} ? Because sometimes I get [fra, eng] and sometimes [eng, fra].

Thanks!

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

Re: Is there a way to get the genre of a collection?

Post by rednoah » 05 Jun 2019, 11:28

1.
I'm pretty sure TheMovieDB doesn't have metadata like that for collections.

If you process the complete collection in one go, then you could use the {model} to just use the {genre} of the first related match:

Code: Select all

{model.find{ it.collection == collection }.genre}
:arrow: viewtopic.php?t=9814


2.
Sort audioLanguages using natural order:

Code: Select all

{audioLanguages.toSorted()}
:idea: Please read the FAQ and How to Request Help.

Punt
Posts: 3
Joined: 05 Jun 2019, 08:12

Re: Is there a way to get the genre of a collection?

Post by Punt » 05 Jun 2019, 11:50

Thanks for your quick answer.

The {model} is doing the job.
But not .toSorted() ...

I have

Code: Select all

Films/
{any{model.find{ it.collection == collection }.genre}{genre}}/
{collection}/
{audioLanguages.toSorted()} {ny.upperInitial()} - {vf}.{channels}.sub{textLanguages.toSorted()}.{ext}
As you can see, there's still a problem :
Image

Edit:

I tried with an order :

Code: Select all

{
	def langueOrder = ['eng': 1, 'fra': 2]
	audioLanguages.toSorted{ langueOrder[it] }
}
And result :

Image

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

Re: Is there a way to get the genre of a collection?

Post by rednoah » 05 Jun 2019, 15:05

Not sure what's going on there.

I guess explicitly sorting by 3-letter language code will work more reliably:

Code: Select all

{audioLanguages.toSorted{ it.ISO3 }}
:idea: Using a custom priority map as sort order makes sense though. Since you probably want custom sort order of languages, rather than plain alphabetic sort order.
:idea: Please read the FAQ and How to Request Help.

Punt
Posts: 3
Joined: 05 Jun 2019, 08:12

Re: Is there a way to get the genre of a collection?

Post by Punt » 06 Jun 2019, 23:45

Thanks! ISO3 did the job.
I'm happy with my current films collection, I used :

Code: Select all

Films/
{any{'Marvel Studios' in info.productionCompanies ? 'Marvel Movie' : null}{model.find{ it.collection == collection }.genre}{genre}}/
{collection}/
{ny.upperInitial()} {audioLanguages.toSorted{it.ISO3}} - {vf}.{channels}.sub{textLanguages.toSorted{it.ISO3}}.{ext}
I feel like collection's genre could be better, and that would cool if we could choose a list of favorite genres because...
Image
There's a lot of genres haha.

While trying to find a good format, I had some trouble to match a local film with a TheMovieDb film. I was trying to have something like the year first {y} then {audioLanguages} (ex: (2018) [fra,eng] movieName) and guess it had trouble using movies' name with with the previous information.

I think it could be a good idea to have a place where we could share some tips about this tool, so that people don't waste time trying to use the tool! If I had read a tip like "By passing the name of a movie at the very beggining of your format, It'll help the tool -in the future- to directly re-match movies with TheMovieDb" it would have win me some time lol.

But in the end, super cool tool! I was like "Well, my film collection is a big mess. Maybe I'll try to develop a tool to reformate the name and try to order film by genre or something like that." Then I found FileBot. Thanks for the good work!

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

Re: Is there a way to get the genre of a collection?

Post by rednoah » 07 Jun 2019, 03:39

1.
Customizing and prioritizing genres can be done. It’s a bit more code-y though.

:arrow: viewtopic.php?f=10&t=6068#p34992


2.
Since FileBot will store xattr metadata, FileBot will always be able to identify the file later regardless of the filename. Good naming is always a great good idea though.

:arrow: viewtopic.php?f=3&t=324#p2248
:idea: Please read the FAQ and How to Request Help.

Post Reply