Refactored call to filter_books into Epub class

This commit is contained in:
Mike
2019-10-06 15:58:26 -04:00
parent ee3e857a7b
commit 3f803083a4
5 changed files with 35 additions and 24 deletions

15
main.py
View File

@@ -3,7 +3,7 @@
import sys
from PIL import Image
sys.path.insert(1, 'lib/')
from pyShelf import InitFiles
from pyShelf import InitFiles, Epub
from config import Config
from library import Catalogue
# Get configuration settings
@@ -14,15 +14,4 @@ InitFiles(config.file_array)
Catalogue = Catalogue()
# Filter Your books
# This only needs to be run on first run, & when new books are added
# TODO Refactor to its own function
book_list = Catalogue.filter_books()
for book in book_list:
extracted = Catalogue.extract_metadata(book_list[book])
# TODO Insert extracted data to database
if extracted[2] != False:
# Only display if a image is present
cover_image = Image.open(extracted[2])
cover_image.show()
# TODO Insert book in database
print(extracted)
Epub().import_books()