desc lazy add

This commit is contained in:
yzqzss 2023-06-02 22:01:23 +08:00
parent 933f886a52
commit 0a155a2e95

View File

@ -83,7 +83,7 @@ def upload_bvid(bvid):
"mediatype": "movies",
"collection": 'opensource_movies',
"title": bv_info['data']['View']['title'] + f' P{pid} ' + part ,
"description": bv_info['data']['View']['desc'],
"description": identifier + 'uploading...',
'creator': bv_info['data']['View']['owner']['name'], # UP 主
# UTC time
'date': time.strftime("%Y-%m-%d", time.gmtime(pubdate)),
@ -123,6 +123,8 @@ def upload_bvid(bvid):
new_md = {}
if item.metadata.get("upload-state") != "uploaded":
new_md.update({"upload-state": "uploaded"})
if item.metadata.get("description") != bv_info['data']['View']['desc']:
new_md.update({"description": bv_info['data']['View']['desc']})
if new_md:
r = item.modify_metadata(
metadata=new_md,