def buildEntity(self):
        if not self.__proxies:
            raise Exception('No proxies added so far, cannot build entity')
        
        primaryProxy = self.__proxies[0]
        entity = Entity.buildEntity(kind=primaryProxy.kind)
        entity.kind = primaryProxy.kind 
        entity.types = primaryProxy.types

        if entity.isType('book'):
            entity.title = self.__chooseBookTitle()
        else:
            entity.title = self.__chooseBestTitle()

        sourceContainer = BasicSourceContainer()
        for proxy in self.__proxies:
            sourceContainer.addSource(EntityProxySource(proxy))

        sourceContainer.enrichEntity(entity, {})
        
        return entity
    def __init__(self):
        BasicSourceContainer.__init__(self)

        for source in allSources:
            self.addSource(source())
        
        self.setGlobalPriority('entity', -1)
        self.setGlobalPriority('thetvdb', 2)
        self.setGlobalPriority('itunes', 1)
        self.setGlobalPriority('netflix',0)

        self.setGroupPriority('tracks', 'amazon', -1)
        self.setGroupPriority('albums', 'amazon', -1)
        self.setGroupPriority('artists', 'amazon', -1)
        self.setGroupPriority('cast', 'netflix', 2)

        # Allow itunes and GooglePlaces to overwrite seed for for their own id, because they
        # deprecate sometimes.
        seedPriority = self.getGlobalPriority('seed')
        self.setGroupPriority('itunes', 'itunes', seedPriority + 1)
        self.setGroupPriority('googleplaces', 'googleplaces', seedPriority + 1)