Richard-Weiss / Bing-Creator-Image-Downloader

Downloads all Bing Creator images from a collection
MIT License
38 stars 8 forks source link

Use dateModified as fallback for creation date #24

Closed rc-gr closed 9 months ago

rc-gr commented 9 months ago

For reasons unknown, images under set_creation_date() may sometimes return None even when the original images are still valid. From personal observation, the likelihood of this occurring increases the older the saved generation gets.

This is also observed and pointed out in further detail under #22.

This commit would use dateModified from a collection item as fallback which, for all intents and purposes for saved generated images, would usually return the same date as the creation date. It should also be just as if not more persistent than the creation date because this date presumably applies to a collection item as a whole, and I've yet to see an item completely invalidated (as opposed to partially like missing thumbnail, original image etc.).

Richard-Weiss commented 9 months ago

@rc-gr I've modified the code a little bit to prevent a KeyError when assigning images and I removed the declaration of creation_date_string, as there is no block level scope in Python.