# Path: resources/lib/model/apiresponse.py
# class ApiResponse:
#     def __init__(self, name=None, year=None, genre=None, plot=None, posters=None, fanarts=None):
#         if genre is None:
#             genre = []
#         if posters is None:
#             posters = []
#         if fanarts is None:
#             fanarts = {}
# 
#         self.name = name
#         self.year = year
#         self.genre = genre
#         self.plot = plot
#         self.posters = posters
#         self.fanarts = fanarts
# 
#     @classmethod
#     def from_dict(cls, name=None, year=None, genre=None, plot=None, posters=None, fanarts=None, **kwargs):
#         return cls(name, year, genre, plot, posters, fanarts)


import json
import os
import urllib2
    import xbmcgui
    from xbmcswift2 import xbmcgui
from abcscraper import AbstractScraper
from resources.lib.model.apiresponse import ApiResponse
        return 'OMDB'

    def get_game_information(self, nvapp):
        request_name = nvapp.title.replace(" ", "+").replace(":", "")
        response = self._gather_information(nvapp, request_name)
        response.name = nvapp.title
        return response

    def return_paths(self):
        return [self.cover_cache, self.api_cache]

    def is_enabled(self):
        return self.core.get_setting('enable_omdb', bool)

    def _gather_information(self, nvapp, game):
        game_cover_path = self._set_up_path(os.path.join(self.cover_cache, nvapp.id))
        game_cache_path = self._set_up_path(os.path.join(self.api_cache, nvapp.id))

        json_file = self._get_json_data(game_cache_path, game)
        try:
            json_data = json.load(open(json_file))
        except:
            xbmcgui.Dialog().notification(
                self.core.string('name'),
                self.core.string('scraper_failed') % (game, self.name())
            )

            if json_file is not None and os.path.isfile(json_file):
                os.remove(json_file)


# Path: resources/lib/model/apiresponse.py
# class ApiResponse:
#     def __init__(self, name=None, year=None, genre=None, plot=None, posters=None, fanarts=None):
#         if genre is None:
#             genre = []
#         if posters is None:
#             posters = []
#         if fanarts is None:
#             fanarts = {}
# 
#         self.name = name
#         self.year = year
#         self.genre = genre
#         self.plot = plot
#         self.posters = posters
#         self.fanarts = fanarts
# 
#     @classmethod
#     def from_dict(cls, name=None, year=None, genre=None, plot=None, posters=None, fanarts=None, **kwargs):
#         return cls(name, year, genre, plot, posters, fanarts)


# Path: resources/lib/scraper/omdbscraper.py
import json
import os
import urllib2
    import xbmcgui
    from xbmcswift2 import xbmcgui
from abcscraper import AbstractScraper
from resources.lib.model.apiresponse import ApiResponse

        return 'OMDB'

    def get_game_information(self, nvapp):
        request_name = nvapp.title.replace(" ", "+").replace(":", "")
        response = self._gather_information(nvapp, request_name)
        response.name = nvapp.title
        return response

    def return_paths(self):
        return [self.cover_cache, self.api_cache]

    def is_enabled(self):
        return self.core.get_setting('enable_omdb', bool)

    def _gather_information(self, nvapp, game):
        game_cover_path = self._set_up_path(os.path.join(self.cover_cache, nvapp.id))
        game_cache_path = self._set_up_path(os.path.join(self.api_cache, nvapp.id))

        json_file = self._get_json_data(game_cache_path, game)
        try:
            json_data = json.load(open(json_file))
        except:
            xbmcgui.Dialog().notification(
                self.core.string('name'),
                self.core.string('scraper_failed') % (game, self.name())
            )

            if json_file is not None and os.path.isfile(json_file):
                os.remove(json_file)


            return ApiResponse()