]> git.phdru.name Git - m_librarian.git/blobdiff - scripts/ml-search.py
Allow to set download format
[m_librarian.git] / scripts / ml-search.py
index b257084a749d03a487f2f0889b656b57639d35dc..d19c5b4f6408b8ce4d629fe7913e2fd816cf63a2 100755 (executable)
@@ -60,9 +60,7 @@ def _search_authors(case_sensitive, search_type, args):
         return
     count = 0
     for author in authors:
-        names = filter(None, (author.surname, author.name, author.misc_name))
-        fullname = u' '.join(names)
-        print fullname.encode(default_encoding), \
+        print author.fullname.encode(default_encoding), \
             (u"(%s: %d)" % (_('books'), author.count))\
             .encode(default_encoding),
         if args.verbose >= 1:
@@ -146,8 +144,7 @@ def _search_books(case_sensitive, search_type, args):
                              "(found %d).\n" % count)
             sys.exit(1)
         book = books[0]
-        download(book.archive, '%s.%s' % (book.file, book.extension.name),
-                 book.date, args.path)
+        download(book, args.path)
         return
     count = 0
     for book in books:
@@ -158,10 +155,7 @@ def _search_books(case_sensitive, search_type, args):
         if args.verbose >= 1:
             print " ", _("Author(s)").encode(default_encoding), ":",
             for author in book.authors:
-                names = filter(None,
-                               (author.surname, author.name, author.misc_name))
-                fullname = u' '.join(names)
-                print fullname.encode(default_encoding),
+                print author.fullname.encode(default_encoding),
             print
             print " ", _("Genre(s)").encode(default_encoding), ":",
             for genre in book.genres: