Permalink
Browse files

Add locale arg to all metadata grabber to facilite grabbing locale sp…

…ecific information. Refs #10240

Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information...
Chris Oattes authored and stuartm committed Oct 6, 2012
1 parent 0a40fff commit f620f2f83607bb5c4c576a476646fec6164ca155
@@ -212,6 +212,8 @@ def main():
help=u"Display version and author")
parser.add_option( "-l", "--language", metavar="LANGUAGE", default=u'en', dest="language",
help=u"Select data that matches the specified language. At this time giantbomb.com only supports 'en' English.")
parser.add_option( "-a", "--area", metavar="AREA", default=u"gb", dest="area",
help=u"Select data that matches the specified country. This option is currently not used.")
parser.add_option( "-M", "--gamelist", action="store_true", default=False, dest="gamelist",
help=u"Get matching Movie list")
parser.add_option( "-D", "--gamedata", action="store_true", default=False, dest="gamedata",
@@ -450,6 +450,8 @@ MetadataLookupList MetadataDownload::handleGame(MetadataLookup* lookup)
QStringList args;
args.append(QString("-l")); // Language Flag
args.append(gCoreContext->GetLanguage()); // UI Language
args.append(QString("-a"));
args.append(gCoreContext->GetLocale()->GetCountryCode());
// If the inetref is populated, even in kLookupSearch mode,
// become a kLookupData grab and use that.
@@ -495,6 +497,9 @@ MetadataLookupList MetadataDownload::handleMovie(MetadataLookup* lookup)
args.append(QString("-l")); // Language Flag
args.append(gCoreContext->GetLanguage()); // UI Language
args.append(QString("-a"));
args.append(gCoreContext->GetLocale()->GetCountryCode());
// If the inetref is populated, even in kLookupSearch mode,
// become a kLookupData grab and use that.
if (lookup->GetStep() == kLookupSearch &&
@@ -532,6 +537,9 @@ MetadataLookupList MetadataDownload::handleTelevision(MetadataLookup* lookup)
QStringList args;
args.append(QString("-l")); // Language Flag
args.append(gCoreContext->GetLanguage()); // UI Language
args.append(QString("-a"));
args.append(gCoreContext->GetLocale()->GetCountryCode());
// If the inetref is populated, even in kLookupSearch mode,
// become a kLookupData grab and use that.
@@ -595,6 +603,10 @@ MetadataLookupList MetadataDownload::handleVideoUndetermined(
QStringList args;
args.append(QString("-l")); // Language Flag
args.append(gCoreContext->GetLanguage()); // UI Language
args.append(QString("-a"));
args.append(gCoreContext->GetLocale()->GetCountryCode());
args.append(QString("-N"));
if (!lookup->GetInetref().isEmpty())
{
@@ -634,6 +646,11 @@ MetadataLookupList MetadataDownload::handleRecordingGeneric(
args.append(QString("-l")); // Language Flag
args.append(gCoreContext->GetLanguage()); // UI Language
args.append(QString("-a"));
args.append(gCoreContext->GetLocale()->GetCountryCode());
args.append("-M");
QString title = lookup->GetTitle();
args.append(title);
@@ -554,6 +554,8 @@ def main():
help=u"Interaction mode (allows selection of a specific Movie or Person)")
parser.add_option( "-l", "--language", metavar="LANGUAGE", default=u'en', dest="language",
help=u"Select data that matches the specified language fall back to english if nothing found (e.g. 'es' Español, 'de' Deutsch ... etc)")
parser.add_option( "-a", "--area", metavar="COUNTRY", default=False, dest="country",
help=u"Select certificate data that matches the specified country (e.g. 'de' Germany, 'gb' UK ... etc)")
parser.add_option( "-M", "--movielist", action="store_true", default=False, dest="movielist",
help=u"Get matching Movie list")
parser.add_option( "-D", "--moviedata", action="store_true", default=False, dest="moviedata",
@@ -608,13 +610,18 @@ def main():
sys.stderr.write("! Error: There must be a non-empty argument, yours is empty.\n")
sys.exit(1)
passedLanguage = opts.language
if (opts.language and opts.country):
passedLanguage = opts.language + "-" + opts.country
Queries = moviedbQueries(apikey,
mythtv = True,
interactive = opts.interactive,
select_first = False,
debug = opts.debug,
custom_ui = None,
language = opts.language,
language = passedLanguage,
search_all_languages = False,)
# Display in XML format
@@ -155,6 +155,8 @@
Series)
-c FILE, --configure=FILE
Use configuration settings
-a COUNTRY, --area=COUNTRY
Select data that matches the specified country
-l LANGUAGE, --language=LANGUAGE
Select data that matches the specified language fall
back to english if nothing found (e.g. 'es' Español,
@@ -1150,6 +1152,8 @@ def main():
help=u"Use configuration settings")
parser.add_option( "-l", "--language", metavar="LANGUAGE", default=u'en', dest="language",
help=u"Select data that matches the specified language fall back to english if nothing found (e.g. 'es' Español, 'de' Deutsch ... etc)")
parser.add_option( "-a", "--area", metavar="COUNTRY", default=u'', dest="country",
help=u"Select data that matches the specificed country (e.g. 'de' Germany 'gb' UK). This option is currently not used.")
parser.add_option( "-n", "--num_seasons", action="store_true", default=False, dest="num_seasons",
help=u"Return the season numbers for a series")
parser.add_option( "-t", action="store_true", default=False, dest="test",

0 comments on commit f620f2f

Please sign in to comment.