Repository: pymedusa/Medusa

Issue:
[APP SUBMITTED]: AttributeError: 'Episode' object has no attribute 'validate_location'

### INFO
**Python Version**: `3.6.7 (default, Oct 21 2018, 08:08:16) [GCC 8.2.0]`
**Operating System**: `Linux-4.9.35-v7+-armv7l-with-debian-buster-sid`
**Locale**: `UTF-8`
**Branch**: [develop](../tree/develop)
**Database**: `44.13`
**Commit**: pymedusa/Medusa@abbb17e91fd5864a0b319ae4359fd95d822b7354
**Link to Log**: https://gist.github.com/aad5c5039f5208f6fff2dfbce3cb814d
### ERROR
<pre>
2019-01-12 19:19:53 ERROR    Thread_0 :: [abbb17e] Exception generated: 'Episode' object has no attribute 'validate_location'
Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/tv/episode.py#L294">medusa/tv/episode.py</a>", line 294, in __getattr__
    refactor = self.__refactored[item]
KeyError: 'validate_location'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/server/web/core/base.py#L262">medusa/server/web/core/base.py</a>", line 262, in async_call
    result = function(**kwargs)
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/server/web/home/handler.py#L2192">medusa/server/web/home/handler.py</a>", line 2192, in manual_search_subtitles
    ep_obj = series_obj.get_episode(season, episode)
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/tv/series.py#L842">medusa/tv/series.py</a>", line 842, in get_episode
    ep = Episode(self, season, episode)
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/tv/episode.py#L271">medusa/tv/episode.py</a>", line 271, in __init__
    self.check_for_meta_files()
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/tv/episode.py#L537">medusa/tv/episode.py</a>", line 537, in check_for_meta_files
    new_result = metadata_provider.has_episode_metadata(self)
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/metadata/generic.py#L141">medusa/metadata/generic.py</a>", line 141, in has_episode_metadata
    return self._check_exists(self.get_episode_file_path(ep_obj))
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/metadata/generic.py#L171">medusa/metadata/generic.py</a>", line 171, in get_episode_file_path
    return replace_extension(ep_obj.validate_location, self._ep_nfo_extension)
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/tv/episode.py#L296">medusa/tv/episode.py</a>", line 296, in __getattr__
    raise error
  File "/home/pi/Medusa/<a href="../blob/abbb17e91fd5864a0b319ae4359fd95d822b7354/medusa/tv/episode.py#L291">medusa/tv/episode.py</a>", line 291, in __getattr__
    return super(Episode, self).__getattribute__(item)
AttributeError: 'Episode' object has no attribute 'validate_location'
</pre>
---
_STAFF NOTIFIED_: @pymedusa/support @pymedusa/moderators



Discussion:
Will fix later

Resolving patch:
diff --git a/medusa/metadata/generic.py b/medusa/metadata/generic.py
--- a/medusa/metadata/generic.py
+++ b/medusa/metadata/generic.py
@@ -168,7 +168,7 @@ def get_show_file_path(self, show_obj):
         return os.path.join(show_obj.validate_location, self._show_metadata_filename)
 
     def get_episode_file_path(self, ep_obj):
-        return replace_extension(ep_obj.validate_location, self._ep_nfo_extension)
+        return replace_extension(ep_obj.location, self._ep_nfo_extension)
 
     def get_fanart_path(self, show_obj):
         return os.path.join(show_obj.validate_location, self.fanart_name)


Test patch: