Skip to content

Commit 0e4e288

Browse files
author
MKR
authored
URL fix for downloaded images
1 parent 8956e0c commit 0e4e288

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

custom_components/sensor/plex_recently_added.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def __init__(self, hass, conf):
5555
self._dir = conf.get(CONF_IMG_CACHE)
5656
self.img = '{0}{1}{2}{3}{4}.jpg'.format(
5757
self.conf_dir, {}, self._dir, {}, {})
58+
self.img_url = '{0}{1}{2}{3}.jpg'.format({}, self._dir, {}, {})
5859
self._tz = timezone(str(hass.config.time_zone))
5960
self.cert = conf.get(CONF_SSL_CERT)
6061
self.ssl = 's' if conf.get(CONF_SSL) or self.cert else ''
@@ -157,13 +158,13 @@ def device_state_attributes(self):
157158
continue
158159
if self.dl_images:
159160
if os.path.isfile(self.img.format('www', 'p', key)):
160-
card_item['poster'] = self.img.format('../local',
161-
'p', key)
161+
card_item['poster'] = self.img_url.format('/local',
162+
'p', key)
162163
else:
163164
continue
164165
if os.path.isfile(self.img.format('www', 'f', key)):
165-
card_item['fanart'] = self.img.format('../local',
166-
'f', key)
166+
card_item['fanart'] = self.img_url.format('/local',
167+
'f', key)
167168
else:
168169
card_item['fanart'] = ''
169170
else:

0 commit comments

Comments
 (0)