support single ebook harvest
parent
73b863450e
commit
6566afd92f
|
@ -9,10 +9,14 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('limit', nargs='?', type=int, default=0, help="max to harvest")
|
||||
parser.add_argument('--ebook', nargs='?', type=int, default=0, help="ebook to harvest")
|
||||
|
||||
def handle(self, limit=0, **options):
|
||||
limit = int(limit) if limit else 0
|
||||
rl = RateLimiter()
|
||||
if options.get('ebook'):
|
||||
onlines = Ebook.objects.filter(id=options.get('ebook'))
|
||||
else:
|
||||
onlines = Ebook.objects.filter(format='online')
|
||||
done = 0
|
||||
for online in onlines:
|
||||
|
|
Loading…
Reference in New Issue