diff --git a/installer/msi/filebot.l4j.ini b/installer/msi/filebot.l4j.ini index 1ef696c5..940a7a65 100644 --- a/installer/msi/filebot.l4j.ini +++ b/installer/msi/filebot.l4j.ini @@ -15,7 +15,7 @@ # use NTFS extended attributes for storing metadata -DuseExtendedFileAttributes=true --DuseCreationDate=true +-DuseCreationDate=false # look for native libs here -Djna.library.path="%EXEDIR%" diff --git a/installer/msi/filebot.launcher.l4j.ini b/installer/msi/filebot.launcher.l4j.ini index 9b3ef836..90260b85 100644 --- a/installer/msi/filebot.launcher.l4j.ini +++ b/installer/msi/filebot.launcher.l4j.ini @@ -19,7 +19,7 @@ # use NTFS extended attributes for storing metadata -DuseExtendedFileAttributes=true --DuseCreationDate=true +-DuseCreationDate=false # look for native libs here -Djna.library.path="%EXEDIR%" diff --git a/installer/msi/filebot.platform.launcher.l4j.ini b/installer/msi/filebot.platform.launcher.l4j.ini index 80801e9b..1ccacbd0 100644 --- a/installer/msi/filebot.platform.launcher.l4j.ini +++ b/installer/msi/filebot.platform.launcher.l4j.ini @@ -23,7 +23,7 @@ # use NTFS extended attributes for storing metadata -DuseExtendedFileAttributes=true --DuseCreationDate=true +-DuseCreationDate=false # look for native libs here -Djna.library.path="%EXEDIR%" diff --git a/source/net/sourceforge/filebot/format/MediaBindingBean.java b/source/net/sourceforge/filebot/format/MediaBindingBean.java index b54ae54a..26423ca8 100644 --- a/source/net/sourceforge/filebot/format/MediaBindingBean.java +++ b/source/net/sourceforge/filebot/format/MediaBindingBean.java @@ -202,7 +202,7 @@ public class MediaBindingBean { @Define("primaryTitle") public String getPrimaryTitle() throws Exception { if (infoObject instanceof Movie) { - return WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH).getName(); + return WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH, false).getName(); } if (infoObject instanceof Episode) { @@ -228,7 +228,7 @@ public class MediaBindingBean { } // lookup IMDbID for TMDbID - tmdbid = WebServices.TMDb.getMovieInfo(getMovie(), null).getId(); + tmdbid = WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH, false).getId(); } return String.valueOf(tmdbid); @@ -244,7 +244,7 @@ public class MediaBindingBean { } // lookup IMDbID for TMDbID - imdbid = WebServices.TMDb.getMovieInfo(getMovie(), null).getImdbId(); + imdbid = WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH, false).getImdbId(); } return String.format("tt%07d", imdbid); @@ -515,7 +515,7 @@ public class MediaBindingBean { if (infoObject instanceof Episode) metaInfo = WebServices.TheTVDB.getSeriesInfoByName(((Episode) infoObject).getSeriesName(), Locale.ENGLISH); if (infoObject instanceof Movie) - metaInfo = WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH); + metaInfo = WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH, true); } catch (Exception e) { throw new RuntimeException("Failed to retrieve metadata: " + infoObject, e); } @@ -534,7 +534,7 @@ public class MediaBindingBean { } if (infoObject instanceof Movie) { Movie m = getMovie(); - data = WebServices.IMDb.getImdbApiMovieInfo(m.getImdbId() > 0 ? m : new Movie(null, -1, WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH).getImdbId(), -1)); + data = WebServices.IMDb.getImdbApiMovieInfo(m.getImdbId() > 0 ? m : new Movie(null, -1, WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH, false).getImdbId(), -1)); } } catch (Exception e) { throw new RuntimeException("Failed to retrieve metadata: " + infoObject, e); diff --git a/source/net/sourceforge/filebot/media/MediaDetection.java b/source/net/sourceforge/filebot/media/MediaDetection.java index 7208cbe9..7fcfb2de 100644 --- a/source/net/sourceforge/filebot/media/MediaDetection.java +++ b/source/net/sourceforge/filebot/media/MediaDetection.java @@ -1390,8 +1390,9 @@ public class MediaDetection { } } else if (model instanceof Movie) { Movie movie = (Movie) model; - if (movie.getYear() > 0) { - xattr.setCreationDate(new Date(movie.getYear(), 1, 1).getTimeStamp()); + if (movie.getYear() > 0 && movie.getTmdbId() > 0) { + Date releaseDate = WebServices.TMDb.getMovieInfo(movie, Locale.ENGLISH, false).getReleased(); + xattr.setCreationDate(releaseDate.getTimeStamp()); } } } catch (Exception e) { diff --git a/source/net/sourceforge/filebot/web/TMDbClient.java b/source/net/sourceforge/filebot/web/TMDbClient.java index be8c01f0..7fc7b8ad 100644 --- a/source/net/sourceforge/filebot/web/TMDbClient.java +++ b/source/net/sourceforge/filebot/web/TMDbClient.java @@ -148,15 +148,15 @@ public class TMDbClient implements MovieIdentificationService { throw new UnsupportedOperationException(); } - public MovieInfo getMovieInfo(Movie movie, Locale locale) throws IOException { + public MovieInfo getMovieInfo(Movie movie, Locale locale, boolean extendedInfo) throws IOException { if (movie.getTmdbId() >= 0) { - return getMovieInfo(String.valueOf(movie.getTmdbId()), locale, true, true); + return getMovieInfo(String.valueOf(movie.getTmdbId()), locale, extendedInfo, extendedInfo); } else if (movie.getImdbId() >= 0) { - return getMovieInfo(String.format("tt%07d", movie.getImdbId()), locale, true, true); + return getMovieInfo(String.format("tt%07d", movie.getImdbId()), locale, extendedInfo, extendedInfo); } else { for (Movie result : searchMovie(movie.getName(), locale)) { if (movie.getName().equalsIgnoreCase(result.getName()) && movie.getYear() == result.getYear()) { - return getMovieInfo(String.valueOf(result.getTmdbId()), locale, true, true); + return getMovieInfo(String.valueOf(result.getTmdbId()), locale, extendedInfo, extendedInfo); } } } diff --git a/test/net/sourceforge/filebot/web/TMDbClientTest.java b/test/net/sourceforge/filebot/web/TMDbClientTest.java index 3bef9689..4802ed5f 100644 --- a/test/net/sourceforge/filebot/web/TMDbClientTest.java +++ b/test/net/sourceforge/filebot/web/TMDbClientTest.java @@ -49,7 +49,7 @@ public class TMDbClientTest { @Test public void getMovieInfo() throws Exception { - MovieInfo movie = tmdb.getMovieInfo(new Movie(null, 0, 418279, -1), Locale.ENGLISH); + MovieInfo movie = tmdb.getMovieInfo(new Movie(null, 0, 418279, -1), Locale.ENGLISH, true); assertEquals("Transformers", movie.getName()); assertEquals("2007-07-02", movie.getReleased().toString());