home · contact · privacy
Simplify VideoFile.__hash__.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 18 Feb 2025 12:45:46 +0000 (13:45 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 18 Feb 2025 12:45:46 +0000 (13:45 +0100)
src/ytplom/misc.py

index aae6f778c0e2a186efa0ff138d0945d4faa0fbc7..164e155d6072babbdf20605ffa73c98fc1917301 100644 (file)
@@ -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))