mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 17:36:18 -05:00
Special handling of json mimetype for json files. Moving types up to avoid overwriting mime.types. Adding custom types to nginx to server ebooks better. Displaying EBookCard correctly when ebook was not indexed correctly. Global search can search for all ebooks (mobi/epub). Testing when mimetype suffix is searched. Adding eBook to global search filter list. Opening mimetype search to match mimetypes that may not end with expected suffix. Adding log warning to explain refresh speed. Generating ebook covers after refresh. Testing that another nearby book removes the cover. Calibre covers can be discovered and associated with an ebook. Handling if ebooklib is not yet installed. Adding ebook table and modeler to allow searching the contents of epub files. Marking all PDFs as un-indexed, so they will be indexed. Replacing null characters in PDF text. Testing PDFIndexer against example PDF file. Installing PyPDF2 to extract text for PDFIndexer.
30 lines
595 B
Python
30 lines
595 B
Python
"""Reindex pdfs
|
|
|
|
Revision ID: d0bbe45e56c3
|
|
Revises: dbf05c8e8dcc
|
|
Create Date: 2022-12-09 12:27:18.908533
|
|
|
|
"""
|
|
import os
|
|
|
|
from alembic import op
|
|
from sqlalchemy.orm import Session
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'd0bbe45e56c3'
|
|
down_revision = 'dbf05c8e8dcc'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False
|
|
|
|
|
|
def upgrade():
|
|
bind = op.get_bind()
|
|
session = Session(bind=bind)
|
|
|
|
session.execute("UPDATE file SET indexed=false WHERE mimetype = 'application/pdf'")
|
|
|
|
|
|
def downgrade():
|
|
pass
|