fix dupe merger

This commit is contained in:
Luna D 2023-05-29 14:20:57 +02:00
parent 8f107f4940
commit 7481721d6d
No known key found for this signature in database
GPG key ID: 4B1C63448394F688

View file

@ -17,6 +17,7 @@ defmodule Philomena.Images do
alias Philomena.Images.Uploader alias Philomena.Images.Uploader
alias Philomena.Images.Tagging alias Philomena.Images.Tagging
alias Philomena.Images.Thumbnailer alias Philomena.Images.Thumbnailer
alias Philomena.Images.Source
alias Philomena.Images.ElasticsearchIndex, as: ImageIndex alias Philomena.Images.ElasticsearchIndex, as: ImageIndex
alias Philomena.IndexWorker alias Philomena.IndexWorker
alias Philomena.ImageFeatures.ImageFeature alias Philomena.ImageFeatures.ImageFeature
@ -930,6 +931,7 @@ defmodule Philomena.Images do
def migrate_sources(source, target) do def migrate_sources(source, target) do
sources = sources =
(source.sources ++ target.sources) (source.sources ++ target.sources)
|> Enum.map(fn s -> %Source{image_id: target.id, source: s.source} end)
|> Enum.uniq() |> Enum.uniq()
|> Enum.take(10) |> Enum.take(10)