From 737fc7ad0e526d5b7c4d1f57d11f4a1d66c0c686 Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 16 Jan 2015 22:41:44 +0100 Subject: [PATCH] upload fixes --- Handler/Upload.hs | 6 +++--- templates/upload.hamlet | 7 ------- 2 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 templates/upload.hamlet diff --git a/Handler/Upload.hs b/Handler/Upload.hs index 3ea85fc..9d32308 100644 --- a/Handler/Upload.hs +++ b/Handler/Upload.hs @@ -60,11 +60,11 @@ postDirectUploadR albumId = do mime <- return $ fileContentType file case mime `elem` acceptedTypes of True -> do - albRef <- runDB $ getJust albumId - ownerId <- return $ albumOwner albRef path <- writeOnDrive file ownerId albumId (thumbPath, iWidth, tWidth) <- generateThumb path ownerId albumId - tempName <- return $ ((fileBulkPrefix temp) `T.append` " " `T.append` (T.pack (show index)) `T.append` " of " `T.append` (T.pack (show (length indFils)))) + tempName <- case length indFils == 1 of + False -> return $ ((fileBulkPrefix temp) `T.append` " " `T.append` (T.pack (show index)) `T.append` " of " `T.append` (T.pack (show (length indFils)))) + True -> return $ fileBulkPrefix temp medium <- return $ Medium tempName ('/' : path) diff --git a/templates/upload.hamlet b/templates/upload.hamlet deleted file mode 100644 index 9deda88..0000000 --- a/templates/upload.hamlet +++ /dev/null @@ -1,7 +0,0 @@ -