From ea9d82cfbcb4caa4d3a92ebb9abee80939c6dc64 Mon Sep 17 00:00:00 2001 From: sharky555 Date: Tue, 20 Sep 2022 19:23:27 -0600 Subject: [PATCH] changed cover image handle to be more robust --- autoupload.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autoupload.py b/autoupload.py index b42292c..103b2c4 100644 --- a/autoupload.py +++ b/autoupload.py @@ -741,8 +741,11 @@ if __name__ == "__main__": # Folder_name equals the last folder in the path, this is used to rename .torrent files to something relevant. folder_name = os.path.basename(os.path.normpath(directory)) - # Identifying cover.jpg path - cover_path = directory + "/" + cfg['local_prefs']['cover_name'] + # Identifying cover path + cover_file = [f for f in os.listdir(directory) if (f.lower() in cfg['local_prefs']['cover_templates'])] + cover_path = directory + "\\" + cover_file[0] + if debug: + print(f"Using cover file: {cover_path}") # Create torrent file. torrentfile = createtorrent(authkey, directory, folder_name, releasedata)