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
|
medium <- runDB $ getJust a
|
||||||
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
||||||
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
||||||
|
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
|
||||||
-- delete comments
|
-- delete comments
|
||||||
commEnts <- runDB $ selectList [CommentOrigin ==. a] []
|
commEnts <- runDB $ selectList [CommentOrigin ==. a] []
|
||||||
_ <- mapM (\c -> do
|
_ <- mapM (\c -> do
|
||||||
|
|
|
@ -136,6 +136,7 @@ getAdminMediumDeleteR mediumId = do
|
||||||
-- delete files
|
-- delete files
|
||||||
liftIO $ removeFile (normalise $ tail $ mediumPath medium)
|
liftIO $ removeFile (normalise $ tail $ mediumPath medium)
|
||||||
liftIO $ removeFile (normalise $ tail $ mediumThumb medium)
|
liftIO $ removeFile (normalise $ tail $ mediumThumb medium)
|
||||||
|
liftIO $ removeFile (normalise $ tail $ mediumPreview medium)
|
||||||
-- outro
|
-- outro
|
||||||
setMessage "Medium deleted successfully"
|
setMessage "Medium deleted successfully"
|
||||||
redirect AdminR
|
redirect AdminR
|
||||||
|
|
|
@ -169,6 +169,7 @@ getAdminProfileDeleteR ownerId = do
|
||||||
medium <- runDB $ getJust med
|
medium <- runDB $ getJust med
|
||||||
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
||||||
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
||||||
|
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
|
||||||
-- delete medium database entry and search
|
-- delete medium database entry and search
|
||||||
ium <- runDB $ getJust med
|
ium <- runDB $ getJust med
|
||||||
deleteIndexES $ ESMedium med ium
|
deleteIndexES $ ESMedium med ium
|
||||||
|
|
|
@ -198,6 +198,7 @@ postAlbumDeleteR albumId = do
|
||||||
medium <- runDB $ getJust a
|
medium <- runDB $ getJust a
|
||||||
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
||||||
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
||||||
|
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
|
||||||
-- delete medium from elasticsearch
|
-- delete medium from elasticsearch
|
||||||
deleteIndexES (ESMedium a medium)
|
deleteIndexES (ESMedium a medium)
|
||||||
-- delete comments
|
-- delete comments
|
||||||
|
|
|
@ -112,6 +112,7 @@ postMediumDeleteR mediumId = do
|
||||||
runDB $ update albumId [AlbumContent =. newMediaList]
|
runDB $ update albumId [AlbumContent =. newMediaList]
|
||||||
liftIO $ removeFile (normalise $ tail $ mediumPath medium)
|
liftIO $ removeFile (normalise $ tail $ mediumPath medium)
|
||||||
liftIO $ removeFile (normalise $ tail $ mediumThumb medium)
|
liftIO $ removeFile (normalise $ tail $ mediumThumb medium)
|
||||||
|
liftIO $ removeFile (normalise $ tail $ mediumPreview medium)
|
||||||
runDB $ delete mediumId
|
runDB $ delete mediumId
|
||||||
-- delete form elasticsearch
|
-- delete form elasticsearch
|
||||||
deleteIndexES (ESMedium mediumId medium)
|
deleteIndexES (ESMedium mediumId medium)
|
||||||
|
|
|
@ -64,6 +64,7 @@ postProfileDeleteR userId = do
|
||||||
medium <- runDB $ getJust med
|
medium <- runDB $ getJust med
|
||||||
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
liftIO $ removeFile (normalise $ L.tail $ mediumPath medium)
|
||||||
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
|
||||||
|
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
|
||||||
deleteIndexES (ESMedium med medium)
|
deleteIndexES (ESMedium med medium)
|
||||||
runDB $ delete med
|
runDB $ delete med
|
||||||
) mediaList
|
) mediaList
|
||||||
|
|
Loading…
Reference in a new issue