Пример #1
0
def nondbshow(search_string, count, ignore):
    """Download anything, ignoring the database.

    This just does a simple search and passes you choise to the bittorrent
    client.  The download is not recorded in the database.
    """
    send(te, v)
    if not search_string:
        raise click.UsageError('Empty "search_string" not allowed.')

    if not ignore and Config.warnvpn:
        L = Location()
        if Config.warnvpn:
            if not L.ips_match(
                    parts_to_match=Config.parts_to_match):
                if not L.message():
                    sys.exit(1)

    nons = Show(show_type='nondb')
    nons.non_db(search_string, count)
Пример #2
0
def add(show_name, bulk, season, episode):
    """Add a new tv show to the database.

    The SHOW_NAME can be a partial name, but the more accurate the name
    the better the search will be.  It helps to add the year to the name
    as well.

    If you search for 'Doctor Who', the result will be the original series,
    but if you want the modern one, search for 'Doctor Who 2005'

    If bulk is used, then season and episode can be used.
    """
    send(te, v)
    if not show_name:
        raise click.UsageError('Empty "show_name" not allowed.')

    new_show = Show(show_type='new')
    if bulk is True:
        new_show.add_bulk(show_name, season=season, episode=episode)
    else:
        new_show.add_new(name=show_name)
Пример #3
0
def add(show_name, bulk, season, episode):
    """Add a new tv show to the database.

    The SHOW_NAME can be a partial name, but the more accurate the name
    the better the search will be.  It helps to add the year to the name
    as well.

    If you search for 'Doctor Who', the result will be the original series,
    but if you want the modern one, search for 'Doctor Who 2005'

    If bulk is used, then season and episode can be used.
    """
    send(te, v)
    if not show_name:
        raise click.UsageError('Empty "show_name" not allowed.')

    new_show = Show(show_type='new')
    if bulk is True:
        new_show.add_bulk(show_name, season=season, episode=episode)
    else:
        new_show.add_new(name=show_name)
Пример #4
0
 def __next__(self):
     if self.i == len(self.dbdata):
         raise StopIteration
     show = Show(dbdata=self.dbdata[self.i])
     self.i += 1
     return show