2 Commits

  1. 9
      CHANGELOG.md
  2. 12
      apps/listens/lib/listens/workers/listenbrainz/handler.ex
  3. 2
      mix.exs

9
CHANGELOG.md

@ -5,6 +5,15 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
<!-- changelog -->
## [v0.76.4](https://git.inhji.de/inhji/tomie/compare/v0.76.3...v0.76.4) (2020-08-18)
### Bug Fixes:
* metadata
## [v0.76.3](https://git.inhji.de/inhji/tomie/compare/v0.76.2...v0.76.3) (2020-08-18)

12
apps/listens/lib/listens/workers/listenbrainz/handler.ex

@ -71,15 +71,15 @@ defmodule Listens.Workers.Listenbrainz.Handler do
def prepare_listen(listen, state) do
%{
additional_info: info,
additional_info: additional_info,
artist_name: artist_name,
release_name: release_name,
track_name: track_name
} = get_track_metadata(listen)
with {:ok, artist, new: new_artist} <- maybe_create_artist(artist_name, info.artist_msid),
with {:ok, artist, new: new_artist} <- maybe_create_artist(artist_name, additional_info.artist_msid),
{:ok, album, new: new_album} <-
maybe_create_album(release_name, info.release_msid, artist),
maybe_create_album(release_name, additional_info.release_msid, artist),
{:ok, track, new: new_track} <- maybe_create_track(track_name, artist, album) do
changeset =
Listen.changeset(%Listen{}, %{
@ -109,9 +109,9 @@ defmodule Listens.Workers.Listenbrainz.Handler do
def get_track_metadata(listen) do
%{
additional_info: Map.get(listen.track_metadata, :additional_info, nil),
artist_name: Map.get(listen.artist_name, :artist_name, nil),
release_name: Map.get(listen.release_name, :release_name, nil),
track_name: Map.get(listen.track_name, :track_name, nil)
artist_name: Map.get(listen.track_metadata, :artist_name, nil),
release_name: Map.get(listen.track_metadata, :release_name, nil),
track_name: Map.get(listen.track_metadata, :track_name, nil)
}
end

2
mix.exs

@ -1,7 +1,7 @@
defmodule Tomie.Umbrella.MixProject do
use Mix.Project
@version "0.76.3"
@version "0.76.4"
def project do
[

Loading…
Cancel
Save