diff --git a/resources/lib/itemtypes/movies_tmdb.py b/resources/lib/itemtypes/movies_tmdb.py deleted file mode 100644 index 05f4e6da..00000000 --- a/resources/lib/itemtypes/movies_tmdb.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -import logging -import os -import sys - -import xbmcvfs -import xbmcaddon - -# Import the existing Kodi add-on metadata.themoviedb.org.python -__ADDON__ = xbmcaddon.Addon(id='metadata.themoviedb.org.python') -__TEMP_PATH__ = os.path.join(__ADDON__.getAddonInfo('path'), 'python', 'lib') -__BASE__ = xbmcvfs.translatePath(__TEMP_PATH__) -sys.path.append(__BASE__) -import tmdbscraper.tmdb as tmdb - -logger = logging.getLogger('PLEX.movies_tmdb') - - -def get_tmdb_scraper(settings): - language = settings.getSettingString('language') - certcountry = settings.getSettingString('tmdbcertcountry') - return tmdb.TMDBMovieScraper(__ADDON__, language, certcountry) - - -# Instantiate once in order to prevent having to re-read the add-on settings -# for every single movie -__SCRAPER__ = get_tmdb_scraper(__ADDON__) - -def get_tmdb_details(unique_ids): - details = __SCRAPER__.get_details(unique_ids) - if 'error' in details: - logger.debug('Could not get tmdb details for %s. Error: %s', - unique_ids, details) - return details diff --git a/resources/lib/library_sync/additional_metadata_tmdb.py b/resources/lib/library_sync/additional_metadata_tmdb.py index 4afec456..c68e5714 100644 --- a/resources/lib/library_sync/additional_metadata_tmdb.py +++ b/resources/lib/library_sync/additional_metadata_tmdb.py @@ -27,7 +27,13 @@ TMDB_SUPPORTED_IDS = ('tmdb', 'imdb') def get_tmdb_scraper(settings): language = settings.getSettingString('language') certcountry = settings.getSettingString('tmdbcertcountry') - return tmdb.TMDBMovieScraper(settings, language, certcountry) + # Simplify this in the future + # See https://github.com/croneter/PlexKodiConnect/issues/1657 + search_language = settings.getSettingString('searchlanguage') + if search_language: + return tmdb.TMDBMovieScraper(settings, language, certcountry, search_language) + else: + return tmdb.TMDBMovieScraper(settings, language, certcountry) def get_tmdb_details(unique_ids):