Author Topic: How to add "Guest Artist" using Api?  (Read 783 times)

jonap

  • Full Member
  • ***
  • Posts: 136
Hi, I am not sure I am doing something wrong or it's not possible at all

But using "Library_SetFileTag" and "Library_CommitTagsToFile" I am able to add "Artist" to files, using corresponding Artist field (MetaDataType)32

But when using (MetaDataType)147, for Guest Artists, I am not able to add Guest Artist

Any help?

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34418
No its currently not possible. As it stands guest artist is read only.

jonap

  • Full Member
  • ***
  • Posts: 136
Oh okay, I guessed so, thanks

Is it cause they are part of Artist field so it would be hard to make them writable with api, or is it a specific decision to not implement it?

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1290
Oh okay, I guessed so, thanks

Is it cause they are part of Artist field so it would be hard to make them writable with api, or is it a specific decision to not implement it?

You may be able to request this on the Wishlist board.

boroda

  • Hero Member
  • *****
  • Posts: 4748
@jonap, you can set all artists at once using MultiArtist API tag. all artists must be separated by \0, and after \0 you can use either letter for artist or \x01, \x02, \x03 for guest artists, performers, etc. i write this from memory, but you can take a look at the source code of AT&RT plugin, pay attention to SetTag() function in the main .cs file.

jonap

  • Full Member
  • ***
  • Posts: 136
@jonap, you can set all artists at once using MultiArtist API tag. all artists must be separated by \0, and after \0 you can use either letter for artist or \x01, \x02, \x03 for guest artists, performers, etc. i write this from memory, but you can take a look at the source code of AT&RT plugin, pay attention to SetTag() function in the main .cs file.

Wow thanks boroda, didn't think this was possible

Though I need some help

I tried looking at the AT&RT plugin code, but your plugin other than crazy good, is also pretty huge and hard to understand for novices like me, so I wasn't able to figure out the infos I needed from it

But by making some attempts, I was able to get something:

Exemple: want to set Led Zeppelin and Madonna as individual Artists, Queen as Guest Artist and Bon Jovi as Performer

Code
Led Zeppelin\0 Madonna\0\x01 Queen\0\x02 Bon Jovi



As you can see, there is space at the start of the tag, so I think to remove the space in the code

Code
Led Zeppelin\0Madonna\0\x01Queen\0\x02Bon Jovi



Now Madonna and Queen look fine, but Bon Jovi became +on Jovi and lost the Performer status, that's cause \0b is some special character while \0m and \0q are not

So I tried looking at this special characters and realize there is a bunch of them, when the tag starts with a,b,c,d,e and f

Code
Led Zeppelin\0\x01aaa\0\x01bbb\0\x01ccc\0\x01ddd\0\x01eee\0\x01fff\0\x01ggg



so my stupid question is: how do I escape the special characters that break the tag?
Last Edit: April 29, 2024, 11:16:29 AM by jonap

boroda

  • Hero Member
  • *****
  • Posts: 4748
you have stumped me. i never did any workaround for this. all was always working as expected. the only difference is that i actually use \x00 instead of \0.

jonap

  • Full Member
  • ***
  • Posts: 136
Oh no, if even boroda can't do it, then I guess we are officially back to not possible status  :'(

boroda

  • Hero Member
  • *****
  • Posts: 4748
try to use \u0000, \u0001, etc. instead of \0, \x01,...

jonap

  • Full Member
  • ***
  • Posts: 136
Wow thank you, it worked
I think there is no difference between "x" and "u" but anyway the solution is to use "0001" instead of "01" and so on (1 for guest, 2 for performer, 4 for remixer)
So for just artists, you need \0, for other tags, you need \0\x0001 [1-2-4]
So for exemple a final string should be this:

Code
ART\0ART\0\x0001GUEST\0\x0002PERF\0\x0004REMIX



Now just to go further and help someone having the same trouble I had, I want to ADD rather than SET, an entry in the multiartist tag, meaning for exemple adding a guest artist to already set unknown number of artists/guests/performers etc

To do that we need to check if multiartist tag is empty first ("") and in that case use the artists tag (basically metadata 32, while multiartist is metadata 33)

I say this cause if you previously set Artist only from the artist tag, the Multiple Artist Splitter view shows the artist as individual artist but in reality multiartist is still empty till you add a second one (or if there is only 1 entry, if it's different than the displayed artist)

I hope that was understandable as I am not sure I explained it well

And thanks to boroda for solving my problem