Ejemplo n.º 1
0
'''
from resources.lib import globo
from xbmcswift2 import Plugin, xbmc
try:
    import StorageServer
except:
    import test.storageserverdummy as StorageServer

# xbmcswift2 patches
# to-be removed once it's fixed in the mainstream
from resources.lib import swift_patch
swift_patch.patch()

cache = StorageServer.StorageServer("Globosat", 12)
plugin = Plugin()
api = globo.GloboApi(plugin, cache)


@plugin.route('/')
def index():
    # items = [
    #     {'label': 'Canais'},
    #     {'label': 'Categorias'},
    #     {'label': 'Globo+'},
    #     {'label': 'Ao vivo'},
    #     {'label': 'Buscar'}
    # ]

    categories = cache.cacheFunction(api.get_shows_by_categories)
    items = [{
        'label': '%s (%s shows)' % (category['title'], len(category['shows'])),
Ejemplo n.º 2
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''
from xbmcswift2 import actions
from xbmcswift2 import Plugin
from xbmcswift2 import xbmc

from resources.lib import globo
from resources.lib import util

plugin = Plugin()
api = globo.GloboApi(plugin)

# background views
@plugin.route('/clear_index')
def clear_index():
    api._clear_index()
    plugin.notify(plugin.get_string(32004), image=None)

@plugin.route('/favorites/del/<channel>/<show>')
def add_show_to_favs(channel, show):
    # this is a background view
    plugin.log.debug('adding (%s, %s) to favorites' % (channel, show))
    try:
        api.favorites.add((channel, show))
        # show_name =
        plugin.notify('[%s] %s added to favorites.' % (channel, show), image=None)
Ejemplo n.º 3
0
 def __init__(self, iniFile):
     self.cache = StorageServer.StorageServer("Globosat", 12)
     self.plugin = FakePlugin(iniFile)
     self.api = globo.GloboApi(self.plugin, self.cache)