From 504e93a78d59d51243acbcab6831309805d01fd1 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 3 Apr 2016 13:20:05 +0100 Subject: tinkered with some modules and fixed a few bugs, also added the skeleton for the auto_mode.py module. --- modules/trakt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/trakt.py') diff --git a/modules/trakt.py b/modules/trakt.py index 94538b8f..b488ad40 100644 --- a/modules/trakt.py +++ b/modules/trakt.py @@ -29,12 +29,9 @@ class Module(object): "trakt-api-version": "2", "trakt-api-key": self.bot.config["trakt-api-key"]}, json=True, code=True) - if page: + if page[0]: code, page = page - if code == 204: - event["stderr"].write( - "%s is not watching anything" % username) - else: + if code == 200: type = page["type"] if type == "movie": title = page["movie"]["title"] @@ -58,5 +55,8 @@ class Module(object): URL_TRAKTSLUG % ("shows", slug))) else: print("ack! unknown trakt media type!") + else: + event["stderr"].write( + "%s is not watching anything" % username) else: event["stderr"].write("Failed to load results") -- cgit v1.3.1-10-gc9f91