Genres from ThemovieDB not ordered correctly

All your suggestions, requests and ideas for future development
Post Reply
toxic0
Posts: 1
Joined: 08 Dec 2014, 15:45

Genres from ThemovieDB not ordered correctly

Post by toxic0 »

Using filebot 4.5.3 on a synology DS214+, I'm using it in console to rename my movies.
The issue is that with {genres[0]} the array of genres does not respect the order thas is displayed in TheMovieDB.

I noticed this since most of my movies have been moved into my "Action" genre folder, a lot of wich are really not primaraly action movies...

Please note that I'm using "lang=fr" since I'm french, and it nicely uses french genre names from TheMovieDB, a good point here.

Example with "Find Me Guilty (2006)" == "Jugez moi coupable (2006) :
TheMovieDB in french : https://www.themoviedb.org/movie/9950-find-me-guilty
Order is correct on the website : "Drame, Action, Comédie, Crime" : main genre is Drama, not perfect but way better than Action...

It seems that the {genres} array gets sorted alphabetically, that would explain why so many of my movies are sorted into my "Action" directory, since they all have "Action" as a "minor" genre...

I have tried using {imdb.genres[0]} instead, and the result is better, it shouts out "Biography" for the same example movie, but this time it's not beeing translated into French... I admit that even the french website of imdb does not translate the genre...

So, my main request is to fix the real issue here : the order of the genre array fetched from TheMovieDB should not be altered. Hopefully there is a genres.sort() functioncall somewhere in filebot that we could disable... I haven't checked the API from TheMovieDB to make sure they spit the list of genres in the correct order...

Another possibility for me would be to add some translating API to get the genre in french from the imdb.genres array, but that would be quite "ugly"...


Here is the output of "filebot -script fn:sysinfo" :

Code: Select all

FileBot 4.5.3 (r2729)
JNA Native: 4.0.0
MediaInfo: java.lang.UnsatisfiedLinkError: Unable to load library 'mediainfo': Native library (linux-arm/libmediainfo.so) not found in resourc
e path ([file:/volume1/@appstore/filebot/FileBot.jar])
7-Zip-JBinding: net.sf.sevenzipjbinding.SevenZipNativeInitializationException: Failed to load 7z-JBinding: no 7-Zip-JBinding in java.library.p
ath
chromaprint-tools: java.io.IOException: Cannot run program "fpcalc": error=2, No such file or directory
Extended Attributes: OK
Groovy Engine: 2.3.7
JRE: Java(TM) SE Embedded Runtime Environment 1.8.0 (headless)
JVM: 32-bit Java HotSpot(TM) Embedded Client VM
CPU/MEM: 2 Core / 245 MB Max Memory / 17 MB Used Memory
OS: Linux (arm)
uname: Linux Oneil 3.2.40 #5004 SMP Sat Nov 29 08:39:02 CST 2014 armv7l GNU/Linux synology_armadaxp_ds214+
Done ヾ(@⌒ー⌒@)ノ 
Here is the script I'm using :

Code: Select all

#!/opt/bin/bash
# uncomment the following to have bash output every command before executing it
# set -x

source=/volume1/downloads/toBeSorted
destination="/volume1/video/movies-filebot"

pattern="$destination/{genres[0]}/{movie} {imdbid}/{movie}"
pattern2="$destination/{imdb.genres[0]}/{movie} {imdbid}/{movie}"
options="--lang fr --db TheMovieDB"

# Run filebot
filebot --action test -rename "${source}" -r --format "${pattern}" $options

# Do some cleanup
#find $source -type d -name '*' -exec rmdir {} \;
#find $source -type d -name '*' -exec rmdir {} \;
#find $source -type d -name '*' -exec rmdir {} \;
User avatar
rednoah
The Source
Posts: 23005
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Genres from ThemovieDB not ordered correctly

Post by rednoah »

Don't confuse the website with the API. As far as I know the order of genres is unspecified. ;)

This is what the TheMovieDB returns:
http://pastebin.com/SmRCQ6b3

Looks like the API sorts things alphabetically, or there simply is no meaningful order to begin with.


PS: FileBot DOES NOT scrape IMDb website and the {imdb} will give you OMDB API data. You may consider the {imdb} binding deprecated.
:idea: Please read the FAQ and How to Request Help.
Post Reply