internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pymedusa/Medusa

Issue:
Unnecessary warning for "Multiple posters at highest weighted score"
I get these "Multiple posters at highest weighted score" warnings too often, and they are a nuisance since they are not important enough to worry about.

Should be demoted to a level where it does not show up in the GUI as a warning.

2018-02-26 14:06:30 WARNING  SHOWQUEUE-REFRESH :: [ccbc0ce] Multiple posters at highest weighted score for series 328599:
     Score     Rating  Votes      Resolution	URL
     4.355     10.000      1        680x1000	http://thetvdb.com/banners/posters/328599-6.jpg
     4.355     10.000      1        680x1000	http://thetvdb.com/banners/posters/328599-8.jpg



Discussion:

Resolving patch:
diff --git a/medusa/indexers/indexer_base.py b/medusa/indexers/indexer_base.py
--- a/medusa/indexers/indexer_base.py
+++ b/medusa/indexers/indexer_base.py
@@ -327,7 +327,7 @@ def format_result(item):
             if item[0] >= best_result[0]
         ]
         if len(best_results) > 1:
-            log.warning(
+            log.debug(
                 u'Multiple {image}s at highest weighted score for series {id}:'
                 u'\n{header}'
                 u'\n{results}', {


Test patch:
Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: TypeError: get_episode() got an unexpected keyword argument 'absolute'

### INFO
**Python Version**: `2.7.14 (default, Dec 19 2017, 01:10:04) [GCC 4.2.1 Compatible FreeBSD Clang 4.0.0 (tags/RELEASE_400/final 297347)]`
**Operating System**: `FreeBSD-11.0-RELEASE-amd64-64bit-ELF`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe
**Link to Log**: https://gist.github.com/b8cba3248e60f5294cef31edba6f0fa0
### ERROR
<pre>
2018-03-04 15:51:28 ERROR    Thread-19 :: [d6eb72d] Exception generated: get_episode() got an unexpected keyword argument 'absolute'
Traceback (most recent call last):
  File "/usr/local/medusa/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/medusa/server/web/core/base.py#L283">medusa/server/web/core/base.py</a>", line 283, in async_call
    result = function(**kwargs)
  File "/usr/local/medusa/<a href="../blob/d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe/medusa/server/web/home/handler.py#L2357">medusa/server/web/home/handler.py</a>", line 2357, in setSceneNumbering
    ep_obj = series_obj.get_episode(absolute=forAbsolute)
TypeError: get_episode() got an unexpected keyword argument 'absolute'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:

Resolving patch:
diff --git a/medusa/server/web/home/handler.py b/medusa/server/web/home/handler.py
--- a/medusa/server/web/home/handler.py
+++ b/medusa/server/web/home/handler.py
@@ -2357,7 +2357,7 @@ def setSceneNumbering(self, indexername=None, seriesid=None, forSeason=None, for
 
         # retrieve the episode object and fail if we can't get one
         if series_obj.is_anime:
-            ep_obj = series_obj.get_episode(absolute=forAbsolute)
+            ep_obj = series_obj.get_episode(absolute_number=forAbsolute)
         else:
             ep_obj = series_obj.get_episode(forSeason, forEpisode)
 


Test patch:
Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: TypeError: tuple indices must be integers, not unicode

### INFO
**Python Version**: `2.7.14 (default, Dec 14 2017, 15:51:29) [GCC 6.4.0]`
**Operating System**: `Linux-4.14.13-unRAID-x86_64-with`
**Locale**: `None`
**Branch**: [master](../tree/master)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@1a8dc66c7ec9231be0d3444710e476437c9ae1c8
**Link to Log**: https://gist.github.com/0d5552591a518974da995a25a335ecaa
### ERROR
<pre>
2018-03-11 15:02:39 ERROR    TORRENTCHECKER :: [1a8dc66] Exception while checking torrent status.
Traceback (most recent call last):
  File "/app/medusa/medusa/torrent_checker.py", line 41, in run
    client.remove_ratio_reached()
  File "/app/medusa/medusa/clients/torrent/deluge_client.py", line 473, in remove_ratio_reached
    info_hash_to_remove = read_torrent_status(torrent_data)
  File "/app/medusa/medusa/clients/torrent/deluge_client.py", line 72, in read_torrent_status
    ratio_limit=torrent['stop_ratio'],
TypeError: tuple indices must be integers, not unicode
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:

Resolving patch:
diff --git a/medusa/clients/torrent/deluge_client.py b/medusa/clients/torrent/deluge_client.py
--- a/medusa/clients/torrent/deluge_client.py
+++ b/medusa/clients/torrent/deluge_client.py
@@ -71,8 +71,8 @@ def read_torrent_status(torrent_data):
                 ' seed idle limit'
                 ' Removing it: [{name}]',
                 ratio=details['ratio'],
-                ratio_limit=torrent['stop_ratio'],
-                name=torrent['name']
+                ratio_limit=details['stop_ratio'],
+                name=details['name']
             )
             info_hash_to_remove.append(info_hash)
         elif status == 'seeding':
@@ -81,9 +81,9 @@ def read_torrent_status(torrent_data):
                     'Torrent did not reach minimum'
                     ' ratio: [{ratio:.3f}/{ratio_limit:.3f}].'
                     ' Keeping it: [{name}]',
-                    ratio=torrent['ratio'],
-                    ratio_limit=torrent['stop_ratio'],
-                    name=torrent['name']
+                    ratio=details['ratio'],
+                    ratio_limit=details['stop_ratio'],
+                    name=details['name']
                 )
             else:
                 log.info(
@@ -91,9 +91,9 @@ def read_torrent_status(torrent_data):
                     ' was force started again. Current'
                     ' ratio: [{ratio:.3f}/{ratio_limit:.3f}].'
                     ' Keeping it: [{name}]',
-                    ratio=torrent['uploadRatio'],
-                    ratio_limit=torrent['seedRatioLimit'],
-                    name=torrent['name']
+                    ratio=details['ratio'],
+                    ratio_limit=details['stop_ratio'],
+                    name=details['name']
                 )
         else:
             log.info('Torrent is {status}. Keeping it: [{name}]', status=status, name=details['name'])


Test patch:
Repository: pymedusa/Medusa

Issue:
Yggtorrent Date Translation
WARNING  SEARCHQUEUE-DAILY-SEARCH :: [Yggtorrent] :: [d6eb72d] Could not translate publishing date with value: à l'instant

When a torrent is released, instead of having a real published date, they'll put "à l'instant" which means "just now" in french. Medusa should replace that with the current date :)

Thanks for your work,


Discussion:

Resolving patch:
diff --git a/medusa/providers/torrent/html/yggtorrent.py b/medusa/providers/torrent/html/yggtorrent.py
--- a/medusa/providers/torrent/html/yggtorrent.py
+++ b/medusa/providers/torrent/html/yggtorrent.py
@@ -49,6 +49,7 @@ def __init__(self):
 
         # Miscellaneous Options
         self.translation = {
+            'à l\'instant': 'just now',
             'seconde': 'second',
             'secondes': 'seconds',
             'minute': 'minute',


Test patch:
Repository: pymedusa/Medusa

Issue:
Sorting published date in manual search does not work
Medusa Info: | Branch: master                 Commit: d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe                 Version: v0.2.1                 Database: 44.9
-- | --
Python Version: | 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]
SSL Version: | OpenSSL 1.0.2k  26 Jan 2017
OS: | Windows-10-10.0.14393
Locale: | nl_NL.cp1252

Sorting published date in manual search does not work like expected, it does work with Added date for instance.
![image](https://user-images.githubusercontent.com/4103090/37908333-3b844a3c-3108-11e8-9f87-44cdaaf1d7ed.png)

Example for added date
![image](https://user-images.githubusercontent.com/4103090/37908399-64581434-3108-11e8-8638-20a67c2b84b8.png)




Discussion:

Resolving patch:
diff --git a/medusa/search/manual.py b/medusa/search/manual.py
--- a/medusa/search/manual.py
+++ b/medusa/search/manual.py
@@ -21,7 +21,7 @@
 )
 from medusa.helper.common import enabled_providers, pretty_file_size
 from medusa.logger.adapters.style import BraceAdapter
-from medusa.sbdatetime import sbdatetime
+from medusa.network_timezones import app_timezone
 from medusa.search.queue import FORCED_SEARCH_HISTORY, ForcedSearchQueueItem
 from medusa.show.naming import contains_at_least_one_word, filter_bad_releases
 from medusa.show.show import Show
@@ -300,8 +300,8 @@ def get_provider_cache_results(series_obj, show_all_results=None, perform_search
             i['pretty_size'] = pretty_file_size(i['size']) if i['size'] > -1 else 'N/A'
             i['seeders'] = i['seeders'] if i['seeders'] >= 0 else '-'
             i['leechers'] = i['leechers'] if i['leechers'] >= 0 else '-'
-            i['pubdate'] = sbdatetime.convert_to_setting(parser.parse(i['pubdate'])).strftime(
-                app.DATE_PRESET + ' ' + app.TIME_PRESET) if i['pubdate'] else '-'
+            i['pubdate'] = parser.parse(i['pubdate']).astimezone(app_timezone) if i['pubdate'] else ''
+            i['date_added'] = datetime.fromtimestamp(float(i['date_added'])) if i['date_added'] else ''
             release_group = i['release_group']
             if ignored_words and release_group in ignored_words:
                 i['rg_highlight'] = 'ignored'


Test patch:
Repository: pymedusa/Medusa

Issue:
Email Notification Settings Not Saving


**Branch/Commit:** master / d6eb72d4e1019e5d1286ae6ac1d7e4b318229ebe
**OS:** Windows Server 2012 R2
**What you did:** Tried to save email notification settings
**What happened:** Page reloaded like it saved, but when selecting a show's email notification settings, notification email address has not saved.
**What you expected:** The email address to save
**Logs:**
```
TypeError: saveShowNotifyList() got an unexpected keyword argument 'show'
2018-04-06 17:17:35 ERROR    Thread-37 :: [d6eb72d] Exception generated: saveShowNotifyList() got an unexpected keyword argument 'show'
Traceback (most recent call last):
  File "C:\Medusa\Medusa\medusa\server\web\core\base.py", line 283, in async_call
    result = function(**kwargs)
```



Discussion:

Resolving patch:
diff --git a/medusa/server/web/home/handler.py b/medusa/server/web/home/handler.py
--- a/medusa/server/web/home/handler.py
+++ b/medusa/server/web/home/handler.py
@@ -594,18 +594,16 @@ def loadShowNotifyLists():
         return json.dumps(data)
 
     @staticmethod
-    def saveShowNotifyList(indexername=None, seriesid=None, emails=None, prowlAPIs=None):
+    def saveShowNotifyList(show=None, emails=None, prowlAPIs=None):
         entries = {'emails': '', 'prowlAPIs': ''}
         main_db_con = db.DBConnection()
 
-        indexer_id = indexer_name_to_id(indexername)
-
         # Get current data
         sql_results = main_db_con.select(
             b'SELECT notify_list '
             b'FROM tv_shows '
-            b'WHERE indexer = ? AND show_id = ?',
-            [indexer_id, seriesid]
+            b'WHERE show_id = ?',
+            [show]
         )
         for subs in sql_results:
             if subs[b'notify_list']:
@@ -620,8 +618,8 @@ def saveShowNotifyList(indexername=None, seriesid=None, emails=None, prowlAPIs=N
             if not main_db_con.action(
                     b'UPDATE tv_shows '
                     b'SET notify_list = ? '
-                    b'WHERE indexer = ? AND show_id = ?',
-                    [str(entries), indexer_id, seriesid]
+                    b'WHERE show_id = ?',
+                    [str(entries), show]
             ):
                 return 'ERROR'
 
@@ -630,8 +628,8 @@ def saveShowNotifyList(indexername=None, seriesid=None, emails=None, prowlAPIs=N
             if not main_db_con.action(
                     b'UPDATE tv_shows '
                     b'SET notify_list = ? '
-                    b'WHERE indexer = ? AND show_id = ?',
-                    [str(entries), indexer_id, seriesid]
+                    b'WHERE show_id = ?',
+                    [str(entries), show]
             ):
                 return 'ERROR'
 


Test patch:
Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: TwitterError: [{u'message': u'Recipient (user, screen name, or id) parameter is missing.', u'code': 38}]

### INFO
**Python Version**: `2.7.13 (default, Dec 18 2016, 23:57:13) [GCC 4.7.3 20130102 (prerelease)]`
**Operating System**: `Linux-3.10.102-x86_64-with-glibc2.2.5`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.8`
**Commit**: pymedusa/Medusa@bd0832551d836713481dd0a93f4118372bb5d963
**Link to Log**: https://gist.github.com/106c79ac0f0e8bde74785a69a7d6ed32
### ERROR
<pre>
2018-01-19 22:27:10 ERROR    POSTPROCESSOR :: [bd08325] Error Sending Tweet (DM): TwitterError([{u'message': u'Recipient (user, screen name, or id) parameter is missing.', u'code': 38}],)
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/bd0832551d836713481dd0a93f4118372bb5d963/SickBeard/medusa/notifiers/tweet.py#L136">SickBeard/medusa/notifiers/tweet.py</a>", line 136, in _send_dm
    api.PostDirectMessage(dmdest, message.encode('utf8')[:139])
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/bd0832551d836713481dd0a93f4118372bb5d963/SickBeard/lib/pythontwitter/__init__.py#L3608">SickBeard/lib/pythontwitter/__init__.py</a>", line 3608, in PostDirectMessage
    data = self._ParseAndCheckTwitter(json)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/bd0832551d836713481dd0a93f4118372bb5d963/SickBeard/lib/pythontwitter/__init__.py#L4410">SickBeard/lib/pythontwitter/__init__.py</a>", line 4410, in _ParseAndCheckTwitter
    self._CheckForTwitterError(data)
  File "/volume1/@appstore/sickbeard-custom/var/<a href="../blob/bd0832551d836713481dd0a93f4118372bb5d963/SickBeard/lib/pythontwitter/__init__.py#L4435">SickBeard/lib/pythontwitter/__init__.py</a>", line 4435, in _CheckForTwitterError
    raise TwitterError(data['errors'])
TwitterError: [{u'message': u'Recipient (user, screen name, or id) parameter is missing.', u'code': 38}]
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:

Resolving patch:
diff --git a/medusa/notifiers/tweet.py b/medusa/notifiers/tweet.py
--- a/medusa/notifiers/tweet.py
+++ b/medusa/notifiers/tweet.py
@@ -138,7 +138,7 @@ def _send_dm(self, message=None):
         api = twitter.Api(username, password, access_token_key, access_token_secret)
 
         try:
-            api.PostDirectMessage(dmdest, message.encode('utf8')[:139])
+            api.PostDirectMessage(message.encode('utf8')[:139], screen_name=dmdest)
         except Exception as error:
             log.error(u'Error Sending Tweet (DM): {!r}', error)
             return False


Test patch:
Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: AttributeError: 'module' object has no attribute 'core'

### INFO
**Python Version**: `2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]`
**Operating System**: `Windows-7-6.1.7601-SP1`
**Locale**: `cp1252`
**Branch**: [master](../tree/master)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@77b20916ab577b82112ebc624f816054788c63f2
**Link to Log**: https://gist.github.com/7f6099e1c66cecd44e069bffee91a3ac
### ERROR
<pre>
2018-04-23 16:08:49 ERROR    Thread_18 :: [77b2091] Exception generated: 'module' object has no attribute 'core'
Traceback (most recent call last):
  File "C:\Medusa\Medusa\medusa\server\web\core\base.py", line 285, in async_call
    result = function(**kwargs)
  File "C:\Medusa\Medusa\medusa\server\web\home\handler.py", line 357, in testGrowl
    result = notifiers.growl_notifier.test_notify(host, password)
  File "C:\Medusa\Medusa\medusa\notifiers\growl.py", line 22, in test_notify
    self._sendRegistration(host, password)
  File "C:\Medusa\Medusa\medusa\notifiers\growl.py", line 174, in _sendRegistration
    register = gntp.core.GNTPRegister()
AttributeError: 'module' object has no attribute 'core'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:

Resolving patch:
diff --git a/medusa/notifiers/growl.py b/medusa/notifiers/growl.py
--- a/medusa/notifiers/growl.py
+++ b/medusa/notifiers/growl.py
@@ -7,7 +7,7 @@
 import socket
 from builtins import object
 
-import gntp
+import gntp.core
 
 from medusa import app, common
 from medusa.helper.exceptions import ex


Test patch:
Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: AttributeError: 'module' object has no attribute 'set_up_anidb_connection'

### INFO
**Python Version**: `2.7.13 (default, Apr 20 2017, 12:13:37) [GCC 6.3.0]`
**Operating System**: `Linux-4.14.26-unRAID-x86_64-with`
**Locale**: `None`
**Branch**: [develop](../tree/develop)
**Database**: `44.9`
**Commit**: pymedusa/Medusa@44439bc9609758f337f0db1fa92564f010eda820
**Link to Log**: https://gist.github.com/ca64b1a1995aa191e8763ca1d7a10065
### ERROR
<pre>
2018-04-28 22:15:58 ERROR    POSTPROCESSOR :: [44439bc] Exception generated: 'module' object has no attribute 'set_up_anidb_connection'
Traceback (most recent call last):
  File "/app/medusa/medusa/scheduler.py", line 93, in run
    self.action.run(self.force)
  File "/app/medusa/medusa/auto_post_processor.py", line 58, in run
    process_tv.ProcessResult(app.TV_DOWNLOAD_DIR, app.PROCESS_METHOD).process(force=force)
  File "/app/medusa/medusa/process_tv.py", line 148, in process
    ignore_subs=ignore_subs)
  File "/app/medusa/medusa/process_tv.py", line 336, in process_files
    self.process_media(path, self.video_files, force, is_priority, ignore_subs)
  File "/app/medusa/medusa/process_tv.py", line 537, in process_media
    self.result = processor.process()
  File "/app/medusa/medusa/post_processor.py", line 1211, in process
    self._add_to_anidb_mylist(self.file_path)
  File "/app/medusa/medusa/post_processor.py", line 530, in _add_to_anidb_mylist
    if helpers.set_up_anidb_connection():
AttributeError: 'module' object has no attribute 'set_up_anidb_connection'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:
This breaks Anime post processing
NOTE:   This error will also cause the Post Processing schedule item to stop.

![image](https://user-images.githubusercontent.com/1131905/39404206-8090ffe4-4b43-11e8-8a3b-1d39dc08077f.png)



Resolving patch:
diff --git a/medusa/post_processor.py b/medusa/post_processor.py
--- a/medusa/post_processor.py
+++ b/medusa/post_processor.py
@@ -50,6 +50,7 @@
     ShowDirectoryNotFoundException,
 )
 from medusa.helpers import is_subtitle, verify_freespace
+from medusa.helpers.anidb import set_up_anidb_connection
 from medusa.helpers.utils import generate
 from medusa.name_parser.parser import (
     InvalidNameException,
@@ -527,7 +528,7 @@ def _add_to_anidb_mylist(self, file_path):
 
         :param file_path: file to add to mylist
         """
-        if helpers.set_up_anidb_connection():
+        if set_up_anidb_connection():
             if not self.anidbEpisode:  # seems like we could parse the name before, now lets build the anidb object
                 self.anidbEpisode = self._build_anidb_episode(app.ADBA_CONNECTION, file_path)
 


Test patch:
Repository: pymedusa/Medusa

Issue:
qbittorrent: Unable to set the pause for Torrent (new qBit 4.1.0)
### Before submitting your issue:

Enable debug logging in Medusa settings, reproduce the error (be sure to disable after the bug is fixed)

**Branch/Commit:**
77b2091
**OS:**
Linux Mint 18.2 Cinnamon
**What you did:**
I updated to qBittorrent 4.1.0 earlier today, prior to that I was using Qbittorrent 4.0.4, so I figure maybe this is something with Medusa + qBittorrent 4.1.0....I didn't do any manual pause or anything so no idea what it would be pausing or why.
I do *not* have this checked:
Start torrent paused
add .torrent to client but do not start downloading
In the Search Settings -> Torrent Search config in Medusa, in case anybody is wondering.
**What happened:**
Some kind of red error about pausing a torrent with Qbittorrent
**What you expected:**
No error
**Logs:**
```
2018-05-06 17:59:02 INFO     SEARCHQUEUE-DAILY-SEARCH :: [77b2091] Prowl notifications sent.
2018-05-06 17:59:01 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [77b2091] qbittorrent: Unable to set the pause for Torrent
2018-05-06 17:59:01 INFO     SEARCHQUEUE-DAILY-SEARCH :: [77b2091] qbittorrent: Bad Request
2018-05-06 17:59:00 INFO     SEARCHQUEUE-DAILY-SEARCH :: [77b2091] Downloading (censored) with 13 seeders and 2 leechers and size (censored) MB from (censored)
```



Discussion:

Resolving patch:
diff --git a/medusa/clients/torrent/qbittorrent_client.py b/medusa/clients/torrent/qbittorrent_client.py
--- a/medusa/clients/torrent/qbittorrent_client.py
+++ b/medusa/clients/torrent/qbittorrent_client.py
@@ -123,8 +123,9 @@ def _set_torrent_priority(self, result):
     def _set_torrent_pause(self, result):
         self.url = '{host}command/{state}'.format(host=self.host,
                                                   state='pause' if app.TORRENT_PAUSED else 'resume')
+        hashes_key = 'hashes' if self.api >= 18 else 'hash'
         data = {
-            'hash': result.hash,
+            hashes_key: result.hash.lower(),
         }
         return self._request(method='post', data=data, cookies=self.session.cookies)
 


Test patch:
Repository: pymedusa/Medusa

Issue:
Add Recomended show IMDB Popular error
Medusa Info: | Branch: master                     Commit: 212cd1c8a350f2d5ca40f172ed5a227d9a5cb80f                     Version: v0.2.3                     Database: 44.9
-- | --
Python Version: | 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]
SSL Version: | OpenSSL 1.0.2k  26 Jan 2017
OS: | Windows-10-10.0.14393
Locale: | nl_NL.cp1252

![image](https://user-images.githubusercontent.com/4103090/40298816-9eac8b1c-5ce4-11e8-99ad-12b7fa8a33d0.png)

```
2018-05-21 10:48:00 WARNING  Thread_24 :: [212cd1c] Could not parse show tt6845390 with error: u'year'
```


Discussion:
I cant reproduce this. Its working fine for me
Check your logs for possible causes. 
Also worth noting, the IMDb api requires accurate local time, so make sure your system time is correctly set or synced with a NTP server.
This was the only line in the debug log. The server time is synchronized with an external time source
http://www.imdb.com/title/tt6845390/ has no year.
I think the exception is `KeyError: u'year'`.
https://github.com/pymedusa/Medusa/blob/212cd1c8a350f2d5ca40f172ed5a227d9a5cb80f/medusa/show/recommendations/imdb.py#L81

Resolving patch:
diff --git a/medusa/imdb_popular.py b/medusa/imdb_popular.py
deleted file mode 100644
diff --git a/medusa/show/recommendations/imdb.py b/medusa/show/recommendations/imdb.py
--- a/medusa/show/recommendations/imdb.py
+++ b/medusa/show/recommendations/imdb.py
@@ -78,7 +78,7 @@ def fetch_popular_shows(self):
                 show_details = cached_get_imdb_series_details(imdb_id)
                 if show_details:
                     try:
-                        series['year'] = imdb_show['year']
+                        series['year'] = imdb_show.get('year')
                         series['name'] = imdb_show['title']
                         series['image_url_large'] = imdb_show['image']['url']
                         series['image_path'] = posixpath.join('images', 'imdb_popular',
@@ -89,7 +89,7 @@ def fetch_popular_shows(self):
                         series['outline'] = show_details['plot'].get('outline', {}).get('text')
                         series['rating'] = show_details['ratings'].get('rating', 0)
                     except Exception as error:
-                        log.warning('Could not parse show {imdb_id} with error: {error}',
+                        log.warning('Could not parse show {imdb_id} with error: {error!r}',
                                     {'imdb_id': imdb_id, 'error': error})
                 else:
                     continue


Test patch: