This repository has been archived on 2026-07-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cloud-reader/backend/apps/books/services/ebook_metadata.py
crisleo94 d9c66e68a6 fix: floating bookmarks
- update floating bookmarks
- fix search suggestions
- fix filters
2026-06-03 22:33:24 -05:00

9 lines
283 B
Python

from __future__ import annotations
from apps.books.models import EBook
def subjects_from_ebook(ebook: EBook) -> list[str]:
ol = (ebook.metadata_json or {}).get("openlibrary") or {}
return [s.strip() for s in (ol.get("subjects") or []) if isinstance(s, str) and s.strip()]