@ -805,15 +805,14 @@
( nera:add-storage-file ( caddr item )
( utils:slugify ( caddr item ) )
( cadddr item ) )
;; Thumbnail not stored in the database. It
;; is a hard-coded utility feature of the
;; website. The thumbnail is created so
;; large-scale images are not used at the
;; thumbnail, increasing download sizes.
( when ( str:contains? "image" ( cadddr item ) :ignore-case t )
( utils:create-thumbnail
"media" ( utils:format-filename ( caddr item ) ) nil )
( nera:add-storage-file
( format nil "thumbnail-~a" ( caddr item ) )
( utils:slugify ( format nil "thumbnail-~a" ( caddr item ) ) )
( cadddr item ) ) ) )
"media" ( utils:format-filename ( caddr item ) ) nil ) ) )
( utils:set-alert "Multi-File upload complete." )
( redirect "/storage/manage" ) ) )
;; Not Authorised
@ -840,17 +839,19 @@
( redirect "/storage/manage" ) )
( t ( storage:rename-content-file
"" "media" ( files::slug -of ( nera:get-storage-file :slug slug ) )
( utils:slugify new-file-name ) )
"" "media" ( files::name -of ( nera:get-storage-file :slug slug ) )
( utils:format-filename new-file-name ) )
;; Rename the thumbnail if there is one (not all files are images).
( when ( storage:file-exists-p "" "media" ( format nil "thumbnail-~a" slug ) )
( when ( storage:file-exists-p
"" "media"
( format nil "thumbnail-~a" ; slug))
( files::name-of ( nera:get-storage-file :slug slug ) ) ) )
( storage:rename-content-file
"" "media"
( format nil "thumbnail-~a"
( files::slug -of
( files::name -of
( nera:get-storage-file :slug slug ) ) )
( utils:slugify ( format nil "thumbnail-~a" new-file-name ) ) ) )
( utils:format-filename ( format nil "thumbnail-~a" new-file-name ) ) ) )
( nera:rename-storage-file
( files::name-of ( nera:get-storage-file :slug slug ) )
new-file-name )
@ -878,9 +879,15 @@
"" "media"
( files::name-of ( nera:get-storage-file :slug slug ) ) )
( when ( storage:file-exists-p
"" "media" ( format nil "thumbnail-~a" slug ) )
"" "media"
( format nil "thumbnail-~a"
( files::name-of
( nera:get-storage-file :slug slug ) ) ) )
( storage:remove-file
"" "media" ( format nil "thumbnail-~a" slug ) ) )
"" "media"
( format nil "thumbnail-~a" ( files::name-of
( nera:get-storage-file
:slug slug ) ) ) ) )
( nera:delete-storage-file :slug slug )
( utils:set-alert "File deleted." )
( redirect "/storage/manage" ) ) )