[fantia] add 'content_count' and 'content_num' metadata fields (#4627)

This commit is contained in:
Mike Fährmann
2023-10-13 20:06:39 +02:00
parent 2d41702762
commit 833dce141f
2 changed files with 10 additions and 5 deletions

View File

@@ -42,7 +42,11 @@ class FantiaExtractor(Extractor):
post = self._get_post_data(post_id)
post["num"] = 0
for content in self._get_post_contents(post):
contents = self._get_post_contents(post)
post["content_count"] = len(contents)
post["content_num"] = 0
for content in contents:
files = self._process_content(post, content)
yield Message.Directory, post
@@ -131,6 +135,7 @@ class FantiaExtractor(Extractor):
post["content_filename"] = content.get("filename") or ""
post["content_id"] = content["id"]
post["content_comment"] = content.get("comment") or ""
post["content_num"] += 1
post["plan"] = content["plan"] or self._empty_plan
files = []