From a5c5ef3710db302193d67fbc6cf1cfcc19273108 Mon Sep 17 00:00:00 2001 From: blacktwin Date: Mon, 9 Mar 2020 11:52:14 -0400 Subject: [PATCH] add total size of whats been found --- utility/media_manager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/utility/media_manager.py b/utility/media_manager.py index d3d15df..f57a224 100644 --- a/utility/media_manager.py +++ b/utility/media_manager.py @@ -418,10 +418,15 @@ if __name__ == '__main__': if opts.action == 'show': print("The following items were added before {}".format(opts.date)) + sizes = [] for item in unwatched_lst: added_at = datetime.datetime.utcfromtimestamp(float(item.added_at)).strftime("%Y-%m-%d") - print("\t{} added {}\tSize: {}\n\tFile: {}".format( - item.title, added_at, sizeof_fmt(int(item.file_size)), item.file)) + size = int(item.file_size) if item.file_size else '' + sizes.append(size) + print(u"\t{} added {}\tSize: {}\n\t\tFile: {}".format( + item.title, added_at, sizeof_fmt(size), item.file)) + total_size = sum(sizes) + print('Total size: {}'.format(sizeof_fmt(total_size))) if opts.action == 'delete': plex_deletion(unwatched_lst, libraries, opts.toggleDeletion)