Repository: pymedusa/Medusa

Issue:
Exception generated: sequence item 0: expected string or Unicode, NoneType found
All I did was run manual PP on Wayward Pines.

```
2017-08-21 12:15:30 ERROR    Thread-16 :: [49e9fc3] Exception generated: sequence item 0: expected string or Unicode, NoneType found
Traceback (most recent call last):
  File "/app/medusa/medusa/server/web/core/base.py", line 258, in async_call
    result = function(**kwargs)
  File "/app/medusa/medusa/server/web/home/post_process.py", line 50, in processEpisode
    ignore_subs=argToBool(ignore_subs)
  File "/app/medusa/medusa/process_tv.py", line 202, in process
    if self.move_torrent(info_hash, release_names):
  File "/app/medusa/medusa/process_tv.py", line 645, in move_torrent
    release_names = ', '.join(release_names)
TypeError: sequence item 0: expected string or Unicode, NoneType found
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] Successfully processed.
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] No processable items found in folder: /mnt/user/Downloads/DONE/tvshows/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta/Screens
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] Processing succeeded for /mnt/user/Downloads/DONE/tvshows/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] File exists and the new file has the same size, aborting post-processing
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] New file is the same size.
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] New size: 517.11 MB
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] Old size: 517.11 MB
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] New file: /mnt/user/Downloads/DONE/tvshows/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] Old file: /mnt/user/TV Shows/Wayward Pines/Wayward Pines - S2E10 - Bedtime Story - 1080p HDTV.mkv
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] This episode is a priority download: False
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Proper: False
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] New quality: 1080p HDTV
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Current quality: 1080p HDTV
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Manually snatched: False
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Snatch in history: False
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Quality of the episode we are processing: 1080p HDTV
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Looks like 'Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv' has quality 1080p HDTV, using that
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Trying other methods to get quality for 'Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv', got 1080p HDTV
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Skipping rule language since property is already present
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Handling subtitle track
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Skipping rule language since property is already present
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Handling audio track
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Skipping rule language since property is already present
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Handling video track
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Handling general track
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Looking up quality for 'Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv', got Unknown
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Looking up quality for 'Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv', got Unknown
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Retrieving episode object for Wayward Pines S02E10
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Using cached parse result for Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Analyzing name: Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Using cached parse result for Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Analyzing name: Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv
2017-08-21 12:15:30 INFO     Thread-16 :: [49e9fc3] Processing /mnt/user/Downloads/DONE/tvshows/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Post-processing video files: [u'Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv']
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Post-processing files: [u'Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta.mkv']
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Processing folder: /mnt/user/Downloads/DONE/tvshows/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta
2017-08-21 12:15:30 DEBUG    Thread-16 :: [49e9fc3] Processing path: /mnt/user/Downloads/DONE/tvshows/Wayward.Pines.S02E10.1080p.HEVC.x265-MeGusta
```


Discussion:
@xo seems medusa couldn't detect the `release_names`. What I can do in the move torrent feature is check the release_names exist, otherwise won't move. But the real issue it needs to be fixed is the release name detection

Resolving patch:
diff --git a/medusa/post_processor.py b/medusa/post_processor.py
--- a/medusa/post_processor.py
+++ b/medusa/post_processor.py
@@ -1269,7 +1269,10 @@ def process(self):
         # Store self.info_hash and self.release_name so later we can remove from client if setting is enabled
         if self.info_hash:
             existing_release_names = app.RECENTLY_POSTPROCESSED.get(self.info_hash, [])
-            existing_release_names.append(self.release_name)
+            existing_release_names.append(self.release_name or 'N/A')
             app.RECENTLY_POSTPROCESSED[self.info_hash] = existing_release_names
+        else:
+            logger.log(u'Unable to get info to move torrent later as no info hash available for: {0}'.format
+                       (self.file_path), logger.WARNING)
 
         return True


Test patch: