Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

### INFO
**Python Version**: `3.8.3 (default, May 17 2020, 18:15:42) [GCC 10.1.0]`
**Operating System**: `Linux-4.19.107-Unraid-x86_64-with-glibc2.2.5`
**Locale**: `UTF-8`
**Branch**: [master](../tree/master)
**Database**: `44.16`
**Commit**: pymedusa/Medusa@54da0c77d705a23f1ce67945ba4af3e1b978dcfc
**Link to Log**: https://gist.github.com/bbd8f3e449ef45478e9e4510a655e3cb
### ERROR
<pre>
2020-09-03 13:15:30 ERROR    Thread_0 :: [54da0c7] Exception generated: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Traceback (most recent call last):
  File "/opt/medusa/<a href="../blob/54da0c77d705a23f1ce67945ba4af3e1b978dcfc/medusa/server/web/core/base.py#L251">medusa/server/web/core/base.py</a>", line 251, in async_call
    result = function(**kwargs)
  File "/opt/medusa/<a href="../blob/54da0c77d705a23f1ce67945ba4af3e1b978dcfc/medusa/server/web/home/post_process.py#L52">medusa/server/web/home/post_process.py</a>", line 52, in processEpisode
    result = app.post_processor_scheduler.action.run(
  File "/opt/medusa/<a href="../blob/54da0c77d705a23f1ce67945ba4af3e1b978dcfc/medusa/process_tv.py#L65">medusa/process_tv.py</a>", line 65, in run
    return ProcessResult(path, process_method).process(force=force, **kwargs)
  File "/opt/medusa/<a href="../blob/54da0c77d705a23f1ce67945ba4af3e1b978dcfc/medusa/process_tv.py#L187">medusa/process_tv.py</a>", line 187, in process
    self.process_files(dir_path, force=force, is_priority=is_priority,
  File "/opt/medusa/<a href="../blob/54da0c77d705a23f1ce67945ba4af3e1b978dcfc/medusa/process_tv.py#L378">medusa/process_tv.py</a>", line 378, in process_files
    self.process_media(path, self.video_files, force, is_priority, ignore_subs)
  File "/opt/medusa/<a href="../blob/54da0c77d705a23f1ce67945ba4af3e1b978dcfc/medusa/process_tv.py#L599">medusa/process_tv.py</a>", line 599, in process_media
    self.result = processor.process()
  File "/opt/medusa/<a href="../blob/54da0c77d705a23f1ce67945ba4af3e1b978dcfc/medusa/post_processor.py#L1114">medusa/post_processor.py</a>", line 1114, in process
    if int(ep_obj.season) > int(max_season[0]['max']):
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:
Force Full Update the show for a quick fix.
YEAH i understand full update. But the point of uploading this was to get the developers to code so this kind of errors are handled... So closing it was a bit premature i think :-)

Resolving patch:
diff --git a/medusa/post_processor.py b/medusa/post_processor.py
--- a/medusa/post_processor.py
+++ b/medusa/post_processor.py
@@ -1111,7 +1111,7 @@ def process(self):
 
                 # If the file season (ep_obj.season) is bigger than
                 # the indexer season (max_season[0]['max']), skip the file
-                if int(ep_obj.season) > int(max_season[0]['max']):
+                if max_season[0]['max'] and int(ep_obj.season) > int(max_season[0]['max']):
                     self.log(u'File has season {0}, while the indexer is on season {1}. '
                              u'The file may be incorrectly labeled or fake, aborting.'.format
                              (ep_obj.season, max_season[0]['max']))


Test patch: