Consolidating deletion endpoints.
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Controller Tests / controller-tests (push) Has been cancelled
Jest Tests / jest-tests (push) Has been cancelled

This commit is contained in:
Roland 2026-05-03 18:50:22 -06:00
parent 09a967535b
commit ba63170e55
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
24 changed files with 309 additions and 320 deletions

View file

@ -76,6 +76,10 @@ class Doc(ModelHelper, Base):
d['data']['ebook_path'] = self.file_group.resolve_path(d['data']['ebook_path'])
return d
@staticmethod
def get_by_path(session: Session, path) -> Optional['Doc']:
return session.query(Doc).join(FileGroup).filter(FileGroup.primary_path == str(path)).one_or_none()
@staticmethod
def can_model(file_group: FileGroup) -> bool:
if file_group.mimetype and mimetype_is_doc(file_group.mimetype):