only log when we actually find a corresponding media

This commit is contained in:
Sebastian Spaeth 2023-12-11 14:40:04 +01:00
parent 3b8751c6de
commit 320af39f35

View File

@ -269,9 +269,10 @@ if __name__ == '__main__':
if args.mxid: if args.mxid:
# Just clean a single media # Just clean a single media
file = mr.get_single_media(args.mxid) file = mr.get_single_media(args.mxid)
logging.info("Found media with id '%s'", args.mxid) if file:
if file and not args.dryrun: logging.info("Found media with id '%s'", args.mxid)
file.delete() if not args.dryrun:
file.delete()
else: # main clean out... else: # main clean out...
# Sanity checks # Sanity checks
mr.sanity_check_thumbnails() # warn in case of superfluous thumbnails mr.sanity_check_thumbnails() # warn in case of superfluous thumbnails