about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2020-07-07 23:28:11 +0200
committertoonn <toonn@toonn.io>2020-07-07 23:28:11 +0200
commitd6853cbfb8e05a63afe626e8dbc2ed191d838b9b (patch)
treec60dfe1cc55d77578a7fdd24a742933c8c8ab86f
parentf321ce4c2072d1e76bbef7f85764c25ef7102f67 (diff)
downloadranger-d6853cbfb8e05a63afe626e8dbc2ed191d838b9b.tar.gz
Drop st_dev from sha512_encode
The device identifier is not necessarily consistent across reboots or
system crashes. Since we don't want to regenerate cached previews at
every reboot we can't rely on it.
-rw-r--r--ranger/core/actions.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index e76adc87..8ba17657 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1052,10 +1052,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
         stat_ = stat(path)
         # How I arrived at the pack format string:
         #   < -> little-endian
-        #   l -> st_dev: signed int (32/64 bits depending on platform)
         #   L -> st_ino: unsigned int (ditto)
         #   d -> st_mtime: double in python
-        sha = sha512(pack('<lLd', stat_.st_dev, stat_.st_ino, stat_.st_mtime))
+        sha = sha512(pack('<Ld', stat_.st_ino, stat_.st_mtime))
         return '{0}.jpg'.format(sha.hexdigest())
 
     def get_preview(self, fobj, width, height):  # pylint: disable=too-many-return-statements
='#n137'>137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183