From 4921458782b1fcca0ddcab1d390694cba8324277 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Tue, 3 May 2016 10:31:42 -0700 Subject: [PATCH] Fix typos --- plexpy/helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plexpy/helpers.py b/plexpy/helpers.py index 0651c955..94a5ff3c 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -570,7 +570,7 @@ def uploadToImgur(imgPath, imgTitle=''): def cache_image(url, image=None): """ Saves an image to the cache directory. - If no image is provided, tries to return the image from the cach directory. + If no image is provided, tries to return the image from the cache directory. """ from plexpy import logger @@ -580,11 +580,11 @@ def cache_image(url, image=None): logger.debug(u"PlexPy Helpers :: Creating image cache directory at %s" % imgdir) os.makedirs(imgdir) - # Create a hash of the path to use as filename + # Create a hash of the url to use as the filename imghash = hashlib.md5(url).hexdigest() imagefile = os.path.join(imgdir, imghash) - # If an image was provided, save it to the cache directory + # If an image is provided, save it to the cache directory if image: try: with open(imagefile, 'wb') as cache_file: @@ -599,4 +599,4 @@ def cache_image(url, image=None): imagefile = None imagetype = 'image/jpeg' - return imagefile, imagetype \ No newline at end of file + return imagefile, imagetype