Skip to content

Commit

Permalink
[addons] repo add-ons can not have any dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
howie-f committed Aug 30, 2020
1 parent a3d5f73 commit 8400749
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 5 additions & 1 deletion addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -15336,7 +15336,11 @@ msgctxt "#24087"
msgid "All repositories"
msgstr ""

#empty string with id 24088
#. Used as a text in the progress dialog when install of a repo fails
#: xbmc/addons/AddonInstaller.cpp
msgctxt "#24088"
msgid "Failed to install repository"
msgstr ""

msgctxt "#24089"
msgid "Add-on restarts"
Expand Down
14 changes: 12 additions & 2 deletions xbmc/addons/AddonInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,19 @@ bool CAddonInstallJob::DoFileOperation(FileAction action, CFileItemList &items,

bool CAddonInstallJob::Install(const std::string &installFrom, const RepositoryPtr& repo)
{
SetText(g_localizeStrings.Get(24079));
auto deps = m_addon->GetDependencies();
const auto& deps = m_addon->GetDependencies();

if (!deps.empty() && m_addon->HasType(ADDON_REPOSITORY))
{
CLog::Log(
LOGERROR,
"CAddonInstallJob::{}: failed to install repository [{}]. It has dependencies defined",
__func__, m_addon->ID());
ReportInstallError(m_addon->ID(), m_addon->ID(), g_localizeStrings.Get(24088));
return false;
}

SetText(g_localizeStrings.Get(24079));
unsigned int totalSteps = static_cast<unsigned int>(deps.size()) + 1;
if (ShouldCancel(0, totalSteps))
return false;
Expand Down

0 comments on commit 8400749

Please sign in to comment.