Fix typos
This commit is contained in:
@@ -570,7 +570,7 @@ def uploadToImgur(imgPath, imgTitle=''):
|
|||||||
def cache_image(url, image=None):
|
def cache_image(url, image=None):
|
||||||
"""
|
"""
|
||||||
Saves an image to the cache directory.
|
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
|
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)
|
logger.debug(u"PlexPy Helpers :: Creating image cache directory at %s" % imgdir)
|
||||||
os.makedirs(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()
|
imghash = hashlib.md5(url).hexdigest()
|
||||||
imagefile = os.path.join(imgdir, imghash)
|
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:
|
if image:
|
||||||
try:
|
try:
|
||||||
with open(imagefile, 'wb') as cache_file:
|
with open(imagefile, 'wb') as cache_file:
|
||||||
@@ -599,4 +599,4 @@ def cache_image(url, image=None):
|
|||||||
imagefile = None
|
imagefile = None
|
||||||
imagetype = 'image/jpeg'
|
imagetype = 'image/jpeg'
|
||||||
|
|
||||||
return imagefile, imagetype
|
return imagefile, imagetype
|
||||||
|
Reference in New Issue
Block a user