diff options
author | da-anda <da-anda@xbmc.org> | 2021-01-14 17:24:34 +0100 |
---|---|---|
committer | da-anda <da-anda@xbmc.org> | 2021-01-14 17:57:44 +0100 |
commit | 3f32c261dbd4d875209cfd4ca728f6e100b20351 (patch) | |
tree | 31312a602d145433d5740c56b7e52f433e6978c9 | |
parent | aecf662b642fef7fd8388135bd23d842094f0690 (diff) |
[Bugfix] re-add default message for "playStubFile" when no custom message is defined. Default got lost in #17940
-rw-r--r-- | addons/resource.language.en_gb/resources/strings.po | 6 | ||||
-rw-r--r-- | xbmc/storage/MediaManager.cpp | 14 |
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 6ef9804027..fd6df83b4d 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 |