mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-30 06:28:53 +02:00
general: Add file size to caching to avoid collisions. Closes #385
This commit is contained in:
parent
0f7c6aeaf9
commit
2f8d458f89
@ -87,9 +87,11 @@ def cache_fname(img, backend, light, cache_dir, sat=""):
|
|||||||
"""Create the cache file name."""
|
"""Create the cache file name."""
|
||||||
color_type = "light" if light else "dark"
|
color_type = "light" if light else "dark"
|
||||||
file_name = re.sub("[/|\\|.]", "_", img)
|
file_name = re.sub("[/|\\|.]", "_", img)
|
||||||
|
file_size = os.path.getsize(img)
|
||||||
|
|
||||||
file_parts = [file_name, color_type, backend, sat, __cache_version__]
|
file_parts = [file_name, color_type, backend,
|
||||||
return [cache_dir, "schemes", "%s_%s_%s_%s_%s.json" % (*file_parts,)]
|
sat, file_size, __cache_version__]
|
||||||
|
return [cache_dir, "schemes", "%s_%s_%s_%s_%s_%s.json" % (*file_parts,)]
|
||||||
|
|
||||||
|
|
||||||
def get_backend(backend):
|
def get_backend(backend):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user