]> git.phdru.name Git - m_librarian.git/commitdiff
Perf(web/app): Get `download_path` only if there're books to download
authorOleg Broytman <phd@phdru.name>
Fri, 29 Dec 2023 08:28:17 +0000 (11:28 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 29 Dec 2023 08:28:17 +0000 (11:28 +0300)
Micro-optimization, to be honest.

m_librarian/web/app.py

index 38e5beacf2d0c9c72a5492fff7addaef5b881ea6..6e093946f62c13e4feee312aeb9b13534f315e5c 100644 (file)
@@ -113,8 +113,8 @@ def download_books():
         if k.split('_')[-1] == 'books':
             for bid in form.getall(k):
                 books_ids.append(bid)
-    download_path = get_config().getpath('download', 'path')
     if books_ids:
+        download_path = get_config().getpath('download', 'path')
         for bid in books_ids:
             book = Book.get(int(bid))
             download(book, download_path)