diff --git a/.DS_Store b/.DS_Store index caf0f17..ad16089 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/__init__.py b/app/__init__.py index 1ecdd02..15afa74 100755 --- a/app/__init__.py +++ b/app/__init__.py @@ -15,7 +15,7 @@ registry.register("rqlite.pyrqlite", "sqlalchemy_rqlite.pyrqlite", "dialect") basedir = os.path.abspath(os.path.dirname(__file__)) UPLOAD_FOLDER = os.path.join(basedir, 'uploads') -UPLOAD_FOLDER_COVER = os.path.join(basedir, 'uploads/cover') +UPLOAD_FOLDER_COVER = os.path.join(basedir, 'cover') #ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) load_dotenv(find_dotenv()) app = Flask(__name__) @@ -29,7 +29,7 @@ app.config['PORT'] = 80 #app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'mydatabase.db') db = SQLAlchemy(app) - +light = not os.path.isdir(UPLOAD_FOLDER) DOMAIN = environ.get('DOMAIN') socketio = SocketIO(app) diff --git a/app/cover.py b/app/cover.py index ef1bccc..19de8e1 100755 --- a/app/cover.py +++ b/app/cover.py @@ -37,8 +37,8 @@ def get_cover(file_path, filename): # Convert each page to a png image. for page in pages: - big_filename = "app/uploads/cover/"+page["filename"] + "_cover.png" - small_filename = "app/uploads/cover/"+page["filename"] + "cover_small" + ".png" + big_filename = "app/cover/"+page["filename"] + "_cover.png" + small_filename = "app/cover/"+page["filename"] + "cover_small" + ".png" img = pdf_page_to_png(src_pdf, pagenum = page["pagenum"], resolution = 200) img.save(filename = big_filename) diff --git a/app/templates/add_to_stacks.html b/app/templates/add_to_stacks.html index 2e7ab09..6cece35 100644 --- a/app/templates/add_to_stacks.html +++ b/app/templates/add_to_stacks.html @@ -6,7 +6,7 @@
These are all the stacks that have been built so far.
diff --git a/app/templates/header.html b/app/templates/header.html index 0d8b33d..fc9abe5 100755 --- a/app/templates/header.html +++ b/app/templates/header.html @@ -3,10 +3,16 @@Year | Category | Stack | + {%if light%} + {%else%}Add to a stack | + {%endif%} @@ -91,7 +98,7 @@
---|
- + |