From 3f32c261dbd4d875209cfd4ca728f6e100b20351 Mon Sep 17 00:00:00 2001 From: da-anda Date: Thu, 14 Jan 2021 17:24:34 +0100 Subject: [Bugfix] re-add default message for "playStubFile" when no custom message is defined. Default got lost in #17940 --- addons/resource.language.en_gb/resources/strings.po | 6 ++++-- 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 node", item.GetPath().c_str()); + CLog::Log(LOGINFO, "No 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 -- cgit v1.2.3