From: Christian Heller Date: Tue, 18 Feb 2025 12:45:46 +0000 (+0100) Subject: Simplify VideoFile.__hash__. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bprefix%7D%7D/add_free?a=commitdiff_plain;h=5e53673136caa922e81802b2ea9f419c742ccf86;p=ytplom Simplify VideoFile.__hash__. --- diff --git a/src/ytplom/misc.py b/src/ytplom/misc.py index aae6f77..164e155 100644 --- a/src/ytplom/misc.py +++ b/src/ytplom/misc.py @@ -360,9 +360,7 @@ class VideoFile(DbData): self._hash_on_last_update = hash(self) def __hash__(self) -> int: - return hash(f'{self.digest.b64}|{self.rel_path}|{self.flags}|' - f'{self.yt_id}|{self.last_update}|{self.tags_str}|' - f'{self.duration_ms}') + return hash(tuple(getattr(self, k) for k in self._cols)) def _renew_last_update(self): self.last_update = DatetimeStr(datetime.now().strftime(TIMESTAMP_FMT))