home
·
contact
·
privacy
projects
/
ytplom
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35e5fd7
)
Simplify VideoFile.__hash__.
author
Christian Heller
<c.heller@plomlompom.de>
Tue, 18 Feb 2025 12:45:46 +0000
(13:45 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Tue, 18 Feb 2025 12:45:46 +0000
(13:45 +0100)
src/ytplom/misc.py
patch
|
blob
|
history
diff --git
a/src/ytplom/misc.py
b/src/ytplom/misc.py
index aae6f778c0e2a186efa0ff138d0945d4faa0fbc7..164e155d6072babbdf20605ffa73c98fc1917301 100644
(file)
--- 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))