Repository: pymedusa/Medusa

Issue:
Mass update functionality only updates first show in selection.
**Describe the bug**
When trying to use the mass update functionality, only the first show from the selection shows any changes. 
Additionally, after saving changes, I end up on the route "/manage/massEditSubmit", with no UI. Just a plain gray background. 

**To Reproduce**

1. Go to "Mass Update" under "Manage"
2. Select all shows in the "Edit" column
3. Click "Edit Selected"
4. Make any change
5. Press "Save Changes"
6. Wait for the page to finish loading
7. Navigate back to the "Mass Update" page manually (As there is no longer any UI shown)
8. Note that only the first show in your selection received the changes. 

**Expected behavior**
I would expect all shows that I selected to receive the changes.

**Medusa**
- Branch: master
- Commit: Unknown (Using docker container: `linuxserver/medusa:version-v0.5.3`)
- Version: 0.5.3
- Database: 44.17
- Python Version: 3.8.5 (default, Jul 20 2020, 23:11:29)  [GCC 9.3.0]
- SSL Version: OpenSSL 1.1.1i  8 Dec 2020
- OS: Linux-5.4.65-1-pve-x86_64-with (Docker on Proxmox)
- Locale: en_US.UTF-8

**Debug logs**
```
2021-01-12 10:59:15 ERROR	Thread :: Exception generated: tuple indices must be integers or slices, not str
Traceback (most recent call last):
  File "/app/medusa/medusa/server/web/core/base.py", line 252, in async_call
    result = function(**kwargs)
  File "/app/medusa/medusa/server/web/manage/handler.py", line 691, in massEditSubmit
    errors += self.massEditShow(
  File "/app/medusa/medusa/server/web/home/handler.py", line 959, in massEditShow
    series_obj.aliases = get_scene_exceptions(series_obj)
  File "/app/medusa/medusa/tv/base.py", line 63, in __setattr__
    super(TV, self).__setattr__(key, value)
  File "/app/medusa/medusa/tv/series.py", line 669, in aliases
    update_scene_exceptions(self, exceptions)
  File "/app/medusa/medusa/scene_exceptions.py", line 233, in update_scene_exceptions
    if exception['title'] not in exceptions_cache[(series_obj.indexer, series_obj.series_id)][exception['season']]:
TypeError: tuple indices must be integers or slices, not str
```


Discussion:
Same here, updating in batches seems to work though, might be a limit / time out or something?
It sometimes indeed seems to occur in batches, until that type error is thrown.

When debugging medusa locally I can only seem to reproduce it in the first few minutes after adding a new show that has scene exceptions. After a few minutes it seems to fix itself and it does not happen again even after re-adding the same shows. It also does not seem to happen for shows without scene exceptions.

This does not seem to automatically fix itself on my main medusa instance though.
It seems to have something to do with the way the fields on the `exception` object are accessed. Submitting a PR in a bit.

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
@@ -51,8 +51,7 @@
 from medusa.indexers.api import indexerApi
 from medusa.indexers.utils import indexer_name_to_id
 from medusa.scene_exceptions import (
-    get_all_scene_exceptions,
-    get_scene_exceptions,
+    get_all_scene_exceptions
 )
 from medusa.scene_numbering import (
     get_scene_absolute_numbering,
@@ -956,8 +955,6 @@ def massEditShow(
             errors += 1
             return errors
 
-        series_obj.aliases = get_scene_exceptions(series_obj)
-
         season_folders = config.checkbox_to_value(season_folders)
         dvd_order = config.checkbox_to_value(dvd_order)
         paused = config.checkbox_to_value(paused)
diff --git a/medusa/tv/series.py b/medusa/tv/series.py
--- a/medusa/tv/series.py
+++ b/medusa/tv/series.py
@@ -665,7 +665,11 @@ def aliases(self):
 
     @aliases.setter
     def aliases(self, exceptions):
-        """Set the series aliases."""
+        """
+        Set the series aliases.
+
+        :param exceptions: Array of dictionaries.
+        """
         update_scene_exceptions(self, exceptions)
         self._aliases = set(chain(*itervalues(get_all_scene_exceptions(self))))
         build_name_cache(self)


Test patch: