From 64cef1f95eb0776236dad162c98de87e913aa1ad Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 7 Dec 2014 06:09:19 +0100 Subject: [PATCH] fixed bug with shared albums direct upload --- Handler/Upload.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Handler/Upload.hs b/Handler/Upload.hs index 4fc1060..d2f218e 100644 --- a/Handler/Upload.hs +++ b/Handler/Upload.hs @@ -130,7 +130,9 @@ postDirectUploadR albumId = do fil <- return $ tempMediumFile temp case (fileContentType fil) `elem` acceptedTypes of True -> do - path <- writeOnDrive fil userId albumId + albRef <- runDB $ getJust (tempMediumAlbum temp) + ownerId <- return $ albumOwner albRef + path <- writeOnDrive fil ownerId albumId thumbPath <- generateThumb path ownerId albumId medium <- return $ Medium (tempMediumTitle temp)