Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Apr 19, 2022
2 parents 62139df + 41a8f19 commit c6479e2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions picframe/image_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,13 @@ def get_file_info(self, file_id):
if not file_id: return None
sql = "SELECT * FROM all_data where file_id = {0}".format(file_id)
row = self.__db.execute(sql).fetchone()
if row is not None and row['last_modified'] != os.path.getmtime(row['fname']):
self.__logger.debug('Cache miss: File %s changed on disk', row['fname'])
self.__insert_file(row['fname'], file_id)
row = self.__db.execute(sql).fetchone() # description inserted in table
try:
if row is not None and row['last_modified'] != os.path.getmtime(row['fname']):
self.__logger.debug('Cache miss: File %s changed on disk', row['fname'])
self.__insert_file(row['fname'], file_id)
row = self.__db.execute(sql).fetchone() # description inserted in table
except OSError:
self.__logger.warning("Image '%s' does not exists or is inaccessible" %row['fname'])
if row is not None and row['latitude'] is not None and row['longitude'] is not None and row['location'] is None:
if self.__get_geo_location(row['latitude'], row['longitude']):
row = self.__db.execute(sql).fetchone() # description inserted in table
Expand Down

0 comments on commit c6479e2

Please sign in to comment.