From 38d170179df3ab4fbe68cac55f109d0d31be2abf Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 18 Jun 2017 20:42:24 +0800 Subject: [PATCH] Use Locale.US as default locale for TheMovieDB requests (because US is likely cached due to language preferences, while ENGLISH may not be) --- source/net/filebot/media/MediaDetection.java | 2 +- source/net/filebot/media/XattrMetaInfo.java | 2 +- source/net/filebot/ui/subtitle/upload/SubtitleUploadDialog.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/media/MediaDetection.java b/source/net/filebot/media/MediaDetection.java index 61a95800..c867ba1a 100644 --- a/source/net/filebot/media/MediaDetection.java +++ b/source/net/filebot/media/MediaDetection.java @@ -143,7 +143,7 @@ public class MediaDetection { // check for valid imdb id patterns return grepImdbId(file.getPath()).stream().map(Movie::new).filter(m -> { try { - return strict ? WebServices.TheMovieDB.getMovieDescriptor(m, Locale.ENGLISH).getId() > 0 : true; + return strict ? WebServices.TheMovieDB.getMovieDescriptor(m, Locale.US).getId() > 0 : true; } catch (Exception e) { return false; } diff --git a/source/net/filebot/media/XattrMetaInfo.java b/source/net/filebot/media/XattrMetaInfo.java index 4e4dbeee..91567c18 100644 --- a/source/net/filebot/media/XattrMetaInfo.java +++ b/source/net/filebot/media/XattrMetaInfo.java @@ -43,7 +43,7 @@ public class XattrMetaInfo { } else if (object instanceof Movie) { Movie movie = (Movie) object; if (movie.getYear() > 0 && movie.getTmdbId() > 0) { - SimpleDate releaseDate = WebServices.TheMovieDB.getMovieInfo(movie, Locale.ENGLISH, false).getReleased(); + SimpleDate releaseDate = WebServices.TheMovieDB.getMovieInfo(movie, Locale.US, false).getReleased(); if (releaseDate != null) { return releaseDate.getTimeStamp(); } diff --git a/source/net/filebot/ui/subtitle/upload/SubtitleUploadDialog.java b/source/net/filebot/ui/subtitle/upload/SubtitleUploadDialog.java index f08001ab..935c491d 100644 --- a/source/net/filebot/ui/subtitle/upload/SubtitleUploadDialog.java +++ b/source/net/filebot/ui/subtitle/upload/SubtitleUploadDialog.java @@ -180,7 +180,7 @@ public class SubtitleUploadDialog extends JDialog { Collection identity = MediaDetection.detectMovie(mapping.getVideo(), database, Locale.ENGLISH, true); for (Movie it : identity) { if (it.getImdbId() <= 0 && it.getTmdbId() > 0) { - it = WebServices.TheMovieDB.getMovieDescriptor(it, Locale.ENGLISH); + it = WebServices.TheMovieDB.getMovieDescriptor(it, Locale.US); } if (it != null && it.getImdbId() > 0) { mapping.setIdentity(it);