Compare commits

..

No commits in common. "2b1940b401f81f7c58b94806da0fcad47c794eb8" and "34bfd77ba6b0b62b55a72dd78ffd7a89a65f40ad" have entirely different histories.

3 changed files with 11 additions and 16 deletions

1
.gitignore vendored
View File

@ -2,5 +2,4 @@
todo todo
dist-newstyle/ dist-newstyle/
paths.txt paths.txt
temp_paths.txt
temp_backfill_settings.json temp_backfill_settings.json

View File

@ -244,8 +244,8 @@ setPostIdInPosts tuples ids = map f ids
(\(a, b, c, i, j) -> (a, b, c, i, j { Posts.post_id = Just asdf1 })) (post_map Map.! (asdf2, asdf3)) (\(a, b, c, i, j) -> (a, b, c, i, j { Posts.post_id = Just asdf1 })) (post_map Map.! (asdf2, asdf3))
fileToAttachment :: Int -> Posts.Post -> JS.File -> At.Attachment fileToAttachment :: Posts.Post -> JS.File -> At.Attachment
fileToAttachment i post file = fileToAttachment post file =
At.Attachment At.Attachment
{ At.mimetype = maybe guessed_mime id (JS.mime file) { At.mimetype = maybe guessed_mime id (JS.mime file)
, At.creation_time = Posts.creation_time post , At.creation_time = Posts.creation_time post
@ -260,7 +260,6 @@ fileToAttachment i post file =
, At.file_size_bytes = JS.fsize file , At.file_size_bytes = JS.fsize file
, At.board_filename = JS.id file , At.board_filename = JS.id file
, At.spoiler = maybe False id $ JS.spoiler file , At.spoiler = maybe False id $ JS.spoiler file
, At.attachment_idx = i
} }
where where
@ -461,7 +460,6 @@ processFiles settings tuples = do -- perfect just means that our posts have ids,
, At.file_size_bytes = size , At.file_size_bytes = size
, At.board_filename = tim , At.board_filename = tim
, At.spoiler = spoiler > 0 , At.spoiler = spoiler > 0
, At.attachment_idx = 1
} }
return (p, attachment) return (p, attachment)
@ -479,16 +477,14 @@ processFiles settings tuples = do -- perfect just means that our posts have ids,
-> [(Sites.Site, Boards.Board, Threads.Thread, Posts.Post, At.Paths, At.Attachment)] -> [(Sites.Site, Boards.Board, Threads.Thread, Posts.Post, At.Paths, At.Attachment)]
parseAttachments (site, board, thread, p, q) = filter notDeleted $ parseAttachments (site, board, thread, p, q) = filter notDeleted $
case JSONPosts.files p of case JSONPosts.files p of
Just files -> map Just files -> map (\x ->
(\(i, x) -> ( site
( site , board
, board , thread
, thread , q
, q , At.Paths (withPathPrefix $ JS.file_path x) (withPathPrefix $ JS.thumb_path x)
, At.Paths (withPathPrefix $ JS.file_path x) (withPathPrefix $ JS.thumb_path x) , fileToAttachment q x)
, fileToAttachment i q x ) files
)
) (zip [1..] files)
Nothing -> Nothing ->
case parseLegacyPaths p of case parseLegacyPaths p of
Nothing -> [] Nothing -> []

@ -1 +1 @@
Subproject commit 1b08b3ac079c6032e1090e79a8074d4cfd9ef24f Subproject commit 1264424bd541649a2f163542a93203235e996ac3