Commit Graph

5 Commits

Author SHA1 Message Date
Michiel van Baak 9d73ccacf3 Use sha1 digest as cache key
Subliminal uses dogpile.cache to save state of subtitle availability.
Some methods that dogpile.cache caches can have big argument lists,
resulting in a default cache key that is longer than 255 characters.
The dogpile.cache backend used, saves cache items to the filesystem,
using the cache key as filename. This can result in errors about
Filename too long.
SHA1 generates a 160bit hash of the key, and we use the hexadecimal
digest of that hash, resulting in key names of 80 characters.
2021-03-14 16:56:50 +01:00
Michiel van Baak f10bac1fad Revert "Make subliminal always mangle cache keys to prevent long filenames"
This reverts commit 87fbd196a4.
2021-03-14 11:34:12 +01:00
Michiel van Baak 87fbd196a4
Make subliminal always mangle cache keys to prevent long filenames
* Use dogpile.cache sha1_mangle_key to mangle cache keys

When using the subtitle hashes as cache keys, sometimes they come
out as filenames of 270 characters.
Not a lot of filesystems out there support filenames with over 250
characters.
This behaviour was reported with ext4 and zfs on both linux and FreeBSD.

The dogpile.cache utils come with a function that returns a hex digest
of the key, limiting the filename to a fixed length of 40 characters.

* Set region to subliminal.region and only then configure it, instead of assigning the result of configure to the property

* Make sure subliminal ALWAYS mangles keys with the sha1 to prevent filenames that are too long
2021-03-13 18:04:18 -05:00
Louis Vézina 3ca2c98cd4 WIP 2019-09-16 22:04:27 -04:00
morpheus65535 36e6557a1c Including a modified version of subliminal 2.0.5 in libs 2018-03-23 19:59:59 -04:00