Ejemplo n.º 1
0
def ADD_SERIES(addASIN, isPrime=True, export=False):
    shows = tvDB.lookupShowsdb(addASIN, isPrime)
    for showdata in shows:
        if export:
            xbmclibrary.EXPORT_SHOW(showdata[0])
        else:
            listtv.ADD_SHOW_ITEM(showdata, 'appfeed', 'BROWSE_SEASONS4SERIES')
Ejemplo n.º 2
0
def ADD_SEASON_SERIES(addASIN,
                      mode='appfeed',
                      submode='BROWSE_SEASONS4SERIES',
                      isPrime=True,
                      checklist='',
                      export=False):
    seasons = tvDB.lookupSeasondb(addASIN, isPrime)
    for seasondata in seasons:
        if seasondata[1] not in checklist:
            shows = tvDB.lookupShowsdb(seasondata[1], isPrime)
            for showdata in shows:
                if export:
                    xbmclibrary.EXPORT_SHOW(showdata[0])
                else:
                    listtv.ADD_SHOW_ITEM(showdata, mode, submode)
                return showdata[0], showdata[1]
    return False, False
Ejemplo n.º 3
0
def ADD_SHOW_ITEM(showdata, mode='listtv', submode='LIST_TV_SEASONS', cmmode=0, onlyinfo=False, export=False):
    asin, seriestitle, plot, network, mpaa, genres, actors, premiered, year, stars, votes, seasontotal, episodetotal, \
        audio, isHD, isprime, empty, empty, empty, poster, banner, fanart = showdata
    submode = 'LIST_TV_SEASONS' if mode == 'listtv' else submode
    poster = '' if not poster else poster
    infoLabels = {'Title': seriestitle,
                  'Plot': plot,
                  'mediatype': 'tvshow',
                  'MPAA': mpaa,
                  'Cast': actors.split(',') if actors else [],
                  'Year': year,
                  'Premiered': premiered,
                  'Rating': stars,
                  'Votes': votes,
                  'Genre': genres,
                  'Episode': episodetotal,
                  'TotalSeasons': seasontotal,
                  'Studio': network,
                  'AudioChannels': audio,
                  'Thumb': poster,
                  'Fanart': fanart,
                  'Asins': asin
                  }
    asin = asin.split(',')[0]

    if export:
        xbmclibrary.EXPORT_SHOW(asin)
        return

    cm = [(getString(30180 + cmmode) % getString(30166),
           'RunPlugin(%s?mode=common&sitemode=toogleWatchlist&asin=%s&remove=%s)' % (sys.argv[0], asin, cmmode)),
          (getString(30185) % getString(30166),
          'RunPlugin(%s?mode=xbmclibrary&sitemode=EXPORT_SHOW&asin=%s)' % (sys.argv[0], asin)),
          (getString(30183), 'Container.Update(%s?mode=appfeed&sitemode=getSimilarities&asin=%s)' % (sys.argv[0], asin)),
          (getString(30186), 'RunPlugin(%s?mode=xbmclibrary&sitemode=UpdateLibrary)' % sys.argv[0]),
          (getString(30155) % getString(30166), 'RunPlugin(%s?mode=tv&sitemode=delfromTVdb&asins=%s&table=shows&title=%s)' % (
           sys.argv[0], urllib.quote_plus(infoLabels['Asins']), urllib.quote_plus(seriestitle.encode('utf-8'))))]

    if onlyinfo:
        return infoLabels
    else:
        addDir(seriestitle, mode, submode, infoLabels['Asins'], poster, fanart, infoLabels, cm=cm)
Ejemplo n.º 4
0
def LIST_TVSHOWS(export=False,
                 HDonly=False,
                 mpaafilter=False,
                 genrefilter=False,
                 creatorfilter=False,
                 networkfilter=False,
                 yearfilter=False,
                 favorfilter=False):
    if export:
        xbmclibrary.SetupLibrary()
    import tv as tvDB
    shows = tvDB.loadTVShowdb(HDonly=HDonly,
                              mpaafilter=mpaafilter,
                              genrefilter=genrefilter,
                              creatorfilter=creatorfilter,
                              networkfilter=networkfilter,
                              yearfilter=yearfilter,
                              favorfilter=favorfilter)
    for showdata in shows:
        if export:
            xbmclibrary.EXPORT_SHOW(showdata[0])
        else:
            ADD_SHOW_ITEM(showdata, HDonly=HDonly)
    if not export:
        xbmcplugin.setContent(pluginhandle, 'tvshows')
        xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL)
        xbmcplugin.addSortMethod(pluginhandle,
                                 xbmcplugin.SORT_METHOD_VIDEO_YEAR)
        xbmcplugin.addSortMethod(pluginhandle,
                                 xbmcplugin.SORT_METHOD_VIDEO_RATING)
        xbmcplugin.addSortMethod(pluginhandle,
                                 xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE)
        xbmcplugin.endOfDirectory(pluginhandle, updateListing=False)
        viewenable = common.addon.getSetting("viewenable")
        if viewenable == 'true':
            view = int(common.addon.getSetting("showview"))
            xbmc.executebuiltin("Container.SetViewMode(" +
                                str(confluence_views[view]) + ")")
Ejemplo n.º 5
0
def ADD_SHOW_ITEM(showdata,
                  mode='listtv',
                  submode='LIST_TV_SEASONS',
                  cmmode=0,
                  onlyinfo=False,
                  export=False):
    asin, seriestitle, plot, network, mpaa, genres, actors, premiered, year, stars, votes, seasontotal, episodetotal, audio, isHD, isprime, empty, empty, empty, poster, banner, fanart = showdata
    infoLabels = {'Title': seriestitle, 'TVShowTitle': seriestitle}
    if plot:
        infoLabels['Plot'] = plot
    if mpaa:
        infoLabels['MPAA'] = mpaa
    if actors:
        infoLabels['Cast'] = actors.split(',')
    if year:
        infoLabels['Year'] = year
    if premiered:
        infoLabels['Premiered'] = premiered
    if stars:
        infoLabels['Rating'] = stars
    if votes:
        infoLabels['Votes'] = votes
    if genres:
        infoLabels['Genre'] = genres
    if episodetotal:
        infoLabels['Episode'] = episodetotal
    if seasontotal:
        infoLabels['TotalSeasons'] = seasontotal
    if network:
        infoLabels['Studio'] = network
    if audio:
        infoLabels['AudioChannels'] = audio
    if mode == 'listtv':
        submode = 'LIST_TV_SEASONS'
    if poster is None:
        poster = ''
    infoLabels['Thumb'] = poster
    infoLabels['Fanart'] = fanart
    infoLabels['Asins'] = asin
    asin = asin.split(',')[0]
    if export:
        xbmclibrary.EXPORT_SHOW(asin)
        return
    cm = []
    cm.append((
        common.getString(30180 + cmmode) % common.getString(30166),
        'XBMC.RunPlugin(%s?mode=<common>&sitemode=<toogleWatchlist>&asin=<%s>&remove=<%s>)'
        % (sys.argv[0], asin, cmmode)))
    cm.append((
        common.getString(30185) % common.getString(30166),
        'XBMC.RunPlugin(%s?mode=<xbmclibrary>&sitemode=<EXPORT_SHOW>&asin=<%s>)'
        % (sys.argv[0], asin)))
    cm.append((common.getString(
        30183
    ), 'Container.Update(%s?mode=<appfeed>&sitemode=<getSimilarities>&asin=<%s>)'
               % (sys.argv[0], asin)))
    cm.append(
        (common.getString(30186),
         'XBMC.RunPlugin(%s?mode=<xbmclibrary>&sitemode=<UpdateLibrary>)' %
         sys.argv[0]))
    cm.append((
        common.getString(30155) % common.getString(30166),
        'XBMC.RunPlugin(%s?mode=<tv>&sitemode=<delfromTVdb>&asins=<%s>&table=<shows>&title=<%s>)'
        % (sys.argv[0], urllib.quote_plus(
            infoLabels['Asins']), urllib.quote_plus(seriestitle))))
    if onlyinfo:
        return infoLabels
    else:
        common.addDir(seriestitle,
                      mode,
                      submode,
                      infoLabels['Asins'],
                      poster,
                      fanart,
                      infoLabels,
                      isHD=isHD,
                      cm=cm)