示例#1
0
 def __init__(self):
     self._sources = [
         StampedSource(), 
         iTunesSource(), 
         TMDBSource(), 
         TheTVDBSource(), 
         GooglePlacesSource(), 
         FactualSource(), 
         AmazonSource(), 
         RdioSource(), 
         SpotifySource(), 
     ]
     
     self._sources_map = { }
     for source in self._sources:
         self._sources_map[source.sourceName] = source
示例#2
0
    def __init__(self):
        allCategories = Constants.categories
        self.__all_sources = []
        self.__entity_collection = MongoEntityCollection()
        self.__stats_collection = MongoEntityStatsCollection()
        # Within each category, we have a number of sources and each is assigned a priority. The priority is used to
        # determine how long to wait for results from that source.
        self.__categories_to_sources_and_priorities = {}
        for category in allCategories:
            self.__categories_to_sources_and_priorities[category] = []

        self.__registerSource(StampedSource(), music=3, film=3, book=3, app=3, place=3)
        self.__registerSource(iTunesSource(), music=10, film=10, book=3, app=10)
        # TODO: Enable film for Amazon. Amazon film results blend TV and movies and have better retrieval than
        # iTunes. On the other hand, they're pretty dreadful -- no clear distinction between TV and movies, no
        # clear distinction between individual movies and box sets, etc.
        self.__registerSource(AmazonSource(), music=5, book=10)
        self.__registerSource(FactualSource(), place=8)
        self.__registerSource(GooglePlacesSource(), place=8)
        self.__registerSource(RdioSource(), music=8)
        self.__registerSource(SpotifySource(), music=8)
        self.__registerSource(TMDBSource(), film=8)
        self.__registerSource(TheTVDBSource(), film=8)
示例#3
0
 def __itunes_source(self):
     return iTunesSource()
示例#4
0
 def __init__(self):
     self._id_re = re.compile(".*\/id([0-9]+).*")
     self._source = iTunesSource()
from resolve.FactualSource import FactualSource
from resolve.GooglePlacesSource import GooglePlacesSource
from resolve.iTunesSource import iTunesSource
from resolve.NetflixSource import NetflixSource
from resolve.RdioSource import RdioSource
from resolve.SpotifySource import SpotifySource
from resolve.StampedSource import StampedSource
from resolve.TMDBSource import TMDBSource
from resolve.TheTVDBSource import TheTVDBSource
from resolve.ResolverObject import *

SOURCES = {
    'amazon' : AmazonSource(),
    'factual' : FactualSource(),
    'googleplaces' : GooglePlacesSource(),
    'itunes' : iTunesSource(),
    'rdio' : RdioSource(),
    'spotify' : SpotifySource(),
    'tmdb' : TMDBSource(),
    'thetvdb' : TheTVDBSource(),
    'netflix' : NetflixSource(),
    'stamped' : StampedSource(),
}

SOURCE_AND_KEY_RE = re.compile('([a-z_]+):(.*)')
def main():
    EntityProxyComparator.logComparisonLogic = True

    proxies = []
    for arg in sys.argv[1:]:
        source_and_key_match = SOURCE_AND_KEY_RE.match(arg)
示例#6
0
from resolve.iTunesSource import iTunesSource
from resolve.NetflixSource import NetflixSource
from resolve.RdioSource import RdioSource
from resolve.SpotifySource import SpotifySource
from resolve.TMDBSource import TMDBSource
from resolve.TheTVDBSource import TheTVDBSource
from libs.CountedFunction import printFunctionCounts

from tests.StampedTestUtils import *
from tests.framework.FixtureTest import *

SOURCES = {
    'amazon_id' : AmazonSource(),
    'factual_id' : FactualSource(),
    'googleplaces_id' : GooglePlacesSource(),
    'itunes_id' : iTunesSource(),
    'rdio_id' : RdioSource(),
    'spotify_id' : SpotifySource(),
    'tmdb_id' : TMDBSource(),
    'thetvdb_id' : TheTVDBSource(),
    'netflix_id' : NetflixSource(),
}

FLAGS = None

class RunEvalResolutions(AStampedTestCase):
    @fixtureTest(useLocalDb=True)
    def test_run_app_resolution(self):
        self.__run_eval_for_category('app')

    @fixtureTest(useLocalDb=True)