fix new medium names on move

This commit is contained in:
nek0 2016-12-30 10:18:13 +01:00
parent e34b9116f1
commit 9354dcdf43

View file

@ -114,7 +114,10 @@ moveMedium med mId destId = do
$(logError) "removing reference" $(logError) "removing reference"
removeReference mId $ mediumAlbum med removeReference mId $ mediumAlbum med
-- move physical Files -- move physical Files
let filen = show $ length (albumContent dest) + 1 -- let filen = show $ length (albumContent dest) + 1
let ac = albumContent dest
[PersistInt64 int] = if L.null ac then [PersistInt64 1] else keyToValues $ maximum $ ac
filen = show $ fromIntegral int + 1
ext = takeExtension $ mediumPath med ext = takeExtension $ mediumPath med
prefix = "static" </> "data" </> T.unpack (extractKey $ albumOwner dest) </> T.unpack (extractKey destId) prefix = "static" </> "data" </> T.unpack (extractKey $ albumOwner dest) </> T.unpack (extractKey destId)
nPath = prefix </> filen ++ ext nPath = prefix </> filen ++ ext