//TODO handle all 'default' cases here, not just scrapers & vizs bool CAddonMgr::GetDefault(const TYPE &type, AddonPtr &addon) { CStdString setting; switch (type) { case ADDON_VIZ: setting = g_guiSettings.GetString("musicplayer.visualisation"); break; case ADDON_SCREENSAVER: setting = g_guiSettings.GetString("screensaver.mode"); break; case ADDON_SCRAPER_ALBUMS: setting = g_guiSettings.GetString("musiclibrary.albumsscraper"); break; case ADDON_SCRAPER_ARTISTS: setting = g_guiSettings.GetString("musiclibrary.artistsscraper"); break; case ADDON_SCRAPER_MOVIES: setting = g_guiSettings.GetString("scrapers.moviesdefault"); break; case ADDON_SCRAPER_MUSICVIDEOS: setting = g_guiSettings.GetString("scrapers.musicvideosdefault"); break; case ADDON_SCRAPER_TVSHOWS: setting = g_guiSettings.GetString("scrapers.tvshowsdefault"); break; case ADDON_WEB_INTERFACE: setting = g_guiSettings.GetString("services.webskin"); break; default: return false; } return GetAddon(setting, addon, type); }
CStdString CAddonMgr::GetString(const CStdString &id, const int number) { AddonPtr addon; if (GetAddon(id, addon)) return addon->GetString(number); return ""; }
void CRepositoryUpdater::CheckForUpdates(const ADDON::RepositoryPtr& repo, bool showProgress) { CSingleLock lock(m_criticalSection); auto job = std::find_if(m_jobs.begin(), m_jobs.end(), [&](CRepositoryUpdateJob* job){ return job->GetAddon()->ID() == repo->ID(); }); if (job == m_jobs.end()) { auto* job = new CRepositoryUpdateJob(repo); m_jobs.push_back(job); m_doneEvent.Reset(); if (showProgress) SetProgressIndicator(job); CJobManager::GetInstance().AddJob(job, this, CJob::PRIORITY_LOW); } else { if (showProgress && !(*job)->HasProgressIndicator()) SetProgressIndicator(*job); } }
bool CAddonMgr::IsAddonInstalled(const std::string& ID, AddonPtr& addon) { return GetAddon(ID, addon); }