fixes #118, alias channel associated tags too

This commit is contained in:
byte[] 2020-05-13 14:09:22 -04:00
parent 6a708f11b6
commit 64dd6d061c

View file

@ -17,6 +17,7 @@ defmodule Philomena.Tags do
alias Philomena.Images.Tagging alias Philomena.Images.Tagging
alias Philomena.UserLinks.UserLink alias Philomena.UserLinks.UserLink
alias Philomena.DnpEntries.DnpEntry alias Philomena.DnpEntries.DnpEntry
alias Philomena.Channels.Channel
@spec get_or_create_tags(String.t()) :: List.t() @spec get_or_create_tags(String.t()) :: List.t()
def get_or_create_tags(tag_list) do def get_or_create_tags(tag_list) do
@ -214,6 +215,10 @@ defmodule Philomena.Tags do
|> where(tag_id: ^tag.id) |> where(tag_id: ^tag.id)
|> Repo.update_all(set: [tag_id: target_tag.id]) |> Repo.update_all(set: [tag_id: target_tag.id])
Channel
|> where(associated_artist_tag_id: ^tag.id)
|> Repo.update_all(set: [associated_artist_tag_id: target_tag.id])
# Update counter # Update counter
Tag Tag
|> where(id: ^tag.id) |> where(id: ^tag.id)