MovieProperty "year"?

All your suggestions, requests and ideas for future development
Post Reply
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

MovieProperty "year"?

Post by Yannik »

Why isn't there a MovieProperty "year"?

IMDB does return year (see http://www.omdbapi.com/?i=tt1287357) but it can't be used because its not in the MovieInfo. If release date is unknown (as in my example linked before), I can't even use the release date as year.

Apart from this, I cannot seem to see a way how to get Info on the Year of movie if you just have the movie id.
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

You mean {y} ???
: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: MovieProperty "year"?

Post by rednoah »

I'm pretty sure the {imdb} object contains the release date. I think if you just enter {imdb} in the editor it'll show you the a avilable properties. Maybe ReleaseDate, ReleaseYear or something.
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

No no, I mean when having a script like this:

Code: Select all

IMDBID = 1287357
movieObject = new net.sourceforge.filebot.web.Movie("", -1, IMDBID, -1)
movieInfo = net.sourceforge.filebot.WebServices.IMDb.getImdbApiMovieInfo(movieObject)
println movieInfo.getYear()
->
Aug 29, 2013 8:08:31 AM net.sourceforge.filebot.web.Date parse
WARNING: Unparseable date: "N/A"
MissingMethodException: No signature of method: net.sourceforge.filebot.web.TMDbClient$MovieInfo.getYear() is applicable for argument types: () values: []
Possible solutions: getAt(java.lang.String), getClass(), getCast(), getGenres(), getId(), getName()
groovy.lang.MissingMethodException: No signature of method: net.sourceforge.filebot.web.TMDbClient$MovieInfo.getYear() is applicable for argument types: () values: []
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

You're using this:
http://code.ohloh.net/file?fid=cCauLbWm ... =true#L211

So the method you're looking for is MovieInfo.getReleased().

But in your case you might wanna get the raw data not parsed into filebot objects:
http://code.ohloh.net/file?fid=cCauLbWm ... =true#L185

That one works by id or name/year.

PS: I seem to get your two threads mixed up. :D
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

Hi there,

sure I can just code a custom method. but wouldn't it be best to have it integrated in the getImdbApiMovieInfo() function of filebot?
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

There is something like the for the TMDb side which is used internally alot, look into TMDbClient.getMovieInfo. The IMDb stuff is not my primary datasource.
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

I also use TMDbClient.getMovieInfo as my primary data source, I only use IMDB if TMDB has no data for the specific movie. (See http://www.filebot.net/forums/viewtopic ... 5679#p5679)

So can you add it? I think many people use the process "Check TMDB"->"Use IMDB if TMDB has no data" and it's only a small addition ;-)
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

Yeah, but doesn't that already work with scripting. Two -rename --db tmdb/imdb calls should do it.

Looking at you hooking into my classes youre already far more advanced than that. :D
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

Yeah, I wrote my own script which creates some extra files for each movies etc.

Can you add the year property to IMDb.getImdbApiMovieInfo so I can flawlessly integrate it with TMDb.getMovieInfo?

Code: Select all

def getMovieInfo(movie,locale) {
   movieInfo = null
   if (!(movie.getTmdbId() > 0)) {
      try {
         movieInfo = net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, locale)
      } catch (FileNotFoundException e) {
         movieInfo = net.sourceforge.filebot.WebServices.IMDb.getImdbApiMovieInfo(movie)
      }
   } else {
      movieInfo = net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, locale)
   }
   return movieInfo
}
Thanks :-)
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

Tested via the format and this {imdb.released.year} works. TMDb.getMovieInfo and IMDb.getImdbApiMovieInfo both give you the same MovieInfo object so accessing movieInfo.released.year should work for both.
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

Yeah, but if no "released" date is set it doesn't work. See this for example: http://www.omdbapi.com/?i=tt1287357 - "Released: N/A" and "Year: 2008".

This is why I want the "year" property to be available in MovieInfo. Like this: {imdb.year}

Maybe this is a corner case, but it would still be great to be solved ;-)
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

I see. The priority is TheMovieDB and that always has a release date. Otherwise the original movie (search result) object should already have the year property that you can fall back to.
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

I don't have a movie object, only a IMDB-ID as an Integer.

The following patches should do it:

TMDbClient.java.new:

Code: Select all

*** TMDbClient.java     2013-08-27 15:30:00.912850459 +0200
--- TMDbClient.java.new 2013-09-03 13:27:44.539592534 +0200
***************
*** 296,302 ****
        public static class MovieInfo implements Serializable {

                public static enum MovieProperty {
!                       adult, backdrop_path, budget, homepage, id, imdb_id, original_title, overview, popularity, poster_path, release_date, revenue, runtime, tagline, title, vote_average, vote_count, certification, collection
                }

                protected Map<MovieProperty, String> fields;
--- 296,302 ----
        public static class MovieInfo implements Serializable {

                public static enum MovieProperty {
!                       adult, backdrop_path, budget, homepage, id, imdb_id, original_title, overview, popularity, poster_path, release_date, revenue, runtime, tagline, title, vote_average, vote_count, certification, collection, year
                }

                protected Map<MovieProperty, String> fields;
IMDbClient.java.new:

Code: Select all

*** IMDbClient.java     2013-08-27 15:30:00.912850459 +0200
--- IMDbClient.java.new 2013-09-03 13:28:47.000000000 +0200
***************
*** 218,223 ****
--- 218,224 ----
                }

                Map<MovieProperty, String> fields = new EnumMap<MovieProperty, String>(MovieProperty.class);
+               fields.put(MovieProperty.year, data.get("year"));
                fields.put(MovieProperty.title, data.get("title"));
                fields.put(MovieProperty.certification, data.get("rated"));
                fields.put(MovieProperty.runtime, data.get("runtime"));
Apply like this:

Code: Select all

patch -i TMDbClient.java.new
patch -i IMDbClient.java.new
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

I don't like that patch, but since it's so important I fixed it for you with r1709 the way i think is best. Basically it's trying to use release date if possible but falling back to the year field and then just using the year-01-01 as release date, so you'll can always use movieInfo.released.year
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

thanks
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

Actually, FileBot.jar in current HEAD does only seem to contain revision 1708?

Code: Select all

$java -jar FileBot.jar -version
FileBot 3.62 (r1708) / Java(TM) SE Runtime Environment 1.7.0_10
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

Uploaded it for u just now.
:idea: Please read the FAQ and How to Request Help.
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

thanks :-)
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

Another small thing I have noticed is, that you should check if released actually is a parsable date or atleast compress warnings as else this error is going to appear:

Code: Select all

Sep 03, 2013 5:10:11 PM net.sourceforge.filebot.web.Date parse
WARNING: Unparseable date: "N/A"
Sep 03, 2013 5:10:11 PM net.sourceforge.filebot.web.Date parse
WARNING: Unparseable date: "N/A"
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: MovieProperty "year"?

Post by Yannik »

Can you check that? Thanks :-)
User avatar
rednoah
The Source
Posts: 23003
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: MovieProperty "year"?

Post by rednoah »

I think I disabled those warnings in the recent revisions already.
:idea: Please read the FAQ and How to Request Help.
Post Reply