mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 12:26:19 -05:00
Add Docs module for searching and organizing PDFs and EPUBs
Create a new Docs module that consolidates PDF and eBook handling into a unified system with subjects and authors support. This replaces the separate PDF/eBook modelers with a single Doc model backed by an alembic migration (rename ebook to doc). Key changes: - New modules/docs package with models, API, extractors, and lib - Subject and author metadata extraction with case-insensitive normalization for cleaner PDF metadata - Frontend Docs pages with AuthorsPage, SubjectsPage using CollectionTable, and doc card deletion - Global search integration for subjects and authors - Generic collection item count support - Frontend file card metadata adjusted to match collection sort - Bump yt-dlp version
This commit is contained in:
parent
4a21499bdd
commit
aefc7b1def
90 changed files with 4484 additions and 1189 deletions
43
modules/docs/schema.py
Normal file
43
modules/docs/schema.py
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import dataclasses
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DocSearchRequest:
|
||||
search_str: Optional[str] = None
|
||||
author: Optional[str] = None
|
||||
subject: Optional[str] = None
|
||||
language: Optional[str] = None
|
||||
mimetype: Optional[str] = None
|
||||
tag_names: Optional[list] = dataclasses.field(default_factory=list)
|
||||
order_by: Optional[str] = 'published_datetime'
|
||||
limit: int = 20
|
||||
offset: int = 0
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DocSearchResponse:
|
||||
file_groups: list = dataclasses.field(default_factory=list)
|
||||
totals: dict = dataclasses.field(default_factory=dict)
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DocStatistics:
|
||||
doc_count: int = 0
|
||||
epub_count: int = 0
|
||||
pdf_count: int = 0
|
||||
other_count: int = 0
|
||||
total_size: int = 0
|
||||
author_count: int = 0
|
||||
subject_count: int = 0
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DocStatisticsResponse:
|
||||
statistics: dict = dataclasses.field(default_factory=dict)
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DocFileFormatRequest:
|
||||
name: str = ''
|
||||
model_tag: str = 'docs'
|
||||
Loading…
Add table
Add a link
Reference in a new issue