Sets hash value based on if movie or episode instance.

This commit is contained in:
2018-09-16 17:27:38 +02:00
parent 2541a21715
commit d9880c77fb

View File

@@ -73,8 +73,11 @@ def scan_video(path):
# hash of name
hashids = Hashids(min_length=16)
hashid = hashids.encode(path)
video.name_hash = hashid
if isinstance(v, Episode):
videoHash = hashids.encode(''.join(self.title, self.year or ''))
elif isinstance(v, Movie):
videoHash = hashids.encode(''.join(self.series, self.season, self.episode))
video.hash = videoHash
return video