Skip to content

Commit

Permalink
Merge pull request #6 from youdroid/Fix_EmptyReleaseDate
Browse files Browse the repository at this point in the history
Fix missing release date
  • Loading branch information
youdroid authored May 24, 2020
2 parents 8fd2e9b + 6e72783 commit 1a2fc55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/couchpotato/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ def update(self):

for movie in ifs_movies['movies']:
card_items = {}
if "released" in movie['info']:
if "released" in movie['info'] and not "".__eq__(movie['info']['released']):
card_items['airdate'] = movie['info']['released']
else:
elif "release_date" in movie['info'] and len(movie['info']['release_date']['expires']) != 0:
card_items['airdate'] = datetime.fromtimestamp(movie['info']['release_date']['expires']).strftime(
"%Y-%m-%d")
else:
card_items['airdate'] = " "
card_items['episode'] = ""
card_items['release'] = "$day, $date $time"
if "original_title" in movie['info']:
Expand Down

0 comments on commit 1a2fc55

Please sign in to comment.