]> git.phdru.name Git - m_librarian.git/blobdiff - m_librarian/download.py
Version 0.1.4
[m_librarian.git] / m_librarian / download.py
index 744e1a0273c35f06c5d1489b53796cba9556cf43..281efcaf7a2c81b4f32013da206b71c314ea2f74 100755 (executable)
@@ -37,6 +37,8 @@ def _compile_format():
                 got_percent = False
                 if c == 'a':
                     new_format = u'%(author1)s'
+                elif c == 'A':
+                    new_format = u'%(authors)s'
                 elif c == 'e':
                     new_format = u'%(extension)s'
                 elif c == 'f':
@@ -45,6 +47,10 @@ def _compile_format():
                     new_format = u'%(gname)s'
                 elif c == 'g':
                     new_format = u'%(gtitle)s'
+                elif c == 'J':
+                    new_format = u'%(gname_list)s'
+                elif c == 'j':
+                    new_format = u'%(gtitle_list)s'
                 elif c == 'l':
                     new_format = u'%(language)s'
                 elif c == 'n':
@@ -80,11 +86,14 @@ def download(book, dest_path=None, lib_path=None, a_format=None):
         raise ValueError('Bad format: "%s"' % compiled_format)
     bdict = {}
     bdict['author1'] = book.author1
+    bdict['authors'] = book.author_list
     bdict['extension'] = book.extension.name
     bdict['file'] = book.file
     genre = book.genres[0]
     bdict['gname'] = genre.name
     bdict['gtitle'] = genre.title
+    bdict['gname_list'] = book.genre_name_list
+    bdict['gtitle_list'] = book.genre_title_list
     bdict['language'] = book.language.name
     bdict['ser_no'] = book.ser_no or 0
     bdict['series'] = book.series