@ -692,7 +692,7 @@ nil "/users/~D"(mito:object-id user))))))))
( rails-to-caveman.model::filename-of user ) ) ) )
( ( _ nil ) ; when specify new one, always remove old one.
( rails-to-caveman.model::purge user "account" image-file )
( storage::write ( car image )
( rails-to-caveman. storage::write ( car image )
( mito:object-id user ) "account"
( make-image-file image ) ) )
( ( nil _ ) ) ; do not remove, no new one, so do nothing.
@ -707,12 +707,12 @@ nil "/users/~D"(mito:object-id user))))))))
( defun purge ( user subdirectory filename )
( let ( deletedp ( id ( mito:object-id user ) ) )
( dolist ( pathname ( uiop:directory-files
( storage::make-storage-pathname id subdirectory ) )
( rails-to-caveman. storage::make-storage-pathname id subdirectory ) )
deletedp )
( let ( ( file ( storage::read-from-base64-string ( pathname-name pathname ) ) ) )
( when ( equal filename ( storage::file-name file ) )
( let ( ( file ( rails-to-caveman. storage::read-from-base64-string ( pathname-name pathname ) ) ) )
( when ( equal filename ( rails-to-caveman. storage::file-name file ) )
( setf deletedp t )
( storage::remove id subdirectory file ) ) ) ) ) )
( rails-to-caveman. storage::remove id subdirectory file ) ) ) ) ) )
( defroute ( "/account" :method :put ) ( ) )
( defroute ( "/account" :method :delete ) ( ) )
@ -764,7 +764,7 @@ nil "/users/~D"(mito:object-id user))))))))
:token , ( token )
:news , ( articles 5 )
:blogs , ( entries :limit 5 ) ) ) ) )
( progn ( storage::write ( car image )
( progn ( rails-to-caveman. storage::write ( car image )
( mito:object-id user )
( format nil "entry~A" entry-id )
( make-image-file image ) )
@ -832,7 +832,7 @@ nil "/users/~D"(mito:object-id user))))))))
( progn ( unless ( equal old
( rails-to-caveman.model::filename-of entry-image ) )
( rails-to-caveman.model::purge user subdirectory old )
( storage::write ( car image )
( rails-to-caveman. storage::write ( car image )
( mito:object-id user )
subdirectory ( make-image-file image ) ) )
( mito:save-dao entry-image )
@ -1184,17 +1184,17 @@ nil "/users/~D"(mito:object-id user))))))))
filename
size
content-type )
( let* ( ( original-file ( storage::make-file :name filename
( let* ( ( original-file ( rails-to-caveman. storage::make-file :name filename
:content-type content-type ) )
( to-load original-file ) )
( when size ( let ( ( converted-file ( storage::make-file :name filename
( when size ( let ( ( converted-file ( rails-to-caveman. storage::make-file :name filename
:size size
:content-type content-type ) ) )
( unless ( storage::probe-file id subdirectory converted-file )
( storage::convert id subdirectory original-file converted-file ) )
( unless ( rails-to-caveman. storage::probe-file id subdirectory converted-file )
( rails-to-caveman. storage::convert id subdirectory original-file converted-file ) )
( setf to-load converted-file ) ) )
( multiple-value-bind ( content length )
( storage::read id subdirectory to-load )
( rails-to-caveman. storage::read id subdirectory to-load )
` ( , status-code:+ok+ ( :content-type , content-type
:content-length , length ) , content ) ) ) )