aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Blake <oak99sky@yahoo.co.uk>2021-01-15 10:54:48 +0000
committerGitHub <noreply@github.com>2021-01-15 10:54:48 +0000
commit53fd5ef8b64e4d2d6494c11938a5b68026700523 (patch)
tree0ca90b73c631bd5948b516b8bbd7327794b12ad9
parent6995aad7c37d2a5c2bff7c8d6b1ab0e4ad315963 (diff)
parent3f32c261dbd4d875209cfd4ca728f6e100b20351 (diff)
Merge pull request #19063 from da-anda/fix-stubfile-dialog
[Bugfix] re-add default message for "playStubFile"
-rw-r--r--addons/resource.language.en_gb/resources/strings.po6
-rw-r--r--xbmc/storage/MediaManager.cpp14
2 files changed, 13 insertions, 7 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 9f9e64308e..c12198109c 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -2039,14 +2039,16 @@ msgctxt "#434"
msgid "From {0:s} at {1:d} {2:s}"
msgstr ""
+#. Headline of a dialog that pops up when a user tries to play a video that is located on an optical disc (Blu-ray, DVD) but the current KODI device doesn't have the according drive
#: xbmc/Application.cpp
msgctxt "#435"
msgid "No optical disc drive detected"
msgstr ""
-#: xbmc/Application.cpp
+#. Message body of a dialog that pops up when a user tries to play a video that is located on an optical disc (Blu-ray, DVD) but the current KODI device doesn't have the according drive
+#: xbmc/storage/MediaManager.cpp
msgctxt "#436"
-msgid "You need an optical disc drive to play this video"
+msgid "This video is stored on an optical disc (e.g. DVD, Blu-ray) and cannot be played as your device does not have an appropriate drive."
msgstr ""
msgctxt "#437"
diff --git a/xbmc/storage/MediaManager.cpp b/xbmc/storage/MediaManager.cpp
index f975294ec1..f1bb23f099 100644
--- a/xbmc/storage/MediaManager.cpp
+++ b/xbmc/storage/MediaManager.cpp
@@ -767,23 +767,27 @@ bool CMediaManager::playStubFile(const CFileItem& item)
{
// Figure out Lines 1 and 2 of the dialog
std::string strLine1, strLine2;
+
+ // use generic message by default
+ strLine1 = g_localizeStrings.Get(435).c_str();
+ strLine2 = g_localizeStrings.Get(436).c_str();
+
CXBMCTinyXML discStubXML;
if (discStubXML.LoadFile(item.GetPath()))
{
TiXmlElement* pRootElement = discStubXML.RootElement();
if (!pRootElement || StringUtils::CompareNoCase(pRootElement->Value(), "discstub") != 0)
- CLog::Log(LOGERROR, "Error loading %s, no <discstub> node", item.GetPath().c_str());
+ CLog::Log(LOGINFO, "No <discstub> node found for %s. Using default info dialog message", item.GetPath().c_str());
else
{
XMLUtils::GetString(pRootElement, "title", strLine1);
XMLUtils::GetString(pRootElement, "message", strLine2);
+ // no title? use the label of the CFileItem as line 1
+ if (strLine1.empty())
+ strLine1 = item.GetLabel();
}
}
- // Use the label for Line 1 if not defined
- if (strLine1.empty())
- strLine1 = item.GetLabel();
-
if (HasOpticalDrive())
{
#ifdef HAS_DVD_DRIVE