mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-19 14:36:22 -05:00
Remove unused code found by vulture (#885)
Deletes functions, methods, classes, schema dataclasses, error classes, Events senders, and module-level constants that nothing references, including tests. Also drops the unused `doc_cleanup(test_directory)` and `_wait_for_sub_job_with_progress(collection_idx)` parameters, and the imports that only served removed code. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a248104b2f
commit
22ada7eb57
34 changed files with 9 additions and 586 deletions
|
|
@ -204,7 +204,7 @@ def _auto_create_collections(session: Session, file_group: FileGroup, metadata):
|
|||
|
||||
|
||||
@register_refresh_cleanup
|
||||
def doc_cleanup(test_directory=None):
|
||||
def doc_cleanup():
|
||||
"""Remove empty author/subject collections after refresh."""
|
||||
from sqlalchemy import func
|
||||
from wrolpi.collections.models import Collection, CollectionItem
|
||||
|
|
|
|||
|
|
@ -26,12 +26,6 @@ DOC_MIMETYPES = (
|
|||
'application/x-cb7',
|
||||
)
|
||||
|
||||
# Mimetypes that are considered ebook formats.
|
||||
EBOOK_MIMETYPES = (
|
||||
EPUB_MIMETYPE,
|
||||
MOBI_MIMETYPE,
|
||||
)
|
||||
|
||||
|
||||
COMIC_BOOK_SUFFIXES = ('.cbz', '.cbr', '.cbt', '.cb7')
|
||||
|
||||
|
|
@ -135,11 +129,6 @@ class Doc(ModelHelper, Base):
|
|||
session.delete(fg)
|
||||
|
||||
|
||||
# Section kinds.
|
||||
SECTION_KIND_EPUB_SPINE = 'epub_spine'
|
||||
SECTION_KIND_PDF_PAGE = 'pdf_page'
|
||||
|
||||
|
||||
class DocSection(ModelHelper, Base):
|
||||
"""A searchable sub-range of a Doc.
|
||||
|
||||
|
|
|
|||
|
|
@ -22,23 +22,6 @@ class DocSearchResponse:
|
|||
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