reduce MAX_FILENAME_WITH_EXT_LENGTH to account for youtube-dl appending the extension

eg. xxx.webm.partial.webm
This commit is contained in:
Eric Le Lay 2020-07-10 15:59:13 +02:00
parent 6cc9da64cf
commit 1d442ffac4

View file

@ -254,10 +254,11 @@ class PodcastEpisode(PodcastModelObject):
# In theory, Linux can have 255 bytes (not characters!) in a filename, but
# filesystems like eCryptFS store metadata in the filename, making the
# effective number of characters less than that. eCryptFS recommends
# 140 chars, we use 120 here (140 - len(extension) - len(".partial")).
# 140 chars, we use 120 here (140 - len(extension) - len(".partial.webm"))
# (youtube-dl appends an extension after .partial, ".webm" is the longest).
# References: gPodder bug 1898, http://unix.stackexchange.com/a/32834
MAX_FILENAME_LENGTH = 120 # without extension
MAX_FILENAME_WITH_EXT_LENGTH = 140 - len(".partial") # with extension
MAX_FILENAME_WITH_EXT_LENGTH = 140 - len(".partial.webm") # with extension
__slots__ = schema.EpisodeColumns