From 35a0c1559ba51f6be7aacc7ffb4f4974f808de3a Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 14 Jan 2025 10:02:30 +0100 Subject: [PATCH] Attempt to support books on sdcard --- src/database.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database.rs b/src/database.rs index 45d9771..e640771 100644 --- a/src/database.rs +++ b/src/database.rs @@ -30,7 +30,7 @@ fn get_epubs_from_database(tx: &Transaction) -> Vec { r#" SELECT books.id, folders.name, files.filename, books.firstauthor, books.author, genres.name, first_author_letter, series - FROM books_impl books JOIN files + FROM books_impl books JOIN files, storages ON books.id = files.book_id JOIN folders ON folders.id = files.folder_id @@ -38,7 +38,7 @@ fn get_epubs_from_database(tx: &Transaction) -> Vec { ON books.id = btg.bookid LEFT OUTER JOIN genres ON genres.id = btg.genreid - WHERE files.storageid = 1 AND {}.ext = 'epub' + WHERE files.storageid IN (SELECT storages.id WHERE storages.type = 1) AND {}.ext = 'epub' ORDER BY books.id"#, &books_or_files );