diff --git a/Handler/AdminAlbumSettings.hs b/Handler/AdminAlbumSettings.hs index 1368d13..542119d 100755 --- a/Handler/AdminAlbumSettings.hs +++ b/Handler/AdminAlbumSettings.hs @@ -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 diff --git a/Handler/AdminMediumSettings.hs b/Handler/AdminMediumSettings.hs index 7fc5817..9c95a88 100755 --- a/Handler/AdminMediumSettings.hs +++ b/Handler/AdminMediumSettings.hs @@ -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 diff --git a/Handler/AdminProfileSettings.hs b/Handler/AdminProfileSettings.hs index f571142..c3498aa 100755 --- a/Handler/AdminProfileSettings.hs +++ b/Handler/AdminProfileSettings.hs @@ -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 diff --git a/Handler/AlbumSettings.hs b/Handler/AlbumSettings.hs index 0c6043d..b4fdf38 100755 --- a/Handler/AlbumSettings.hs +++ b/Handler/AlbumSettings.hs @@ -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 diff --git a/Handler/MediumSettings.hs b/Handler/MediumSettings.hs index c378b9c..d398b8b 100755 --- a/Handler/MediumSettings.hs +++ b/Handler/MediumSettings.hs @@ -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) diff --git a/Handler/ProfileDelete.hs b/Handler/ProfileDelete.hs index 61aa688..740b288 100755 --- a/Handler/ProfileDelete.hs +++ b/Handler/ProfileDelete.hs @@ -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