MovieProperty "year"?
MovieProperty "year"?
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.
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.
Re: MovieProperty "year"?
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.
Re: MovieProperty "year"?
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: []
Re: MovieProperty "year"?
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.
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.

Re: MovieProperty "year"?
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?
sure I can just code a custom method. but wouldn't it be best to have it integrated in the getImdbApiMovieInfo() function of filebot?
Re: MovieProperty "year"?
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.
Re: MovieProperty "year"?
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
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

Re: MovieProperty "year"?
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.
Looking at you hooking into my classes youre already far more advanced than that.

Re: MovieProperty "year"?
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?
Thanks 
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
}

Re: MovieProperty "year"?
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.
Re: MovieProperty "year"?
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
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

Re: MovieProperty "year"?
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.
Re: MovieProperty "year"?
I don't have a movie object, only a IMDB-ID as an Integer.
The following patches should do it:
TMDbClient.java.new:
IMDbClient.java.new:
Apply like this:
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;
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"));
Code: Select all
patch -i TMDbClient.java.new
patch -i IMDbClient.java.new
Re: MovieProperty "year"?
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
Re: MovieProperty "year"?
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
Re: MovieProperty "year"?
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"
Re: MovieProperty "year"?
Can you check that? Thanks 

Re: MovieProperty "year"?
I think I disabled those warnings in the recent revisions already.