mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Merge branch '88-crash-on-fetching-image-information' into 'testing'
Resolve "Crash on fetching image information" See merge request piotrex43/RcGcDw!52
This commit is contained in:
commit
d6e56fb18b
|
@ -508,7 +508,11 @@ def embed_formatter(action, change, parsed_comment, categories):
|
||||||
if action == "upload/overwrite":
|
if action == "upload/overwrite":
|
||||||
if additional_info_retrieved:
|
if additional_info_retrieved:
|
||||||
article_encoded = change["title"].replace(" ", "_").replace(')', '\)')
|
article_encoded = change["title"].replace(" ", "_").replace(')', '\)')
|
||||||
|
try:
|
||||||
img_timestamp = [x for x in img_info[1]["timestamp"] if x.isdigit()]
|
img_timestamp = [x for x in img_info[1]["timestamp"] if x.isdigit()]
|
||||||
|
except IndexError:
|
||||||
|
logger.exception("Could not analize the information about the image (does it have only one version when expected more in overwrite?) which resulted in no Options field: {}".format(img_info))
|
||||||
|
else:
|
||||||
undolink = "https://{wiki}.gamepedia.com/index.php?title={filename}&action=revert&oldimage={timestamp}%21{filenamewon}".format(
|
undolink = "https://{wiki}.gamepedia.com/index.php?title={filename}&action=revert&oldimage={timestamp}%21{filenamewon}".format(
|
||||||
wiki=settings["wiki"], filename=article_encoded, timestamp="".join(img_timestamp),
|
wiki=settings["wiki"], filename=article_encoded, timestamp="".join(img_timestamp),
|
||||||
filenamewon=article_encoded.split(":", 1)[1])
|
filenamewon=article_encoded.split(":", 1)[1])
|
||||||
|
|
Loading…
Reference in a new issue