diff --git a/shares.py b/shares.py index 7e68306a..be5ca8c3 100644 --- a/shares.py +++ b/shares.py @@ -54,7 +54,7 @@ def removeShare(baseDir: str, nickname: str, domain: str, # remove any image for the item itemIDfile = baseDir + '/sharefiles/' + nickname + '/' + itemID if sharesJson[itemID]['imageUrl']: - formats = ('png', 'jpg', 'gif', 'webp') + formats = ('png', 'jpg', 'gif', 'webp', 'avif') for ext in formats: if sharesJson[itemID]['imageUrl'].endswith('.' + ext): if os.path.isfile(itemIDfile + '.' + ext): @@ -108,7 +108,7 @@ def addShare(baseDir: str, if not imageFilename: sharesImageFilename = \ baseDir + '/accounts/' + nickname + '@' + domain + '/upload' - formats = ('png', 'jpg', 'gif', 'webp') + formats = ('png', 'jpg', 'gif', 'webp', 'avif') for ext in formats: if os.path.isfile(sharesImageFilename + '.' + ext): imageFilename = sharesImageFilename + '.' + ext @@ -128,7 +128,7 @@ def addShare(baseDir: str, if not os.path.isdir(baseDir + '/sharefiles/' + nickname): os.mkdir(baseDir + '/sharefiles/' + nickname) itemIDfile = baseDir + '/sharefiles/' + nickname + '/' + itemID - formats = ('png', 'jpg', 'gif', 'webp') + formats = ('png', 'jpg', 'gif', 'webp', 'avif') for ext in formats: if imageFilename.endswith('.' + ext): removeMetaData(imageFilename, itemIDfile + '.' + ext) @@ -202,7 +202,7 @@ def expireSharesForAccount(baseDir: str, nickname: str, domain: str) -> None: # remove any associated images itemIDfile = \ baseDir + '/sharefiles/' + nickname + '/' + itemID - formats = ('png', 'jpg', 'gif', 'webp') + formats = ('png', 'jpg', 'gif', 'webp', 'avif') for ext in formats: if os.path.isfile(itemIDfile + '.' + ext): os.remove(itemIDfile + '.' + ext)