From 5e53673136caa922e81802b2ea9f419c742ccf86 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Tue, 18 Feb 2025 13:45:46 +0100 Subject: [PATCH] Simplify VideoFile.__hash__. --- src/ytplom/misc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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)) -- 2.30.2