From d9880c77fb562dfbfdac3572af024fe4148acabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Midb=C3=B8e?= Date: Sun, 16 Sep 2018 17:27:38 +0200 Subject: [PATCH] Sets hash value based on if movie or episode instance. --- src/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core.py b/src/core.py index 7ab9fbb..3d6af28 100755 --- a/src/core.py +++ b/src/core.py @@ -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