Repository: moogar0880/PyTrakt

Issue:
score is not added in the Movie class
Hi
I can see there is a `score` field in the response but can't find it in in the `Movie` class in this library

https://trakt.docs.apiary.io/#reference/search/text-query/get-text-query-results

I want this field, is there a way to get it?

Comments:

Patch:
diff --git a/HISTORY.rst b/HISTORY.rst
index 250fe12..cbd7617 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,5 +1,10 @@
 Release History
 ^^^^^^^^^^^^^^^
+2.10.0 (2019-06-25)
++++++++++++++++++++
+
+* Add the ability to return a list of search results instead of their underlying media types (#106)
+
 2.9.1 (2019-02-24)
 ++++++++++++++++++
 
diff --git a/trakt/__init__.py b/trakt/__init__.py
index f1b1d1e..c731ff7 100644
--- a/trakt/__init__.py
+++ b/trakt/__init__.py
@@ -5,6 +5,6 @@ try:
 except ImportError:
     pass
 
-version_info = (2, 9, 1)
+version_info = (2, 10, 0)
 __author__ = 'Jon Nappi'
 __version__ = '.'.join([str(i) for i in version_info])
diff --git a/trakt/sync.py b/trakt/sync.py
index 39aee61..4e89700 100644
--- a/trakt/sync.py
+++ b/trakt/sync.py
@@ -114,48 +114,64 @@ def remove_from_collection(media):
     yield 'sync/collection/remove', media.to_json()
 
 
-@get
 def search(query, search_type='movie', year=None):
     """Perform a search query against all of trakt's media types
 
     :param query: Your search string
     :param search_type: The type of object you're looking for. Must be one of
         'movie', 'show', 'episode', or 'person'
+    :param year: This parameter is ignored as it is no longer a part of the
+        official API. It is left here as a valid arg for backwards
+        compatability.
     """
-    valids = ('movie', 'show', 'episode', 'person')
-    if search_type not in valids:
-        raise ValueError('search_type must be one of {}'.format(valids))
-    uri = 'search?query={query}&type={type}'.format(
-        query=slugify(query), type=search_type)
+    # the new get_search_results expects a list of types, so handle this
+    # conversion to maintain backwards compatability
+    if isinstance(search_type, str):
+        search_type = [search_type]
+    results = get_search_results(query, search_type)
+    return [result.media for result in results]
+
+
+@get
+def get_search_results(query, search_type=None):
+    """Perform a search query against all of trakt's media types
 
-    if year is not None:
-        uri += '&year={}'.format(year)
+    :param query: Your search string
+    :param search_type: The types of objects you're looking for. Must be
+        specified as a list of strings containing any of 'movie', 'show',
+        'episode', or 'person'.
+    """
+    # if no search type was specified, then search everything
+    if search_type is None:
+        search_type = ['movie', 'show', 'episode', 'person']
+    uri = 'search/{type}?query={query}'.format(
+        query=slugify(query), type=','.join(search_type))
 
     data = yield uri
 
+    # Need to do imports here to prevent circular imports with modules that
+    # need to import Scrobblers
+    results = []
     for media_item in data:
         extract_ids(media_item)
+        result = SearchResult(media_item['type'], media_item['score'])
+        if media_item['type'] == 'movie':
+            from trakt.movies import Movie
+            result.media = Movie(**media_item.pop('movie'))
+        elif media_item['type'] == 'show':
+            from trakt.tv import TVShow
+            result.media = TVShow(**media_item.pop('show'))
+        elif media_item['type'] == 'episode':
+            from trakt.tv import TVEpisode
+            show = media_item.pop('show')
+            result.media = TVEpisode(show.get('title', None),
+                                     **media_item.pop('episode'))
+        elif media_item['type'] == 'person':
+            from trakt.people import Person
+            result.media = Person(**media_item.pop('person'))
+        results.append(result)
 
-    # Need to do imports here to prevent circular imports with modules that
-    # need to import Scrobblers
-    if search_type == 'movie':
-        from trakt.movies import Movie
-        yield [Movie(**d.pop('movie')) for d in data]
-    elif search_type == 'show':
-        from trakt.tv import TVShow
-        yield [TVShow(**d.pop('show')) for d in data]
-    elif search_type == 'episode':
-        from trakt.tv import TVEpisode
-        episodes = []
-        for episode in data:
-            show = episode.pop('show')
-            extract_ids(episode['episode'])
-            episodes.append(TVEpisode(show.get('title', None),
-                                      **episode['episode']))
-        yield episodes
-    elif search_type == 'person':
-        from trakt.people import Person
-        yield [Person(**d.pop('person')) for d in data]
+    yield results
 
 
 @get
@@ -269,3 +285,20 @@ class Scrobbler(object):
         scrobbling the :class:`Scrobller`'s *media* object
         """
         self.finish()
+
+
+class SearchResult(object):
+    """A SearchResult is an individual result item from the trakt.tv search
+    API. It wraps a single media entity whose type is indicated by the type
+    field.
+    """
+    def __init__(self, type, score, media=None):
+        """Create a new :class:`SearchResult` instance
+
+        :param type: The type of media object contained in this result.
+        :param score: The search result relevancy score of this item.
+        :param media: The wrapped media item returned by a search.
+        """
+        self.type = type
+        self.score = score
+        self.media = media


Test patch:
diff --git a/tests/mock_data/search.json b/tests/mock_data/search.json
index 8bd87b2..1cd4a2c 100644
--- a/tests/mock_data/search.json
+++ b/tests/mock_data/search.json
@@ -1,36 +1,21 @@
 {
-    "search?query=batman&type=movie": {
+    "search/movie?query=batman": {
         "GET": [
             {"type":"movie","score":85.67655,"movie":{"title":"Batman","overview":"The Dark Knight of Gotham City begins his war on crime with his first major enemy being the clownishly homicidal Joker, who has seized control of Gotham's underworld.","year":1989,"images":{"poster":{"full":"https://walter.trakt.us/images/movies/000/000/224/posters/original/8a5816fc0b.jpg","medium":"https://walter.trakt.us/images/movies/000/000/224/posters/medium/8a5816fc0b.jpg","thumb":"https://walter.trakt.us/images/movies/000/000/224/posters/thumb/8a5816fc0b.jpg"},"fanart":{"full":"https://walter.trakt.us/images/movies/000/000/224/fanarts/original/cbc5557201.jpg","medium":"https://walter.trakt.us/images/movies/000/000/224/fanarts/medium/cbc5557201.jpg","thumb":"https://walter.trakt.us/images/movies/000/000/224/fanarts/thumb/cbc5557201.jpg"}},"ids":{"trakt":224,"slug":"batman-1989","imdb":"tt0096895","tmdb":268}}},
             {"type":"movie","score":85.67655,"movie":{"title":"Batman","overview":"The Dynamic Duo faces four super-villains who plan to hold the world for ransom with the help of a secret invention that instantly dehydrates people.","year":1966,"images":{"poster":{"full":"https://walter.trakt.us/images/movies/000/001/794/posters/original/4a4f6031b0.jpg","medium":"https://walter.trakt.us/images/movies/000/001/794/posters/medium/4a4f6031b0.jpg","thumb":"https://walter.trakt.us/images/movies/000/001/794/posters/thumb/4a4f6031b0.jpg"},"fanart":{"full":"https://walter.trakt.us/images/movies/000/001/794/fanarts/original/493d7c70a3.jpg","medium":"https://walter.trakt.us/images/movies/000/001/794/fanarts/medium/493d7c70a3.jpg","thumb":"https://walter.trakt.us/images/movies/000/001/794/fanarts/thumb/493d7c70a3.jpg"}},"ids":{"trakt":1794,"slug":"batman-1966","imdb":"tt0060153","tmdb":2661}}}
         ]
     },
-    "search?query=batman&type=movie&year=1966": {
-        "GET": [
-            {"type":"movie","score":85.67655,"movie":{"title":"Batman","overview":"The Dynamic Duo faces four super-villains who plan to hold the world for ransom with the help of a secret invention that instantly dehydrates people.","year":1966,"images":{"poster":{"full":"https://walter.trakt.us/images/movies/000/001/794/posters/original/4a4f6031b0.jpg","medium":"https://walter.trakt.us/images/movies/000/001/794/posters/medium/4a4f6031b0.jpg","thumb":"https://walter.trakt.us/images/movies/000/001/794/posters/thumb/4a4f6031b0.jpg"},"fanart":{"full":"https://walter.trakt.us/images/movies/000/001/794/fanarts/original/493d7c70a3.jpg","medium":"https://walter.trakt.us/images/movies/000/001/794/fanarts/medium/493d7c70a3.jpg","thumb":"https://walter.trakt.us/images/movies/000/001/794/fanarts/thumb/493d7c70a3.jpg"}},"ids":{"trakt":1794,"slug":"batman-1966","imdb":"tt0060153","tmdb":2661}}}
-        ]
-    },
-    "search?query=batman&type=show": {
+    "search/show?query=batman": {
         "GET": [
             {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/002/273/posters/medium/6a2568c755.jpg", "full": "https://walter.trakt.us/images/shows/000/002/273/posters/original/6a2568c755.jpg", "thumb": "https://walter.trakt.us/images/shows/000/002/273/posters/thumb/6a2568c755.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/002/273/fanarts/medium/7d42efbf73.jpg", "full": "https://walter.trakt.us/images/shows/000/002/273/fanarts/original/7d42efbf73.jpg", "thumb": "https://walter.trakt.us/images/shows/000/002/273/fanarts/thumb/7d42efbf73.jpg"}}, "ids": {"trakt": 2273, "tvrage": 2719, "tvdb": 77871, "slug": "batman", "imdb": "tt0059968", "tmdb": 2287}, "overview": "Wealthy entrepreneur Bruce Wayne and his ward Dick Grayson lead a double life: they are actually crime fighting duo Batman and Robin. A secret Batpole in the Wayne mansion leads to the Batcave, where Police Commissioner Gordon often calls with the latest emergency threatening Gotham City. Racing the the scene of the crime in the Batmobile, Batman and Robin must (with the help of their trusty Bat-utility-belt) thwart the efforts of a variety of master criminals, including The Riddler, The Joker, Catwoman, and The Penguin.", "title": "Batman", "year": 1966, "status": "ended"}, "score": 78.2283}, {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/000/512/posters/medium/e953162fe9.jpg", "full": "https://walter.trakt.us/images/shows/000/000/512/posters/original/e953162fe9.jpg", "thumb": "https://walter.trakt.us/images/shows/000/000/512/posters/thumb/e953162fe9.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/000/512/fanarts/medium/d6792a2797.jpg", "full": "https://walter.trakt.us/images/shows/000/000/512/fanarts/original/d6792a2797.jpg", "thumb": "https://walter.trakt.us/images/shows/000/000/512/fanarts/thumb/d6792a2797.jpg"}}, "ids": {"trakt": 512, "tvrage": 2722, "tvdb": 75417, "slug": "batman-beyond", "imdb": "tt0147746", "tmdb": 513}, "overview": "It's been years since Batman was last seen and Bruce Wayne secludes himself away from the resurgence of crime in Gotham. After discovering Bruce's secret identity, troubled teenager Terry McGinnis dons the mantle of Batman. With Bruce supervising him, Terry battles criminals in a futuristic Gotham and brings hope to its citizens.", "title": "Batman Beyond", "year": 1999, "status": "ended"}, "score": 55.877357}, {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/002/009/posters/medium/09023ee66d.jpg", "full": "https://walter.trakt.us/images/shows/000/002/009/posters/original/09023ee66d.jpg", "thumb": "https://walter.trakt.us/images/shows/000/002/009/posters/thumb/09023ee66d.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/002/009/fanarts/medium/256651c6be.jpg", "full": "https://walter.trakt.us/images/shows/000/002/009/fanarts/original/256651c6be.jpg", "thumb": "https://walter.trakt.us/images/shows/000/002/009/fanarts/thumb/256651c6be.jpg"}}, "ids": {"trakt": 2009, "tvrage": 5602, "tvdb": 73180, "slug": "the-batman", "imdb": "tt0398417", "tmdb": 2022}, "overview": "A young Bruce Wayne is in his third year of trying to establish himself as Batman, protector of Gotham City. He is in his mid-twenties, just finding his way as protector, defender and Caped Crusader, while balancing his public persona as billionaire bachelor Bruce Wayne. Living in Gotham, a metropolis where shadows run long and deep, beneath elevated train tracks, this younger Batman will confront updated takes of familiar foes - meeting each member of his classic Rogue\"s Gallery for the first time. From the likes of Joker, Penguin, Catwoman, Mr. Freeze, Riddler and Man-Bat, among others, the war on crime jumps to the next level with a new arsenal at the Dark Knight\"s disposal, all operated and linked by an advanced remote-controlled invention he dubs the \"Bat-Wave.\" ", "title": "The Batman", "year": 2004, "status": "ended"}, "score": 55.877357}, {"type": "show", "show": {"images": {"poster": {"medium": null, "full": null, "thumb": null}, "fanart": {"medium": null, "full": null, "thumb": null}}, "ids": {"trakt": 102664, "tvrage": null, "tvdb": 301558, "slug": "batman-unlimited", "imdb": null, "tmdb": null}, "overview": "A webseries began airing on DC Kids' YouTube channel on May 4, 2015.", "title": "Batman Unlimited", "year": 2015, "status": "returning series"}, "score": 55.877357}, {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/081/374/posters/medium/9f2c978ded.jpg", "full": "https://walter.trakt.us/images/shows/000/081/374/posters/original/9f2c978ded.jpg", "thumb": "https://walter.trakt.us/images/shows/000/081/374/posters/thumb/9f2c978ded.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/081/374/fanarts/medium/9f2c978ded.jpg", "full": "https://walter.trakt.us/images/shows/000/081/374/fanarts/original/9f2c978ded.jpg", "thumb": "https://walter.trakt.us/images/shows/000/081/374/fanarts/thumb/9f2c978ded.jpg"}}, "ids": {"trakt": 81374, "tvrage": null, "tvdb": 287484, "slug": "lego-batman", "imdb": null, "tmdb": null}, "overview": "Batman prides himself on being a loner, a totally self sufficient one-man band. He is understandably irritated when his nightly cleanup of Gotham City villains is interrupted by Superman, who pesters Batman to join his new Super-Hero team, the Justice League. After Batman makes it quite clear to the Man of Steel that his invitation has been declined, Superman flies off disappointed … whereupon he is overcome with a strange energy and vanishes! As costumed Super-Villains begin vanishing one-by-one at the hand of a mysterious enemy, the Dark Knight must free the newly-formed Justice League from a powerful foe. But can Batman learn the value of being a team-player before the Justice League is lost forever?", "title": "Lego Batman", "year": 2014, "status": "returning series"}, "score": 55.877357}, {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/041/472/posters/medium/3211da0751.jpg", "full": "https://walter.trakt.us/images/shows/000/041/472/posters/original/3211da0751.jpg", "thumb": "https://walter.trakt.us/images/shows/000/041/472/posters/thumb/3211da0751.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/041/472/fanarts/medium/cda4ae8fab.jpg", "full": "https://walter.trakt.us/images/shows/000/041/472/fanarts/original/cda4ae8fab.jpg", "thumb": "https://walter.trakt.us/images/shows/000/041/472/fanarts/thumb/cda4ae8fab.jpg"}}, "ids": {"trakt": 41472, "tvrage": null, "tvdb": 258331, "slug": "beware-the-batman", "imdb": "", "tmdb": 41676}, "overview": "The series is set during Bruce Wayne's early years as the Batman, following his initial period of battling organized crime. Over the course of the season, he hones his skills with the assistance of his butler, Alfred Pennyworth. Bruce is introduced to Alfred's goddaughter, Tatsu Yamashiro. Tatsu is a martial arts swordsmaster hired to act as Bruce's bodyguard, but also recruited to act as a superhero partner to Batman.", "title": "Beware the Batman", "year": 2013, "status": "returning series"}, "score": 44.701885}, {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/002/085/posters/medium/391f332b37.jpg", "full": "https://walter.trakt.us/images/shows/000/002/085/posters/original/391f332b37.jpg", "thumb": "https://walter.trakt.us/images/shows/000/002/085/posters/thumb/391f332b37.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/002/085/fanarts/medium/ab8d2d1b46.jpg", "full": "https://walter.trakt.us/images/shows/000/002/085/fanarts/original/ab8d2d1b46.jpg", "thumb": "https://walter.trakt.us/images/shows/000/002/085/fanarts/thumb/ab8d2d1b46.jpg"}}, "ids": {"trakt": 2085, "tvrage": 2721, "tvdb": 76168, "slug": "batman-the-animated-series", "imdb": "tt0103359", "tmdb": 2098}, "overview": "Batman The Animated Series was a cartoon that premiered on September 5, 1992, based on the comic series created by Bob Kane, as well as the Burton movie adaptations. The series focused on the adventures of the alter ego of millionaire Bruce Wayne, Batman, a dark vigilante hero who defends Gotham City from a variety of creative and psychotic villains. The highly successful series merged stylish animation and fantastic storytelling more in the style of radio plays than typical cartoons.", "title": "Batman: The Animated Series", "year": 1992, "status": "ended"}, "score": 39.11415}, {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/004/601/posters/medium/56bb90f61e.jpg", "full": "https://walter.trakt.us/images/shows/000/004/601/posters/original/56bb90f61e.jpg", "thumb": "https://walter.trakt.us/images/shows/000/004/601/posters/thumb/56bb90f61e.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/004/601/fanarts/medium/a3ee2e1ec3.jpg", "full": "https://walter.trakt.us/images/shows/000/004/601/fanarts/original/a3ee2e1ec3.jpg", "thumb": "https://walter.trakt.us/images/shows/000/004/601/fanarts/thumb/a3ee2e1ec3.jpg"}}, "ids": {"trakt": 4601, "tvrage": null, "tvdb": 77084, "slug": "the-new-batman-adventures", "imdb": "tt0118266", "tmdb": 4625}, "overview": "Also known as Batman Gotham Knights, this series takes place two years after the last episode of Batman: The Animated Series. Batman has continued to fight crime in Gotham City, but there have been some changes. Dick Grayson has become Nightwing; Tim Drake has taken over the role of Robin; and Batgirl has become apart of Batman's team. But the Dark Knight's greatest villains continue to plague Gotham City, so not everything has changed. This series aired alongside Superman as part of The New Batman/Superman Adventures on the WB. First Telecast: September 13, 1997Last Telecast: January 16, 1999 Episodes: 24 Color episodes (24 half-hour episodes, 2 Direct-to Video Movies) ", "title": "The New Batman Adventures", "year": 1997, "status": "ended"}, "score": 39.11415}, {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/031/611/posters/medium/d969363d90.jpg", "full": "https://walter.trakt.us/images/shows/000/031/611/posters/original/d969363d90.jpg", "thumb": "https://walter.trakt.us/images/shows/000/031/611/posters/thumb/d969363d90.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/031/611/fanarts/medium/66fab2b401.jpg", "full": "https://walter.trakt.us/images/shows/000/031/611/fanarts/original/66fab2b401.jpg", "thumb": "https://walter.trakt.us/images/shows/000/031/611/fanarts/thumb/66fab2b401.jpg"}}, "ids": {"trakt": 31611, "tvrage": null, "tvdb": 248509, "slug": "the-adventures-of-batman", "imdb": "tt0062544", "tmdb": 31749}, "overview": "The adventures of Batman, with Robin, the Boy Wonder!Batman and Robin, the Dynamic Duo against crime and corruption, whose real identities as millionaire philanthropist Bruce Wayne and his young ward Dick Grayson and known only to Alfred, the faithful butler.Ever alert, they respond swiftly to a signal from the police, and moments later, from the secret Batcave deep beneath Wayne Manor, they roar out to protect life, limb and property as Batman and Robin, caped crimefighters!Batman and Robin, scourge of Gotham City's kooky criminals: The Joker, Clown Prince of Crime - The Penguin, pudgy purveyor of perfidy - and the cool, cruel, Mr. Freeze!Watch out, villains, here come... Batman and Robin!", "title": "The Adventures of Batman", "year": 1968, "status": "ended"}, "score": 39.11415}, {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/061/637/posters/medium/a889cb95b2.jpg", "full": "https://walter.trakt.us/images/shows/000/061/637/posters/original/a889cb95b2.jpg", "thumb": "https://walter.trakt.us/images/shows/000/061/637/posters/thumb/a889cb95b2.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/061/637/fanarts/medium/d873f0ed83.jpg", "full": "https://walter.trakt.us/images/shows/000/061/637/fanarts/original/d873f0ed83.jpg", "thumb": "https://walter.trakt.us/images/shows/000/061/637/fanarts/thumb/d873f0ed83.jpg"}}, "ids": {"trakt": 61637, "tvrage": null, "tvdb": 93341, "slug": "batman-the-1943-serial", "imdb": "tt0035665", "tmdb": null}, "overview": "Batman was a 15-chapter serial released in 1943 by Columbia Pictures. The serial starred Lewis Wilson as Batman and Douglas Croft as Robin. J. Carrol Naish played the villain, an original character named Dr. Daka. Rounding out the cast were Shirley Patterson as Linda Page (Bruce Wayne's love interest), and William Austin as Alfred. The plot is based on Batman, a US government agent, attempting to defeat the Japanese agent Dr. Daka, at the height of World War II.", "title": "Batman: The 1943 Serial", "year": 1943, "status": "ended"}, "score": 39.11415}
         ]
     },
-    "search?query=batman&type=show&year=1999": {
-        "GET": [
-            {"type": "show", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/000/512/posters/medium/e953162fe9.jpg", "full": "https://walter.trakt.us/images/shows/000/000/512/posters/original/e953162fe9.jpg", "thumb": "https://walter.trakt.us/images/shows/000/000/512/posters/thumb/e953162fe9.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/000/512/fanarts/medium/d6792a2797.jpg", "full": "https://walter.trakt.us/images/shows/000/000/512/fanarts/original/d6792a2797.jpg", "thumb": "https://walter.trakt.us/images/shows/000/000/512/fanarts/thumb/d6792a2797.jpg"}}, "ids": {"trakt": 512, "tvrage": 2722, "tvdb": 75417, "slug": "batman-beyond", "imdb": "tt0147746", "tmdb": 513}, "overview": "It's been years since Batman was last seen and Bruce Wayne secludes himself away from the resurgence of crime in Gotham. After discovering Bruce's secret identity, troubled teenager Terry McGinnis dons the mantle of Batman. With Bruce supervising him, Terry battles criminals in a futuristic Gotham and brings hope to its citizens.", "title": "Batman Beyond", "year": 1999, "status": "ended"}, "score": 55.877357}
-        ]
-    },
-    "search?query=batman&type=episode": {
+    "search/episode?query=batman": {
         "GET": [
             {"type": "episode", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/000/900/posters/medium/d67bbc0a62.jpg", "full": "https://walter.trakt.us/images/shows/000/000/900/posters/original/d67bbc0a62.jpg", "thumb": "https://walter.trakt.us/images/shows/000/000/900/posters/thumb/d67bbc0a62.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/000/900/fanarts/medium/1eae79bc72.jpg", "full": null, "thumb": "https://walter.trakt.us/images/shows/000/000/900/fanarts/thumb/1eae79bc72.jpg"}}, "year": "1987", "ids": {"trakt": 900, "slug": "french-saunders"}}, "episode": {"images": {"screenshot": {"medium": "https://walter.trakt.us/images/episodes/000/059/025/screenshots/medium/5bd7342a6a.jpg", "full": "https://walter.trakt.us/images/episodes/000/059/025/screenshots/original/5bd7342a6a.jpg", "thumb": "https://walter.trakt.us/images/episodes/000/059/025/screenshots/thumb/5bd7342a6a.jpg"}}, "title": "Batman", "season": 5, "number": 4, "ids": {"trakt": 59025, "tvrage": 64781, "tmdb": null, "imdb": "", "tvdb": 165596}}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/063/200/posters/medium/4f5ec381c4.jpg", "full": "https://walter.trakt.us/images/shows/000/063/200/posters/original/4f5ec381c4.jpg", "thumb": "https://walter.trakt.us/images/shows/000/063/200/posters/thumb/4f5ec381c4.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/063/200/fanarts/medium/4f5ec381c4.jpg", "full": null, "thumb": "https://walter.trakt.us/images/shows/000/063/200/fanarts/thumb/4f5ec381c4.jpg"}}, "year": "2008", "ids": {"trakt": 63200, "slug": "hey-ash-whatcha-playin"}}, "episode": {"images": {"screenshot": {"medium": "https://walter.trakt.us/images/episodes/001/058/895/screenshots/medium/5f6e4ee8fe.jpg", "full": "https://walter.trakt.us/images/episodes/001/058/895/screenshots/original/5f6e4ee8fe.jpg", "thumb": "https://walter.trakt.us/images/episodes/001/058/895/screenshots/thumb/5f6e4ee8fe.jpg"}}, "ids": {"trakt": 1058895, "tvrage": null, "tmdb": null, "imdb": null, "tvdb": 4412148}, "overview": "Arkham's criminals don't stand a chance against the world's greatest detective, Ashly Burch.", "number": 15, "season": 4, "title": "Batman"}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/004/968/posters/medium/beec80b1c2.jpg", "full": "https://walter.trakt.us/images/shows/000/004/968/posters/original/beec80b1c2.jpg", "thumb": "https://walter.trakt.us/images/shows/000/004/968/posters/thumb/beec80b1c2.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/004/968/fanarts/medium/0918fab718.jpg", "full": null, "thumb": "https://walter.trakt.us/images/shows/000/004/968/fanarts/thumb/0918fab718.jpg"}}, "ids": {"trakt": 4968, "slug": "biography"}, "year": "1987", "title": "Biography"}, "episode": {"images": {"screenshot": {"medium": null, "full": null, "thumb": null}}, "ids": {"trakt": 1617094, "tvrage": null, "tmdb": 0, "imdb": null, "tvdb": 4358502}, "overview": "A history of the campy classic '60s TV series \"Batman\", starring Adam West and Burt Ward, who are on hand to comment. Included: screen tests and clips of memorable scenes. Also commenting is executive producer William Dozier; and Batmobile customizer George Barris. ", "number": 2, "season": 2003, "title": "Batman"}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/079/142/posters/medium/ecf7fa7ec3.jpg", "full": "https://walter.trakt.us/images/shows/000/079/142/posters/original/ecf7fa7ec3.jpg", "thumb": "https://walter.trakt.us/images/shows/000/079/142/posters/thumb/ecf7fa7ec3.jpg"}, "fanart": {"medium": null, "full": null, "thumb": null}}, "year": "1969", "ids": {"trakt": 79142, "slug": "bad-days"}}, "episode": {"images": {"screenshot": {"medium": null, "full": null, "thumb": null}}, "ids": {"trakt": 1304962, "tvrage": null, "tmdb": null, "imdb": null, "tvdb": 4571070}, "overview": "Batman doesn't really have bad days, but he definitely has bad nights..", "number": 9, "season": 1, "title": "Batman"}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/073/361/posters/medium/df4f1c96c2.jpg", "full": "https://walter.trakt.us/images/shows/000/073/361/posters/original/df4f1c96c2.jpg", "thumb": "https://walter.trakt.us/images/shows/000/073/361/posters/thumb/df4f1c96c2.jpg"}, "fanart": {"medium": null, "full": null, "thumb": null}}, "year": "2005", "ids": {"trakt": 73361, "slug": "snl-digital-shorts"}}, "episode": {"images": {"screenshot": {"medium": null, "full": null, "thumb": null}}, "title": "Batman", "season": 7, "number": 6, "ids": {"trakt": 1227579, "tvrage": null, "tmdb": null, "imdb": null, "tvdb": 4670467}}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": null, "full": null, "thumb": null}, "fanart": {"medium": null, "full": null, "thumb": null}}, "year": "2009", "ids": {"trakt": 94515, "slug": "3-2009"}}, "episode": {"images": {"screenshot": {"medium": "https://walter.trakt.us/images/episodes/001/690/018/screenshots/medium/f333de513d.jpg", "full": "https://walter.trakt.us/images/episodes/001/690/018/screenshots/original/f333de513d.jpg", "thumb": "https://walter.trakt.us/images/episodes/001/690/018/screenshots/thumb/f333de513d.jpg"}}, "title": "BATMAN!!!", "season": 2010, "number": 55, "ids": {"trakt": 1690018, "tvrage": null, "tmdb": null, "imdb": null, "tvdb": 4599451}}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": null, "full": null, "thumb": null}, "fanart": {"medium": null, "full": null, "thumb": null}}, "year": "1998", "ids": {"trakt": 96440, "slug": "joulukalenteri-tonttu-toljanterin-joulupulma"}}, "episode": {"images": {"screenshot": {"medium": null, "full": null, "thumb": null}}, "title": "Batman", "season": 1, "number": 3, "ids": {"trakt": 1766428, "tvrage": null, "tmdb": null, "imdb": null, "tvdb": 4681124}}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": null, "full": null, "thumb": null}, "fanart": {"medium": null, "full": null, "thumb": null}}, "year": "2002", "ids": {"trakt": 14649, "slug": "cheat"}}, "episode": {"images": {"screenshot": {"medium": null, "full": null, "thumb": null}}, "ids": {"trakt": 535228, "tvrage": 356329, "tmdb": 526964, "imdb": "", "tvdb": 143833}, "overview": "Endless summer", "number": 1, "season": 1, "title": "Batman"}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/078/744/posters/medium/ee26d1337b.jpg", "full": "https://walter.trakt.us/images/shows/000/078/744/posters/original/ee26d1337b.jpg", "thumb": "https://walter.trakt.us/images/shows/000/078/744/posters/thumb/ee26d1337b.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/078/744/fanarts/medium/ee26d1337b.jpg", "full": null, "thumb": "https://walter.trakt.us/images/shows/000/078/744/fanarts/thumb/ee26d1337b.jpg"}}, "year": "2012", "ids": {"trakt": 78744, "slug": "revansch"}}, "episode": {"images": {"screenshot": {"medium": "https://walter.trakt.us/images/episodes/001/302/992/screenshots/medium/7b86b4bbe3.jpg", "full": "https://walter.trakt.us/images/episodes/001/302/992/screenshots/original/7b86b4bbe3.jpg", "thumb": "https://walter.trakt.us/images/episodes/001/302/992/screenshots/thumb/7b86b4bbe3.jpg"}}, "ids": {"trakt": 1302992, "tvrage": null, "tmdb": null, "imdb": null, "tvdb": 4770106}, "overview": "As a kid you maybe sold your NES to afford the upcoming SNES. Victor is certainly one of them. 20 years later he visits his parents' attic and finds this game. Is this fate?", "number": 10, "season": 1, "title": "Batman"}, "score": 91.11184}, {"type": "episode", "show": {"images": {"poster": {"medium": null, "full": null, "thumb": null}, "fanart": {"medium": null, "full": null, "thumb": null}}, "ids": {"trakt": 102553, "slug": "you-think-you-know-comics"}, "year": "2014", "title": "You Think You Know Comics"}, "episode": {"images": {"screenshot": {"medium": null, "full": null, "thumb": null}}, "title": "Batman", "season": 2014, "number": 2, "ids": {"trakt": 2015951, "tvrage": null, "tmdb": null, "imdb": null, "tvdb": 5357566}}, "score": 91.11184}
         ]
     },
-    "search?query=batman&type=episode&year=1987": {
-        "GET": [
-            {"type": "episode", "show": {"images": {"poster": {"medium": "https://walter.trakt.us/images/shows/000/000/900/posters/medium/d67bbc0a62.jpg", "full": "https://walter.trakt.us/images/shows/000/000/900/posters/original/d67bbc0a62.jpg", "thumb": "https://walter.trakt.us/images/shows/000/000/900/posters/thumb/d67bbc0a62.jpg"}, "fanart": {"medium": "https://walter.trakt.us/images/shows/000/000/900/fanarts/medium/1eae79bc72.jpg", "full": null, "thumb": "https://walter.trakt.us/images/shows/000/000/900/fanarts/thumb/1eae79bc72.jpg"}}, "year": "1987", "ids": {"trakt": 900, "slug": "french-saunders"}}, "episode": {"images": {"screenshot": {"medium": "https://walter.trakt.us/images/episodes/000/059/025/screenshots/medium/5bd7342a6a.jpg", "full": "https://walter.trakt.us/images/episodes/000/059/025/screenshots/original/5bd7342a6a.jpg", "thumb": "https://walter.trakt.us/images/episodes/000/059/025/screenshots/thumb/5bd7342a6a.jpg"}}, "title": "Batman", "season": 5, "number": 4, "ids": {"trakt": 59025, "tvrage": 64781, "tmdb": null, "imdb": "", "tvdb": 165596}}, "score": 91.11184}
-        ]
-    },
-    "search?query=cranston&type=person": {
+    "search/person?query=cranston": {
         "GET": [
             {"type": "person", "person": {"images": {"headshot": {"medium": null, "full": null, "thumb": null}}, "ids": {"trakt": 154029, "tvrage": null, "slug": "bob-cranston", "imdb": "", "tmdb": 587197}, "name": "Bob Cranston"}, "score": 94.57829},
             {"type": "person", "person": {"images": {"headshot": {"medium": null, "full": null, "thumb": null}}, "ids": {"trakt": 364188, "tvrage": null, "slug": "al-cranston", "imdb": "", "tmdb": 1309602}, "name": "Al Cranston"}, "score": 94.57829},
diff --git a/tests/test_episodes.py b/tests/test_episodes.py
index 0561180..530882e 100644
--- a/tests/test_episodes.py
+++ b/tests/test_episodes.py
@@ -20,7 +20,7 @@ def test_episode_search():
 def test_episode_search_with_year():
     results = TVEpisode.search('batman', year=1987)
     assert isinstance(results, list)
-    assert len(results) == 1
+    assert len(results) == 10
     assert all(isinstance(m, TVEpisode) for m in results)
 
 
diff --git a/tests/test_search.py b/tests/test_search.py
index 785bcba..7e4a2ba 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -3,22 +3,12 @@
 import pytest
 from trakt.movies import Movie
 from trakt.people import Person
-from trakt.sync import search, search_by_id
+from trakt.sync import get_search_results, search, search_by_id, SearchResult
 from trakt.tv import TVEpisode, TVShow
 
 __author__ = 'Reinier van der Windt'
 
 
-def test_invalid_searches():
-    """test that the proper exceptions are raised when an invalid search or id
-    type is provided to a search function
-    """
-    functions = [search, search_by_id]
-    for fn in functions:
-        with pytest.raises(ValueError):
-            fn('shouldfail', 'fake')
-
-
 def test_search_movie():
     """test that movie search results are successfully returned"""
     batman_results = search('batman')
@@ -26,10 +16,11 @@ def test_search_movie():
     assert len(batman_results) == 2
     assert all(isinstance(m, Movie) for m in batman_results)
 
+
 def test_search_movie_with_year():
     batman_results = search('batman', year='1966')
     assert isinstance(batman_results, list)
-    assert len(batman_results) == 1
+    assert len(batman_results) == 2
     assert all(isinstance(m, Movie) for m in batman_results)
 
 
@@ -79,3 +70,12 @@ def test_search_person_by_id():
     results = search_by_id('nm0186505', id_type='imdb')
     assert isinstance(results, list)
     assert all(isinstance(p, Person) for p in results)
+
+
+def test_get_search_results():
+    """test that entire results can be returned by get_search_results"""
+    results = get_search_results('batman', search_type=['movie'])
+    assert isinstance(results, list)
+    assert len(results) == 2
+    assert all(isinstance(r, SearchResult) for r in results)
+    assert all([r.score != 0.0 for r in results])
diff --git a/tests/test_shows.py b/tests/test_shows.py
index 518b5d5..a3f5bb5 100644
--- a/tests/test_shows.py
+++ b/tests/test_shows.py
@@ -91,7 +91,7 @@ def test_show_search():
 def test_show_search_with_year():
     results = TVShow.search('batman', year=1999)
     assert isinstance(results, list)
-    assert len(results) == 1
+    assert len(results) == 10
     assert all(isinstance(m, TVShow) for m in results)