xbmc/xbmc — pull request #1478 by Memphiz (2012-09-25 19:10:35+00:00)
Title: Fix PVR addons get enabled alltogether when found the first time

This PR fixes the issue where all PVR addons get enabled/started when they are detected the first time.

The Problem is as follows. PVR addons get enabled when they are not in the disabled table in the AddonDB. That is true for all new addons (they are not found in the disabled DB and therefore treated as enabled). Also the CAddon object initialises his own "m_enabled" member to true - this doesn't help here too.

So the problem is that only the disabled table is used for PVR addons (they are never added to the normal addon table).

In AddAddon of AddonDatabase there is already a special case for PVR addons. Say get added to the disabled table automatically when added (which is correct - PVR addons need to be configured after adding - so they should be disabled by default).

This PR fixes this problem by adding a new method called "HasAddon" to AddonDatabase. It checks if a given addon is already in the addon - table.

For PVR addons in UpdateAddons (on startup) we now check if the addon is already in the DB. If its not we add it (and therefore disabling it too). That prevents the mass enabling of addons and on the first start (with no enabled addons) also shows the "PVR has to be configured" message.

Since we have enabled PVR addons on the buildbot for osx i would like to have this fix in before alpha6 gets tagged. So ETA 5 days.

ping @davilla @jmarshallnz @opdenkamp