Match Single Genre Documentary Movies

All about user-defined episode / movie / file name format expressions
Post Reply
hama4reall
Posts: 23
Joined: 13 May 2023, 12:21

Match Single Genre Documentary Movies

Post by hama4reall »

Hi! I'm looking for a way to put documentary movies into a different folder but i would like to only match documentary that has only "Documentary" in there genre list, currently I'm using

Code: Select all

{ genres =~ /Documentary/ ? 'Documentary' : '' }
but I like to match Documentary Movies that talks about nature, rather than war & horror documentaries.
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Match Single Genre Documentary Movies

Post by rednoah »

:?: Can you provide a specific positive and a specific negative example? i.e. TMDB link for one movie that only has "Documentary" in the genre list, and another that has multiple genres?


In general, Conditional Structures (if-then-else) can be arbitrarily complex and check for multiple things if that's what you want:

Format: Select all

{ genres[0] == 'Documentary' && genres.size() == 1 ? 'Documentary' : 'Other Movie' }
:idea: Please read the FAQ and How to Request Help.
hama4reall
Posts: 23
Joined: 13 May 2023, 12:21

Re: Match Single Genre Documentary Movies

Post by hama4reall »

For example this movie
https://www.themoviedb.org/movie/576017-for-sama
Is should be a negative match, and this one
https://www.themoviedb.org/movie/10946-earth
Should be a positive match for the "Documentary" Folder.
User avatar
rednoah
The Source
Posts: 22999
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Match Single Genre Documentary Movies

Post by rednoah »

Cheers. The code above has been tested with the given movies and works as desired:

Format: Select all

{ genres[0] == 'Documentary' && genres.size() == 1 ? 'Documentary' : 'Other Movie' }
:idea: Please read the FAQ and How to Request Help.
hama4reall
Posts: 23
Joined: 13 May 2023, 12:21

Re: Match Single Genre Documentary Movies

Post by hama4reall »

Thanks a lot it works, amazing software it's like doing magic!
Post Reply