]> git.plutz.net Git - shellwiki/commitdiff
always put caches in _DATA directory
authorPaul Hänsch <paul@plutz.net>
Mon, 23 Sep 2024 03:33:53 +0000 (05:33 +0200)
committerPaul Hänsch <paul@plutz.net>
Mon, 23 Sep 2024 03:33:53 +0000 (05:33 +0200)
handlers/40_attachment.sh

index bddaa47105f11433f58925864836cc4c1795471e..9ec1c696fbe427d29e5e1701d428fb861b8f08f5 100755 (executable)
 
 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)