Beispiel #1
0
    def __init__(self):
        self._init_vars()
        self._parse_argv()
        if not self.TYPE:
            router.run()
        for content_type in self.TYPE.split("+"):
            full_liz = list()
            if content_type == "randommovies":
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
                data.parse_movies('randommovies', 32004, full_liz,
                                  self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentmovies":
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
                data.parse_movies('recentmovies', 32005, full_liz,
                                  self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recommendedmovies":
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
                data.parse_movies('recommendedmovies', 32006, full_liz,
                                  self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recommendedepisodes":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_tvshows_recommended('recommendedepisodes', 32010,
                                               full_liz, self.USECACHE,
                                               self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "favouriteepisodes":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_tvshows_favourite('favouriteepisodes', 32020,
                                             full_liz, self.USECACHE,
                                             self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentepisodes":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_tvshows('recentepisodes', 32008, full_liz,
                                   self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "randomepisodes":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_tvshows('randomepisodes', 32007, full_liz,
                                   self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentvideos":
                xbmcplugin.setContent(int(sys.argv[1]), 'videos')
                listA = []
                listB = []
                dateListA = []
                dateListB = []
                data.parse_movies('recentmovies', 32005, listA, self.USECACHE,
                                  self.PLOT_ENABLE, self.LIMIT, dateListA,
                                  "dateadded")
                data.parse_tvshows('recentepisodes', 32008, listB,
                                   self.USECACHE, self.PLOT_ENABLE, self.LIMIT,
                                   dateListB, "dateadded")
                full_liz = data._combine_by_date(listA, dateListA, listB,
                                                 dateListB, self.LIMIT,
                                                 self.SETTINGSLIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "randomalbums":
                xbmcplugin.setContent(int(sys.argv[1]), 'albums')
                data.parse_albums('randomalbums', 32016, full_liz,
                                  self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentalbums":
                xbmcplugin.setContent(int(sys.argv[1]), 'albums')
                data.parse_albums('recentalbums', 32017, full_liz,
                                  self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recommendedalbums":
                xbmcplugin.setContent(int(sys.argv[1]), 'albums')
                data.parse_albums('recommendedalbums', 32018, full_liz,
                                  self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "randomsongs":
                xbmcplugin.setContent(int(sys.argv[1]), 'songs')
                data.parse_song('randomsongs', 32015, full_liz, self.USECACHE,
                                self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "randommusicvideos":
                xbmcplugin.setContent(int(sys.argv[1]), 'musicvideos')
                data.parse_musicvideos('randommusicvideos', 32022, full_liz,
                                       self.USECACHE, self.PLOT_ENABLE,
                                       self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentmusicvideos":
                xbmcplugin.setContent(int(sys.argv[1]), 'musicvideos')
                data.parse_musicvideos('recentmusicvideos', 32023, full_liz,
                                       self.USECACHE, self.PLOT_ENABLE,
                                       self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "movie":
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
                data.parse_dbid('movie', self.dbid, full_liz)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "episode":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_dbid('episode', self.dbid, full_liz)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "song":
                xbmcplugin.setContent(int(sys.argv[1]), 'songs')
                data.parse_dbid('song', self.dbid, full_liz)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == 'playliststats':
                data.get_playlist_stats(self.path)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == 'actors':
                data.get_actors(self.dbid, self.dbtype, full_liz)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)

            # Play an albums
            elif content_type == "play_album":
                data.play_album(self.ALBUM)
                return
        xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))
    def __init__(self):
        self._init_vars()
        self._parse_argv()
        if not self.TYPE:
            router.run()
        for content_type in self.TYPE.split("+"):
            full_liz = list()
            if content_type == "randommovies":
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
                data.parse_movies('randommovies', 32004, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentmovies":
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
                data.parse_movies('recentmovies', 32005, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recommendedmovies":
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
                data.parse_movies('recommendedmovies', 32006, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recommendedepisodes":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_tvshows_recommended('recommendedepisodes', 32010, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "favouriteepisodes":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_tvshows_favourite('favouriteepisodes', 32020, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentepisodes":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_tvshows('recentepisodes', 32008, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "randomepisodes":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_tvshows('randomepisodes', 32007, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentvideos":
                xbmcplugin.setContent(int(sys.argv[1]), 'videos')
                listA = []
                listB = []
                dateListA = []
                dateListB = []
                data.parse_movies('recentmovies', 32005, listA, self.USECACHE, self.PLOT_ENABLE, self.LIMIT, dateListA, "dateadded")
                data.parse_tvshows('recentepisodes', 32008, listB, self.USECACHE, self.PLOT_ENABLE, self.LIMIT, dateListB, "dateadded")
                full_liz = data._combine_by_date(listA, dateListA, listB, dateListB, self.LIMIT, self.SETTINGSLIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "randomalbums":
                xbmcplugin.setContent(int(sys.argv[1]), 'albums')
                data.parse_albums('randomalbums', 32016, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentalbums":
                xbmcplugin.setContent(int(sys.argv[1]), 'albums')
                data.parse_albums('recentalbums', 32017, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recommendedalbums":
                xbmcplugin.setContent(int(sys.argv[1]), 'albums')
                data.parse_albums('recommendedalbums', 32018, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "randomsongs":
                xbmcplugin.setContent(int(sys.argv[1]), 'songs')
                data.parse_song('randomsongs', 32015, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "randommusicvideos":
                xbmcplugin.setContent(int(sys.argv[1]), 'musicvideos')
                data.parse_musicvideos('randommusicvideos', 32022, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "recentmusicvideos":
                xbmcplugin.setContent(int(sys.argv[1]), 'musicvideos')
                data.parse_musicvideos('recentmusicvideos', 32023, full_liz, self.USECACHE, self.PLOT_ENABLE, self.LIMIT)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "movie":
                xbmcplugin.setContent(int(sys.argv[1]), 'movies')
                data.parse_dbid('movie', self.dbid, full_liz)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "episode":
                xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
                data.parse_dbid('episode', self.dbid, full_liz)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == "song":
                xbmcplugin.setContent(int(sys.argv[1]), 'songs')
                data.parse_dbid('song', self.dbid, full_liz)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == 'playliststats':
                data.get_playlist_stats(self.path)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)
            elif content_type == 'actors':
                data.get_actors(self.dbid, self.dbtype, full_liz)
                xbmcplugin.addDirectoryItems(int(sys.argv[1]), full_liz)

            # Play an albums
            elif content_type == "play_album":
                data.play_album(self.ALBUM)
                return
        xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))
Beispiel #3
0
# -*- coding: utf8 -*-

# Copyright (C) 2015 - Philipp Temminghoff <*****@*****.**>
# This program is Free Software see LICENSE file for details

from resources.lib import router

router.run()