custom-components / sensor.radarr_upcoming_media

🎬 Radarr component to feed Upcoming Media Card.
Apache License 2.0
58 stars 24 forks source link

Digital Releases are not populating #22

Closed danwestness closed 5 months ago

danwestness commented 2 years ago

On my Radarr Calendar I have a few upcoming releases. Some are "Phyiscal" release dates, some are "Digital" release dates and some are "Cinemas" release dates.

The "Digital" ones (which are the ones i care about the most) are not appearing in the upcoming card.

sagaland93 commented 2 years ago

It's not pretty, but you could probably get away with doing something like this:

Edit 'sensor.py' and replace the sections like below. This adds 'digitalRelease' in between cinema and physicalRelease.

if ('inCinemas' in movie and days_until(movie['inCinemas'], self._tz) > -1): if not self.theaters: continue card_item['airdate'] = movie['inCinemas'] if days_until(movie['inCinemas'], self._tz) <= 7: card_item['release'] = 'In Theaters $day' else: card_item['release'] = 'In Theaters $day, $date' elif 'digitalRelease' in movie: card_item['airdate'] = movie['digitalRelease'] if days_until(movie['digitalRelease'], self._tz) <= 7: card_item['release'] = 'Available $day' else: card_item['release'] = 'Available $day, $date' elif 'physicalRelease' in movie: card_item['airdate'] = movie['physicalRelease'] if days_until(movie['physicalRelease'], self._tz) <= 7: card_item['release'] = 'Available $day' else: card_item['release'] = 'Available $day, $date'

in_cinemas = list(filter( lambda x: x['inCinemas'][:-10] == str(start), api.json())) digital_release = (list(filter(lambda x: x[ 'digitalRelease'][:-10] == str(start), api.json()))) physical_release = (list(filter(lambda x: x[ 'physicalRelease'][:-10] == str(start), api.json()))) combined = in_cinemas + digital_release + physical_release self.api_json = combined[:self.max_items]

if 'inCinemas' in movie and days_until(movie['inCinemas'], self._tz) > -1: movie['path'] = movie['inCinemas'] elif 'digitalRelease' in movie: movie['path'] = movie['digitalRelease'] elif 'physicalRelease' in movie: movie['path'] = movie['physicalRelease']

PS: I don't know the consequences of doing this, so do it at your own risk... But it works for me :)

mkanet commented 5 months ago

I just added this feature in the latest release. 0.3.9. Thank you for the suggestion. Sorry it took so long.