From: Paul Hänsch Date: Mon, 23 Sep 2024 03:33:53 +0000 (+0200) Subject: always put caches in _DATA directory X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=370ec80b313609974eac804aa4d0f9325222a9c1;p=shellwiki always put caches in _DATA directory --- diff --git a/handlers/40_attachment.sh b/handlers/40_attachment.sh index bddaa47..9ec1c69 100755 --- a/handlers/40_attachment.sh +++ b/handlers/40_attachment.sh @@ -20,8 +20,12 @@ attachment_convert(){ local attpath="$1" - local cachepath="${attpath%/#attachments/*}/#cache/${attpath#*/#attachments/}" - local res junk + local cachepath res junk + + # always put caches in data directory + [ "${attpath#"${_EXEC}"}" = "${attpath}" ] \ + && cachepath="${attpath}" || cachepath="${_DATA}${attpath#"${_EXEC}"}" + cachepath="${cachepath%/#attachments/*}/#cache/${cachepath#*/#attachments/}" case $attpath in *.webm|*.mp4|*.mkv|*.avi)