AnthonyMusgrove / Emby-ScripterX

Run custom external application or script (batch/bash/powershell/php/python/node.js/custom) on various events within the Emby Server.
https://emby-scripterx.com
78 stars 6 forks source link

MusicArtist not being included in ItemAdded #12

Closed AnthonyMusgrove closed 2 years ago

AnthonyMusgrove commented 4 years ago

Is your feature request related to a problem? Please describe.

I added a folder for the artist Duffy which contained the Album Folder Rockferry The folder Duffy and rockferry were picked up fine - along with all the tracks - great Apart from the missing Library.name I noticed that there was no event for a MusicArtist being added - there is one for Duffy being updated though - again not sure if this is Emby or just missed off your list?

AnthonyMusgrove commented 4 years ago

I'm trying to replicate this one mate - I added an album 'Michael Jackson - XScape Deluxe', It added all the songs, and even the MusicAlbum, but it never added a MusicArtist. I know MusicArtist is definitely an entity within Emby, but it isn't associated with a MusicAlbum, and individual songs within this album, even though I identified it correctly, the Artist is blank in the metadata for the songs, could you please assist :)

Music Artist

Penkethboy commented 4 years ago

Anthony

Ok - do the music files have metadata tags? Emby for music is tag driven - i.e. if you don't have tags its down to a lookup by name and that usually leads to chaos.

So - if you have Mp3Tag (free) - add tags for Artist,Artists,AlbumArtist - all saying Michael Jackson - do this for all the songs in the album - that should get emby to pick up what the MusicArtist is.

If not we can go the MusicBrainz Picard route

Penkethboy commented 4 years ago

@AnthonyMusgrove

any update on this?

AnthonyMusgrove commented 4 years ago

​ Alrighty, for #12, it looks like its an Emby behaviour, where onItemAdded isn't called for a MusicArtist, only onItemUpdated is.    @LukePulverenti

This is the general logging order for when a Music library folder is added, then an Album and a bunch of songs.  You can see the onItemUpdated for a MusicArtist but an onItemAdded is never called, thus an onItemAddedComplete will never call.  So unless this is a bug, it's an emby behaviour that a MusicArtist being created doesn't trigger an onItemAdded, only an onItemUpdated.  I wonder if Luke can elaborate more on that one.

2020-06-22 20:32:07.140 Info Emby ScripterX: onMediaItemAdded: "Folder" "Music"

2020-06-22 20:32:07.161 Info Emby ScripterX: onMediaItemAddedComplete: "Folder" "Music" 2020-06-22 20:32:07.170 Info Emby ScripterX: onMediaItemUpdated: "Folder" "Music"

2020-06-22 20:32:07.196 Info Emby ScripterX: onMediaItemAdded: "CollectionFolder" "Music"

2020-06-22 20:32:07.229 Info Emby ScripterX: onMediaItemAddedComplete: "CollectionFolder" "Music" 2020-06-22 20:32:07.236 Info Emby ScripterX: onMediaItemUpdated: "CollectionFolder" "Music"

2020-06-22 20:33:55.276 Info Emby ScripterX: onMediaItemAdded: "MusicAlbum" "Breaking Benjamin - Ember (2018) [CD 320]"

2020-06-22 20:33:55.303 Info Emby ScripterX: onMediaItemAdded: "Audio" "01. Lyra"

2020-06-22 20:33:56.644 Info Emby ScripterX: onMediaItemAddedComplete: "Audio" "Lyra"

2020-06-22 20:34:08.318 Info Emby ScripterX: onMediaItemAddedComplete: "MusicAlbum" "Ember" 2020-06-22 20:34:08.329 Info Emby ScripterX: onMediaItemUpdated: "MusicAlbum" "Ember"

?? 2020-06-22 20:34:08.342 Debug App: Refreshing MusicArtist Breaking Benjamin because item.RequiresRefresh() returned true 2020-06-22 20:34:08.345 Debug App: Running MusicBrainzArtistProvider for Breaking Benjamin ??

2020-06-22 20:34:13.461 Info Emby ScripterX: onMediaItemUpdated: "MusicArtist" "Breaking Benjamin"

AnthonyMusgrove commented 4 years ago

I have a way around this in a way, we can detect MusicArtist on update and treat it as a created item possibly using a timestamp.