Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: ValueError: need more than 1 value to unpack

### INFO
**Python Version**: `2.7.14 (default, May 28 2018, 14:47:18) [GCC 4.7.3 20130102 (prerelease)]`
**Operating System**: `Linux-3.10.105-x86_64-with-glibc2.2.5`
**Locale**: `None`
**Branch**: [master](../tree/master)
**Database**: `44.11`
**Commit**: pymedusa/Medusa@f5973b28465246e67465d7d86bdc8aa74d13e659
**Link to Log**: https://gist.github.com/3df7613ad0568cc12f9fdcb7573afe31
### ERROR
<pre>
2018-07-28 02:02:50 ERROR    Thread_12 :: [f5973b2] Exception generated: need more than 1 value to unpack
Traceback (most recent call last):
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/<a href="../blob/f5973b28465246e67465d7d86bdc8aa74d13e659/medusa/server/web/core/base.py#L259">medusa/server/web/core/base.py</a>", line 259, in async_call
    result = function(**kwargs)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/<a href="../blob/f5973b28465246e67465d7d86bdc8aa74d13e659/medusa/server/web/manage/handler.py#L176">medusa/server/web/manage/handler.py</a>", line 176, in changeEpisodeStatuses
    self.setStatus(indexer_id_to_name(int(cur_indexer_id)), cur_series_id, '|'.join(to_change[(cur_indexer_id, cur_series_id)]), newStatus, direct=True)
  File "/volume1/@appstore/sickbeard-custom/var/SickBeard/<a href="../blob/f5973b28465246e67465d7d86bdc8aa74d13e659/medusa/server/web/home/handler.py#L1928">medusa/server/web/home/handler.py</a>", line 1928, in setStatus
    season_no, episode_no = cur_ep.lstrip('s').split('e')
ValueError: need more than 1 value to unpack
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:

### INFO
**Python Version**: `2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)]`
**Operating System**: `Windows-10-10.0.17134`
**Locale**: `cp1252`
**Branch**: [master](../tree/master)
**Database**: `44.11`
**Commit**: pymedusa/Medusa@f5973b28465246e67465d7d86bdc8aa74d13e659
**Link to Log**: https://gist.github.com/6a9cea7b7c9ea56c88bd6d7d3ad79a37
### ERROR
<pre>
2018-07-27 22:16:42 ERROR    Thread_1 :: [f5973b2] Exception generated: need more than 1 value to unpack
Traceback (most recent call last):
  File "C:\Users\uTorrentVM\Medusa\<a href="../blob/f5973b28465246e67465d7d86bdc8aa74d13e659/medusa/server/web/core/base.py#L259">medusa\server\web\core\base.py</a>", line 259, in async_call
    result = function(**kwargs)
  File "C:\Users\uTorrentVM\Medusa\<a href="../blob/f5973b28465246e67465d7d86bdc8aa74d13e659/medusa/server/web/manage/handler.py#L176">medusa\server\web\manage\handler.py</a>", line 176, in changeEpisodeStatuses
    self.setStatus(indexer_id_to_name(int(cur_indexer_id)), cur_series_id, '|'.join(to_change[(cur_indexer_id, cur_series_id)]), newStatus, direct=True)
  File "C:\Users\uTorrentVM\Medusa\<a href="../blob/f5973b28465246e67465d7d86bdc8aa74d13e659/medusa/server/web/home/handler.py#L1928">medusa\server\web\home\handler.py</a>", line 1928, in setStatus
    season_no, episode_no = cur_ep.lstrip('s').split('e')
ValueError: need more than 1 value to unpack
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators

In the meantime you can use the per-show status/quality setter. The episode status managment page seems to be broken.

Resolving patch:
diff --git a/medusa/server/web/manage/handler.py b/medusa/server/web/manage/handler.py
--- a/medusa/server/web/manage/handler.py
+++ b/medusa/server/web/manage/handler.py
@@ -170,10 +170,16 @@ def changeEpisodeStatuses(self, oldStatus, newStatus, *args, **kwargs):
                     status_list + [cur_indexer_id, cur_series_id]
                 )
 
-                all_eps = ['{season}x{episode}'.format(season=x[b'season'], episode=x[b'episode']) for x in all_eps_results]
+                all_eps = ['s{season}e{episode}'.format(season=x[b'season'], episode=x[b'episode']) for x in all_eps_results]
                 to_change[cur_indexer_id, cur_series_id] = all_eps
 
-            self.setStatus(indexer_id_to_name(int(cur_indexer_id)), cur_series_id, '|'.join(to_change[(cur_indexer_id, cur_series_id)]), newStatus, direct=True)
+            self.setStatus(
+                indexername=indexer_id_to_name(int(cur_indexer_id)),
+                seriesid=cur_series_id,
+                eps='|'.join(to_change[(cur_indexer_id, cur_series_id)]),
+                status=newStatus,
+                direct=True
+            )
 
         return self.redirect('/manage/episodeStatuses/')
 


Test patch: