Skip to content

Commit

Permalink
fix: forward video is not parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
JamzumSum committed Apr 21, 2023
1 parent 692e3f9 commit 01da9e2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 31 deletions.
52 changes: 26 additions & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aioqzone-feed"
version = "0.13.4.dev3"
version = "0.13.4.dev4"
description = "aioqzone plugin providing higher level api for processing feed."
authors = ["aioqzone <[email protected]>"]
license = "AGPL-3.0"
Expand Down
7 changes: 3 additions & 4 deletions src/aioqzone_feed/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,16 @@ def _set_detail_from_feeddata(self, obj: FeedData):
)
if org.pic:
self.forward.media = [VisualMedia.from_pic(i) for i in org.pic.picdata]
if org.video:
self.forward.media.insert(0, VisualMedia.from_video(org.video))

elif isinstance(obj.original, Share):
self.forward = obj.original.common.orgkey

if obj.pic:
self.media = [VisualMedia.from_pic(i) for i in obj.pic.picdata]
if obj.video:
self.media.append(VisualMedia.from_video(obj.video))
self.media.insert(0, VisualMedia.from_video(obj.video))

@set_detail.register
def set_fromhtml(self, obj: HtmlContent):
Expand All @@ -287,6 +289,3 @@ class FeedContent(BaseDetail, BaseFeed):
def __hash__(self) -> int:
media_hash = hash(tuple(i.raw for i in self.media)) if self.media else 0
return hash((self.uin, self.abstime, self.forward, media_hash))

def __repr__(self) -> str:
return super().__repr__() + f'(content="{self.entities}",#media={len(self.media or "0")})'

0 comments on commit 01da9e2

Please sign in to comment.