[flickr] fix overwriting 'owner'/'user' data when 'info' is enabled

This commit is contained in:
Mike Fährmann
2025-05-13 11:11:03 +02:00
parent 6b84de6cf7
commit 204f1c5f92

View File

@@ -470,14 +470,15 @@ class FlickrAPI(oauth.OAuth1API):
self._extract_metadata(photo) self._extract_metadata(photo)
photo["id"] = text.parse_int(photo["id"]) photo["id"] = text.parse_int(photo["id"])
if "owner" in photo: if "owner" not in photo:
photo["owner"] = self.extractor.user
elif not self.meta_info:
photo["owner"] = { photo["owner"] = {
"nsid" : photo["owner"], "nsid" : photo["owner"],
"username" : photo["ownername"], "username" : photo["ownername"],
"path_alias": photo["pathalias"], "path_alias": photo["pathalias"],
} }
else:
photo["owner"] = self.extractor.user
del photo["pathalias"] del photo["pathalias"]
del photo["ownername"] del photo["ownername"]
@@ -527,7 +528,6 @@ class FlickrAPI(oauth.OAuth1API):
if info and self.meta_info: if info and self.meta_info:
try: try:
photo.update(self.photos_getInfo(photo["id"])) photo.update(self.photos_getInfo(photo["id"]))
photo["user"] = photo["owner"]
photo["title"] = photo["title"]["_content"] photo["title"] = photo["title"]["_content"]
photo["comments"] = text.parse_int( photo["comments"] = text.parse_int(
photo["comments"]["_content"]) photo["comments"]["_content"])