forgot deleting preview images
This commit is contained in:
parent
02b0022891
commit
6fb658d5fb
6 changed files with 6 additions and 0 deletions
|
@ -148,6 +148,7 @@ getAdminAlbumDeleteR albumId = do
|
|||
medium <- runDB $ getJust a
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
|
||||
-- delete comments
|
||||
commEnts <- runDB $ selectList [CommentOrigin ==. a] []
|
||||
_ <- mapM (\c -> do
|
||||
|
|
|
@ -136,6 +136,7 @@ getAdminMediumDeleteR mediumId = do
|
|||
-- delete files
|
||||
liftIO $ removeFile (normalise $ tail $ mediumPath medium)
|
||||
liftIO $ removeFile (normalise $ tail $ mediumThumb medium)
|
||||
liftIO $ removeFile (normalise $ tail $ mediumPreview medium)
|
||||
-- outro
|
||||
setMessage "Medium deleted successfully"
|
||||
redirect AdminR
|
||||
|
|
|
@ -169,6 +169,7 @@ getAdminProfileDeleteR ownerId = do
|
|||
medium <- runDB $ getJust med
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
|
||||
-- delete medium database entry and search
|
||||
ium <- runDB $ getJust med
|
||||
deleteIndexES $ ESMedium med ium
|
||||
|
|
|
@ -198,6 +198,7 @@ postAlbumDeleteR albumId = do
|
|||
medium <- runDB $ getJust a
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
|
||||
-- delete medium from elasticsearch
|
||||
deleteIndexES (ESMedium a medium)
|
||||
-- delete comments
|
||||
|
|
|
@ -112,6 +112,7 @@ postMediumDeleteR mediumId = do
|
|||
runDB $ update albumId [AlbumContent =. newMediaList]
|
||||
liftIO $ removeFile (normalise $ tail $ mediumPath medium)
|
||||
liftIO $ removeFile (normalise $ tail $ mediumThumb medium)
|
||||
liftIO $ removeFile (normalise $ tail $ mediumPreview medium)
|
||||
runDB $ delete mediumId
|
||||
-- delete form elasticsearch
|
||||
deleteIndexES (ESMedium mediumId medium)
|
||||
|
|
|
@ -64,6 +64,7 @@ postProfileDeleteR userId = do
|
|||
medium <- runDB $ getJust med
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
||||
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
|
||||
deleteIndexES (ESMedium med medium)
|
||||
runDB $ delete med
|
||||
) mediaList
|
||||
|
|
Loading…
Reference in a new issue