open_db(args.database)
init_db()
- import_glst()
+
+ count_old, count_new = import_glst()
+ if count_old:
+ print("Imported %d genres (ignored %d existing)" % (
+ count_new, count_old))
+ else:
+ print("Imported %d genres" % count_new)
+
use_pbar = ttyProgressBar and not args.no_pbar and sys.stdout.isatty()
for inpx in args.inpx:
if use_pbar:
#! /usr/bin/env python
-from __future__ import print_function
import argparse
from m_librarian.config import get_config
from m_librarian.db import open_db, init_db
open_db(args.database)
init_db()
- old, new = import_glst()
- if old:
- print("Imported %d genres (ignored %d existing)" % (new, old))
+ count_old, count_new = import_glst()
+ if count_old:
+ print("Imported %d genres (ignored %d existing)" % (
+ count_new, count_old))
else:
- print("Imported %d genres" % new)
+ print("Imported %d genres" % count_new)