update last playback time

This commit is contained in:
bain 2022-08-22 00:14:52 +02:00
parent 24ff39a2a8
commit 6d7d36e3b7
No known key found for this signature in database
GPG key ID: A708F07AF3D92C02

View file

@ -136,6 +136,8 @@ class Cache:
async with self.cache_lock: async with self.cache_lock:
fp = f"{self._directory}/{link_hash(link)}" fp = f"{self._directory}/{link_hash(link)}"
if self._links.get(link): if self._links.get(link):
# update last playback
self._links[link] = (time.time_ns(), *self._links[link][1:])
return CacheContextManager(self, fp) return CacheContextManager(self, fp)
else: else:
await self._download_file(link) await self._download_file(link)