feat(db): add video pages and up follower snapshot schema
This commit is contained in:
1 parent
707ed7d7d7
commit
4942d1d161
10 files changed
+521
-13
No files matched your search
@@ -30,6 +30,7 @@ class FavResource:
|
||||
cover: str | None
|
||||
attr: int
|
||||
fav_time: int | None
|
||||
pages: int | None = None
|
||||
|
||||
@property
|
||||
def invalid(self) -> bool:
|
||||
@@ -51,6 +52,12 @@ class FavResource:
|
||||
duration = raw_duration if isinstance(raw_duration, int) and not isinstance(
|
||||
raw_duration, bool
|
||||
) else None
|
||||
raw_pages = item.get("page")
|
||||
pages = raw_pages if (
|
||||
isinstance(raw_pages, int)
|
||||
and not isinstance(raw_pages, bool)
|
||||
and raw_pages > 0
|
||||
) else None
|
||||
raw_attr = item.get("attr", 0)
|
||||
attr = raw_attr if isinstance(raw_attr, int) and not isinstance(raw_attr, bool) else 0
|
||||
fav_time = item.get("fav_time")
|
||||
@@ -70,6 +77,7 @@ class FavResource:
|
||||
cover=str(item.get("cover") or "") or None,
|
||||
attr=attr,
|
||||
fav_time=fav_time,
|
||||
pages=pages,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user