Repository: pymedusa/Medusa

Issue:
Postprocessing exception on Prowl notifications
Since updating to the latest commit earlier today, postprocessing throws an exception once it gets to the point of sending Prowl notifications (error below). Actual postprocessing seems to go fine--e.g., episode shows up in the db properly, etc. Never had issues with Prowl notifications before today. Tested two different shows and got the same error.

ETA: I actually turned Prowl notifications off and got this same error postprocessing another ep so... maybe it's not related to Prowl? Was just assuming because it was throwing something in prowl.py. 

**To Reproduce**
Steps to reproduce the behavior:
1. Turn on Prowl notifications.
2. Postprocess an episode.
3. See error.

**Expected behavior**
I expect to get a Prowl notification that the download is complete and for Medusa not to throw any errors.


**Medusa (please complete the following information):**
 - OS: Linux-3.2.40-i686-with-glibc2.0 (on a Synology NAS)
 - Branch: master
 - Commit: db102f3561204d388c3f4cbf6e89c79282ecd12f
 - Python version: 3.7.10
 - Database version: 44.18

<details>

2021-07-06 22:48:45 ERROR    TORNADO :: [db102f3] API :: AttributeError("'list' object has no attribute 'series_id'")
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/server/api/v1/core.py", line 165, in get
    out_dict = _call_dispatcher(args, kwargs)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/server/api/v1/core.py", line 235, in call_dispatcher
    cur_out_dict = func(cur_args, cur_kwargs).run()  # call function and get response
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/server/api/v1/core.py", line 1336, in run
    proc_type=self.type
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/process_tv.py", line 207, in run
    process_results.process(force=force, **kwargs)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/process_tv.py", line 355, in process
    ignore_subs=ignore_subs)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/process_tv.py", line 627, in process_files
    self.process_media(path, self.video_files, force, is_priority, ignore_subs)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/process_tv.py", line 849, in process_media
    self.result = processor.process()
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/post_processor.py", line 1298, in process
    notifiers.notify_download(ep_obj)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/notifiers/__init__.py", line 103, in notify_download
    n.notify_download(ep_obj)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/notifiers/prowl.py", line 48, in notify_download
    recipients = self._generate_recipients(show)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/medusa/notifiers/prowl.py", line 107, in _generate_recipients
    [show_obj.series_id, show_obj.indexer]
AttributeError: 'list' object has no attribute 'series_id'
</details>




Discussion:
I'm getting the same issue, have turned off all notifications and it still throws error.

Resolving patch:
diff --git a/medusa/notifiers/prowl.py b/medusa/notifiers/prowl.py
--- a/medusa/notifiers/prowl.py
+++ b/medusa/notifiers/prowl.py
@@ -42,30 +42,26 @@ def notify_snatch(self, title, message, ep_obj):
                                      message=message)
 
     def notify_download(self, ep_obj):
-        ep_name = ep_obj.pretty_name_with_quality()
         if app.PROWL_NOTIFY_ONDOWNLOAD:
-            show = self._parse_episode(ep_name)
-            recipients = self._generate_recipients(show)
+            recipients = self._generate_recipients(ep_obj.series)
             if not recipients:
                 log.debug('Skipping prowl notify because there are no configured recipients')
             else:
                 for api in recipients:
                     self._send_prowl(prowl_api=api, prowl_priority=None,
                                      event=common.notifyStrings[common.NOTIFY_DOWNLOAD],
-                                     message=ep_name)
+                                     message=ep_obj.pretty_name_with_quality())
 
     def notify_subtitle_download(self, ep_obj, lang):
-        ep_name = ep_obj.pretty_name()
         if app.PROWL_NOTIFY_ONSUBTITLEDOWNLOAD:
-            show = self._parse_episode(ep_name)
-            recipients = self._generate_recipients(show)
+            recipients = self._generate_recipients(ep_obj.series)
             if not recipients:
                 log.debug('Skipping prowl notify because there are no configured recipients')
             else:
                 for api in recipients:
                     self._send_prowl(prowl_api=api, prowl_priority=None,
                                      event=common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD],
-                                     message=ep_name + ' [' + lang + ']')
+                                     message=f'{ep_obj.pretty_name()} [{lang}]')
 
     def notify_git_update(self, new_version='??'):
         if app.USE_PROWL:


Test patch: