From 2db70b4d37aaecb353df6db8ef76f240c6aa289a Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 29 Dec 2023 11:28:17 +0300 Subject: [PATCH] Perf(web/app): Get `download_path` only if there're books to download Micro-optimization, to be honest. --- m_librarian/web/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m_librarian/web/app.py b/m_librarian/web/app.py index 38e5bea..6e09394 100644 --- a/m_librarian/web/app.py +++ b/m_librarian/web/app.py @@ -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) -- 2.39.5