Beispiel #1
0
 def testFindMovieIds(self):
     infos = find_movie_ids("American Beauty")
     self.assertEqual(5, len(infos))
     first = infos[0]
     self.assertEqual("American Beauty", first["title"])
     self.assertEqual("American Beauty (1999)", first["label"])
     self.assertEqual(u'https://image.tmdb.org/t/p/w92/or1MP8BZIAjqWYxPdPX724ydKar.jpg', first["poster"])
     self.assertEqual(14, first["value"])
Beispiel #2
0
 def testFindMovieIds(self):
     infos = find_movie_ids("American Beauty")
     self.assertEqual(5, len(infos))
     first = infos[0]
     self.assertEqual("American Beauty", first["title"])
     self.assertEqual("American Beauty (1999)", first["label"])
     self.assertEqual(
         u'https://image.tmdb.org/t/p/w92/or1MP8BZIAjqWYxPdPX724ydKar.jpg',
         first["poster"])
     self.assertEqual(14, first["value"])
Beispiel #3
0
def internalapi_autocomplete(args):
    logger.debug("Autocomplete request with args %s" % args)
    if args["type"] == "movie":
        results = infos.find_movie_ids(args["input"])
        return jsonify({"results": results})
    elif args["type"] == "tv":
        results = infos.find_series_ids(args["input"])
        return jsonify({"results": results})
    else:
        return "No results", 500
Beispiel #4
0
def internalapi_autocomplete(args):
    logger.debug("Autocomplete request with args %s" % args)
    if args["type"] == "movie":
        results = infos.find_movie_ids(args["input"])
        return jsonify({"results": results})
    elif args["type"] == "tv":
        results = infos.find_series_ids(args["input"])
        return jsonify({"results": results})
    else:
        return "No results", 500