$def with (stats) $var title: Imports
$:render_template("admin/menu")

Imports

Add new books to import queue

New Books Imported Per Day

Summary

$ pending_count = stats.get_count(status='pending') Pending Items: $pending_count

$ rate = stats.get_imports_per_hour() Current Import Rate: $rate imports/hour.

ETA: $if rate: $ eta = pending_count*1.0 / rate ${"%.2f" % eta} hours $else: -

Summary By Date

$for date, counts in stats.get_count_by_date_status():
Date total #books created #books already found #books failed to import #books pending
$date $sum(counts.values()) $counts.get('created', 0) ${counts.get('found', 0) + counts.get('modified', 0)} $counts.get('failed', 0) $counts.get('pending', 0)

Recent Imports

$for row in stats.get_items(order="import_time desc", limit=20):
# Identifier OL Key Status Error Added Time Imported Time
$loop.index $truncate(row.ia_id, 40) $if row.ol_key: $row.ol_key.split("/")[-1] $else: - $row.status ${row.error or '-'} $datestr(row.added_time) $datestr(row.import_time)