Ejemplo n.º 1
0
 def get_tv_folder_nfos(self):
     nfos = []
     nfos_append = nfos.append  # For speed since we can't do a list comp easily here
     for f in xbmcvfs.listdir(BASEDIR_TV)[0]:
         tmdb_id = get_tmdb_id_nfo(BASEDIR_TV, f)
         nfos_append({'tmdb_id': tmdb_id, 'folder': f}) if tmdb_id else None
     return nfos
Ejemplo n.º 2
0
    def update_tvshows(self, force=False, **kwargs):
        nfos = []

        # Get TMDb IDs from nfo files in folder
        nfos_append = nfos.append  # For speed since we can't do a list comp easily here
        for f in xbmcvfs.listdir(BASEDIR_TV)[0]:
            tmdb_id = get_tmdb_id_nfo(BASEDIR_TV, f)
            nfos_append({'tmdb_id': tmdb_id, 'folder': f}) if tmdb_id else None

        # Update each show in folder
        nfos_total = len(nfos)
        for x, i in enumerate(nfos):
            self._update(x,
                         nfos_total,
                         message=u'{} {}...'.format(
                             ADDON.getLocalizedString(32167), i['folder']))
            self.add_tvshow(tmdb_id=i['tmdb_id'], force=force)

        # Update last updated stamp
        ADDON.setSettingString(
            'last_autoupdate',
            u'Last updated {}'.format(get_current_date_time()))
Ejemplo n.º 3
0
def get_unique_folder(name, tmdb_id, basedir):
    nfo_id = get_tmdb_id_nfo(basedir, name) if name in xbmcvfs.listdir(basedir)[0] else None
    if nfo_id and try_int(nfo_id) != try_int(tmdb_id):
        name += ' (TMDB {})'.format(tmdb_id)
    return name