Adding language

This commit is contained in:
jhouse
2020-01-15 14:39:53 +09:00
parent 9a7b529da4
commit b248fa869c
3 changed files with 4 additions and 10 deletions
@@ -428,12 +428,6 @@ public class GapsSearchService implements GapsSearch {
OwnedMovie ownedMovie;
String language = null;
//Movie searchMovie = new Movie.Builder(title, year).build();
/*int indexOfMovie = everyMovie.indexOf(searchMovie);
if (indexOfMovie != -1) {
LOGGER.debug("Using existing movie information");
movie = everyMovie.get(indexOfMovie);
} else {*/
if (guid.contains("com.plexapp.agents.themoviedb")) {
//ToDo
//Find out what it looks like in TMDB
@@ -442,16 +436,13 @@ public class GapsSearchService implements GapsSearch {
ownedMovie = new OwnedMovie(title, year, thumbnail, Integer.parseInt(guid), null, language);
} else if (guid.contains("com.plexapp.agents.imdb://")) {
language = guid.substring(guid.indexOf("?lang=") + "?lang=".length());
LOGGER.info("language:" + language);
language = new Locale(language, "").getDisplayLanguage();
guid = guid.substring(guid.indexOf(ID_IDX_START) + ID_IDX_START.length(), guid.indexOf(ID_IDX_END));
ownedMovie = new OwnedMovie(title, year, thumbnail, -1, guid, language);
} else {
LOGGER.warn("Cannot handle guid value of " + guid);
ownedMovie = new OwnedMovie(title, year, thumbnail, -1, null, language);
}
/*}*/
LOGGER.debug("guid:" + guid);
ownedMovies.add(ownedMovie);
totalMovieCount.incrementAndGet();
@@ -210,6 +210,8 @@ public class IoService {
}
public void writeOwnedMoviesToFile(Set<OwnedMovie> movies, File file) {
LOGGER.info("movies: " + movies);
if (file.exists()) {
boolean deleted = file.delete();
if (!deleted) {