Author Topic: The "&" symbol on Tags  (Read 4369 times)

Tinidazone

  • Jr. Member
  • **
  • Posts: 81
Salutation,
I have some music that have the "&" symbols in the tags.
Especially in the Title tag or the Artist tags.
I am Okey with that but when am trying to use these tags to search external through chrome... the result are different
anything that comes after the "&" symbol is eliminated.

In the screenshot below do explain


these are the tags  on the music

and am using the method below to search it cover art


But the submission on Chrome seems to eliminate everything after the "&" symbols.


It doesn't matter if the symbols is on the title or artist tag. everything after it is eliminated in the searching
WHAT IS WRONG?
I wear shades 😎 cuz you're just too bright 🔆

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
This is because the ampersand (&) is a special character in URLs, so Chrome tries to process the text after it differently. The external tools parameters will allow you to replace "&" with "and" using functions.
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

Tinidazone

  • Jr. Member
  • **
  • Posts: 81
This is because the ampersand (&) is a special character in URLs, so Chrome tries to process the text after it differently. The external tools parameters will allow you to replace "&" with "and" using functions.

Thank you a lot. at least I know it is chromed issues.
I have stumble upon mp3 tag application and it helped me with that issue... replacing it to Feat. on the artist tag. I would like later to share this
I wear shades 😎 cuz you're just too bright 🔆

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
You could also replace it with "%26" which is the url encoding for ampersand. For reference, here's a list of special characters and their encoding for URLs:

https://www.w3schools.com/tags/ref_urlencode.ASP
Last Edit: August 08, 2020, 08:20:15 PM by psychoadept
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

Tinidazone

  • Jr. Member
  • **
  • Posts: 81
You could also replace it with "%26" which is the url encoding for ampersand.
Please refer that am using an external application that took tags from a song to chrome... and these songs are also scrobbled to last FM... If I am to replace the & with the "%26" in the Artist Tag wouldn't affect everything now?
I wear shades 😎 cuz you're just too bright 🔆

frankz

  • Sr. Member
  • ****
  • Posts: 3834
You'd replace & with %26 in your link to the external application, not in the tag, using the $Replace function.

Tinidazone

  • Jr. Member
  • **
  • Posts: 81
:-*
You'd replace & with %26 in your link to the external application, not in the tag, using the $Replace function.

Ok, I will look Into it...to change that using function... Although still looks like rocket science to me.
I wear shades 😎 cuz you're just too bright 🔆

frankz

  • Sr. Member
  • ****
  • Posts: 3834
I'm no expert on functions and could be very wrong, but I think if you put $Replace(<Artist>,"&","%26") where your <Artist> tag is now, you'll be good to go.

Tinidazone

  • Jr. Member
  • **
  • Posts: 81
I'm no expert on functions and could be very wrong, but I think if you put $Replace(<Artist>,"&","%26") where your <Artist> tag is now, you'll be good to go.

Sure. But thanks for the highlighting still. 
I wear shades 😎 cuz you're just too bright 🔆

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2450
Some extra notes...

The $Replace function should be used on all tags you pass as parameters, not just Artist.
Otherwise you'll have the same problem if there's an ampersand in the Title tag too.
You can combine all the tags in your parameters into a single $Replace call.

Avoid using unnecessary characters in your parameters.
When the tags get expanded and passed to the external program they can have unintended effects.
The hyphen between <Artist> and <Title> in your second screenshot will actually get passed to Chrome as -Scoop.
This will exclude results with the word "Scoop" in them, which is the opposite of what you want.

You can't just use a space character between tags either, because that will get stripped out. Use a plus character instead.

Putting all of those things together, this should work as the parameters for your search command:

Code
"https://www.google.com/search?tbm=isch&tbs=imgo:1,isz:l,iar:s&q=$Replace(<Artist>+<Title>,&,%26)"

There may be other special characters that don't get passed to a Chrome search correctly, but I think ampersands are the only one that will actually break it.

Also, you'll get better cover art results if you use <Album> instead of <Title>.
And finally, have a look at Tools > Artwork > Downloader... if you haven't already. It may already do what you're trying to achieve here.
Last Edit: May 09, 2022, 02:59:21 AM by Zak
Bee excellent to each other...

Tinidazone

  • Jr. Member
  • **
  • Posts: 81
Some extra notes...

The $Replace function should be used on all tags you pass as parameters, not just Artist.
Otherwise you'll have the same problem if there's an ampersand in the Title tag too.
You can combine all the tags in your parameters into a single $Replace call.

Avoid using unnecessary characters in your parameters.
When the tags get expanded and passed to the external program they can have unintended effects.
The hyphen between <Artist> and <Title> in your second screenshot will actually get passed to Chrome as -Scoop.
This will exclude results with the word "Scoop" in them, which is the opposite of what you want.

You can't just use a space character between tags either, because that will get stripped out. Use a plus character instead.

Putting all of those things together, this should work as the parameters for your search command:

Code
https://www.google.com/search?tbm=isch&tbs=imgo:1,isz:l,iar:s&q="$Replace(<Artist>+<Title>,&,%26)"

There may be other special characters that don't get passed to a Chrome search correctly, but I think ampersands are the only one that will actually break it.

Also, you'll get better cover art results if you use <Album> instead of <Title>.
And finally, have a look at Tools > Artwork > Downloader... if you haven't already. It may already do what you're trying to achieve here.

Thanks a lot, buddy... I will give it a demo the return the feedback...
I don't use the artwork downloader because most of my songs come from other sources... so they seldom come with the album field. Only the title and the Artist and maybe genres.
Also the downloader doesn't work sometimes and it is inaccurate...I prefer covers from Itunes, Deezer and Genius.
I wear shades 😎 cuz you're just too bright 🔆

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
I don't use the artwork downloader because most of my songs come from other sources... so they seldom come with the album field. Only the title and the Artist and maybe genres.
Also the downloader doesn't work sometimes and it is inaccurate...I prefer covers from Itunes, Deezer and Genius.

Have you ever tried using 'Album Art Downloader' as an external tool?
https://sourceforge.net/projects/album-art/

Via Tools > External Applications you can set it up using specified tags.

Tinidazone

  • Jr. Member
  • **
  • Posts: 81
Code
https://www.google.com/search?tbm=isch&tbs=imgo:1,isz:l,iar:s&q="$Replace(<Artist>+<Title>,&,%26)"


:-*  :-*  :-*
Thank you so much ZAK. It works superb, just the way I wanted for the weblinks.

I think it is better for this thread to be in the TIPS & TRICKS section.

I wear shades 😎 cuz you're just too bright 🔆

Tinidazone

  • Jr. Member
  • **
  • Posts: 81
Quote
Have you ever tried using 'Album Art Downloader' as an external tool?
https://sourceforge.net/projects/album-art/

Via Tools > External Applications you can set it up using specified tags.

Yes, Thank you.
It was the first method I used to do but it opened a new window for every search or query. Although I still have it though. I hated the multiple windows.
while using chrome, I will search for multiple songs and it will open multiple tabs that happened to be familiar with me...


And the app does only one job... it's not multifunctional.
I wear shades 😎 cuz you're just too bright 🔆

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
Quote
Have you ever tried using 'Album Art Downloader' as an external tool?…
Yes, Thank you.
It was the first method I used to do but it opened a new window for every search or query. Although I still have it though. I hated the multiple windows.
Depending on how you configure it and how you use it you can avoid that. But that's not for this thread.