mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-28 19:03:17 +01: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."""
|
||||
color_type = "light" if light else "dark"
|
||||
file_name = re.sub("[/|\\|.]", "_", img)
|
||||
file_size = os.path.getsize(img)
|
||||
|
||||
file_parts = [file_name, color_type, backend, sat, __cache_version__]
|
||||
return [cache_dir, "schemes", "%s_%s_%s_%s_%s.json" % (*file_parts,)]
|
||||
file_parts = [file_name, color_type, backend,
|
||||
sat, file_size, __cache_version__]
|
||||
return [cache_dir, "schemes", "%s_%s_%s_%s_%s_%s.json" % (*file_parts,)]
|
||||
|
||||
|
||||
def get_backend(backend):
|
||||
|
Loading…
Reference in New Issue
Block a user