mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-17 11:04:22 +01:00
ensure first_seen_at is propagated
This commit is contained in:
parent
ef4a9154b6
commit
179906a9cf
1 changed files with 7 additions and 0 deletions
|
@ -330,6 +330,7 @@ defmodule Philomena.Images do
|
||||||
|
|
||||||
case result do
|
case result do
|
||||||
{:ok, changes} ->
|
{:ok, changes} ->
|
||||||
|
update_first_seen_at(duplicate_of_image, image.first_seen_at)
|
||||||
tags = Tags.copy_tags(image, duplicate_of_image)
|
tags = Tags.copy_tags(image, duplicate_of_image)
|
||||||
Comments.migrate_comments(image, duplicate_of_image)
|
Comments.migrate_comments(image, duplicate_of_image)
|
||||||
Interactions.migrate_interactions(image, duplicate_of_image)
|
Interactions.migrate_interactions(image, duplicate_of_image)
|
||||||
|
@ -341,6 +342,12 @@ defmodule Philomena.Images do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp update_first_seen_at(image, time) do
|
||||||
|
Image
|
||||||
|
|> where(id: ^image.id)
|
||||||
|
|> Repo.update_all(set: [first_seen_at: time])
|
||||||
|
end
|
||||||
|
|
||||||
defp internal_hide_image(changeset, image) do
|
defp internal_hide_image(changeset, image) do
|
||||||
reports =
|
reports =
|
||||||
Report
|
Report
|
||||||
|
|
Loading…
Reference in a new issue