* disable useCreationDate by default
* if useCreationDate is enabled set the movie release date, not just the year
This commit is contained in:
parent
d8c56c637a
commit
cf062bbe44
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
# use NTFS extended attributes for storing metadata
|
# use NTFS extended attributes for storing metadata
|
||||||
-DuseExtendedFileAttributes=true
|
-DuseExtendedFileAttributes=true
|
||||||
-DuseCreationDate=true
|
-DuseCreationDate=false
|
||||||
|
|
||||||
# look for native libs here
|
# look for native libs here
|
||||||
-Djna.library.path="%EXEDIR%"
|
-Djna.library.path="%EXEDIR%"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
# use NTFS extended attributes for storing metadata
|
# use NTFS extended attributes for storing metadata
|
||||||
-DuseExtendedFileAttributes=true
|
-DuseExtendedFileAttributes=true
|
||||||
-DuseCreationDate=true
|
-DuseCreationDate=false
|
||||||
|
|
||||||
# look for native libs here
|
# look for native libs here
|
||||||
-Djna.library.path="%EXEDIR%"
|
-Djna.library.path="%EXEDIR%"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
# use NTFS extended attributes for storing metadata
|
# use NTFS extended attributes for storing metadata
|
||||||
-DuseExtendedFileAttributes=true
|
-DuseExtendedFileAttributes=true
|
||||||
-DuseCreationDate=true
|
-DuseCreationDate=false
|
||||||
|
|
||||||
# look for native libs here
|
# look for native libs here
|
||||||
-Djna.library.path="%EXEDIR%"
|
-Djna.library.path="%EXEDIR%"
|
||||||
|
|
|
@ -202,7 +202,7 @@ public class MediaBindingBean {
|
||||||
@Define("primaryTitle")
|
@Define("primaryTitle")
|
||||||
public String getPrimaryTitle() throws Exception {
|
public String getPrimaryTitle() throws Exception {
|
||||||
if (infoObject instanceof Movie) {
|
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) {
|
if (infoObject instanceof Episode) {
|
||||||
|
@ -228,7 +228,7 @@ public class MediaBindingBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
// lookup IMDbID for TMDbID
|
// lookup IMDbID for TMDbID
|
||||||
tmdbid = WebServices.TMDb.getMovieInfo(getMovie(), null).getId();
|
tmdbid = WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH, false).getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
return String.valueOf(tmdbid);
|
return String.valueOf(tmdbid);
|
||||||
|
@ -244,7 +244,7 @@ public class MediaBindingBean {
|
||||||
}
|
}
|
||||||
|
|
||||||
// lookup IMDbID for TMDbID
|
// 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);
|
return String.format("tt%07d", imdbid);
|
||||||
|
@ -515,7 +515,7 @@ public class MediaBindingBean {
|
||||||
if (infoObject instanceof Episode)
|
if (infoObject instanceof Episode)
|
||||||
metaInfo = WebServices.TheTVDB.getSeriesInfoByName(((Episode) infoObject).getSeriesName(), Locale.ENGLISH);
|
metaInfo = WebServices.TheTVDB.getSeriesInfoByName(((Episode) infoObject).getSeriesName(), Locale.ENGLISH);
|
||||||
if (infoObject instanceof Movie)
|
if (infoObject instanceof Movie)
|
||||||
metaInfo = WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH);
|
metaInfo = WebServices.TMDb.getMovieInfo(getMovie(), Locale.ENGLISH, true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("Failed to retrieve metadata: " + infoObject, e);
|
throw new RuntimeException("Failed to retrieve metadata: " + infoObject, e);
|
||||||
}
|
}
|
||||||
|
@ -534,7 +534,7 @@ public class MediaBindingBean {
|
||||||
}
|
}
|
||||||
if (infoObject instanceof Movie) {
|
if (infoObject instanceof Movie) {
|
||||||
Movie m = getMovie();
|
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) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("Failed to retrieve metadata: " + infoObject, e);
|
throw new RuntimeException("Failed to retrieve metadata: " + infoObject, e);
|
||||||
|
|
|
@ -1390,8 +1390,9 @@ public class MediaDetection {
|
||||||
}
|
}
|
||||||
} else if (model instanceof Movie) {
|
} else if (model instanceof Movie) {
|
||||||
Movie movie = (Movie) model;
|
Movie movie = (Movie) model;
|
||||||
if (movie.getYear() > 0) {
|
if (movie.getYear() > 0 && movie.getTmdbId() > 0) {
|
||||||
xattr.setCreationDate(new Date(movie.getYear(), 1, 1).getTimeStamp());
|
Date releaseDate = WebServices.TMDb.getMovieInfo(movie, Locale.ENGLISH, false).getReleased();
|
||||||
|
xattr.setCreationDate(releaseDate.getTimeStamp());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -148,15 +148,15 @@ public class TMDbClient implements MovieIdentificationService {
|
||||||
throw new UnsupportedOperationException();
|
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) {
|
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) {
|
} 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 {
|
} else {
|
||||||
for (Movie result : searchMovie(movie.getName(), locale)) {
|
for (Movie result : searchMovie(movie.getName(), locale)) {
|
||||||
if (movie.getName().equalsIgnoreCase(result.getName()) && movie.getYear() == result.getYear()) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class TMDbClientTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getMovieInfo() throws Exception {
|
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("Transformers", movie.getName());
|
||||||
assertEquals("2007-07-02", movie.getReleased().toString());
|
assertEquals("2007-07-02", movie.getReleased().toString());
|
||||||
|
|
Loading…
Reference in New Issue