[artstation] add 'num' and 'count' metadata fields (#2764)

This commit is contained in:
blankie
2022-07-19 12:25:07 +00:00
committed by GitHub
parent 0c73914848
commit 59b16b3f70

View File

@@ -32,9 +32,11 @@ class ArtstationExtractor(Extractor):
data = self.metadata()
for project in self.projects():
for asset in self.get_project_assets(project["hash_id"]):
for num, asset in enumerate(
self.get_project_assets(project["hash_id"]), 1):
asset.update(data)
adict = asset["asset"]
asset["num"] = num
yield Message.Directory, asset
if adict["has_embedded_player"] and self.external:
@@ -85,6 +87,7 @@ class ArtstationExtractor(Extractor):
assets = data["assets"]
del data["assets"]
data["count"] = len(assets)
if len(assets) == 1:
data["asset"] = assets[0]
yield data