Topic: variables with "-" character not valid when enclosed with %'s?

When using the last.fm.plus plug-in, several of the variables it uses contain the "-" character, such as "comment:Songs-DB_Custom1".  I often want to use the values from these fields in my script, but whenever I attempt to use them in a function that requires them to be enclosed in % signs, such as $set(testvariable,%comment:Songs-DB_Custom1%), Picard gives me the error message "Unexpected character "-" at position x, line y".

I am currently working around this by using the copy function, which doesn't require % signs, to copy "comment:Songs-DB_Custom1"'s value to a temporary variable named something that does not include the "-" character, then using that temporary variable in the rest of my scripts, the unsetting that temporary variable at the end of my script so it does not get written to the music file itself.  An example would be $copy(testvariable,comment:Songs-DB_Custom1).

I've also tried escaping the "-" character in the variable name, such as $set(testvariable,%comment:Songs\-DB_Custom1%), but this doesn't change anything (as I would not really expect it to anyway).  Is Picard designed not to accept variable names with "-" in them for some reason?

Re: variables with "-" character not valid when enclosed with %'s?

I need to update my original issue below: I've taken another look and the date variables with only years in them (yyyy) do seem to work when used in other Picard functions for most songs.  There just seem to be some albums for which the date variable can't be used in other functions - ones I have run across so far are (artist; album; MusicBrainz Release ID):

AC/DC; Plug Me In (Bonus Disc); b4e74703-ebbb-4ec9-bcad-dd907e036988
Paul Taylor; Prime Time; bec7d307-2477-46bf-aaaf-efac64cff5f8

Any clue why the dates in these specific ones are unable to be utilized by other Picard functions"?

Re: variables with "-" character not valid when enclosed with %'s?

*sigh* just realized that I included the wrong release ID for Paul Taylor's Prime Time release in my previous post.  The correct Relase ID is 15ed8681-b6fa-4af8-8c0b-4780a8a1541e.

4 (edited by Rovastar 2012-08-15 21:31:11)

Re: variables with "-" character not valid when enclosed with %'s?

Neither of those releases have a release date in the database hence why you cannot return one.

Re: variables with "-" character not valid when enclosed with %'s?

Thanks, Rovastar.  I have apparently crossed my posts on two separate topics - this date topic and another related to using variables containing a "-" sign.  I'll repost that one.

On this date topic:

- How can I view a release date (or lack of one) for a release in MB?
- I am assuming that the value Picard reports for the date field for this release is one that I myself added manually at some point in the past.  Sounds like what you are telling me is that, even if there is a value currently in place for the date variable, Picard scripts can only utilize variables that they themselves are currently returning from the MB database as part of the album lookup process in Picard.  Is my understanding correct here?

Thanks for your help, Rovastar.  Much appreciated!

Re: variables with "-" character not valid when enclosed with %'s?

First off I am also new here so I don't know it all...not by a long way - I am still asking stupid questions. I am just starting to tag my collection and update the MusicBrainz database with what is missing.

But I looked up with Picard tagger or you can just lookup those releases on the website

E.g.

Here is the artist Paul Taylor

http://musicbrainz.org/artist/bec7d307- … ac64cff5f8

As you can see most of the albums haven't got a year assigned to them.

You can, and should, edit these with the info. e.g. If you have the CD in your hand I just add the relevant info.

Edit the Prime Time "release group" and the corresponding Release (there is only 1 - the CD) so yoiu can fill in the label it is on, the release date or just year, the disc ID if you have the actual CD, cover art, etc.

Have you done any editing yet? I would read all the documentation. http://musicbrainz.org/doc/Beginners_Guide

Re: variables with "-" character not valid when enclosed with %'s?

Just to add:
I think what might have happened is that you already have a mp3 tag for the date.

In Picard look at the Original Value (your tags already in the Mp3)  and the new value (what is entered in the MusicBrainz database) for that album.

Re: variables with "-" character not valid when enclosed with %'s?

jcplemons wrote:

- I am assuming that the value Picard reports for the date field for this release is one that I myself added manually at some point in the past.  Sounds like what you are telling me is that, even if there is a value currently in place for the date variable, Picard scripts can only utilize variables that they themselves are currently returning from the MB database as part of the album lookup process in Picard.  Is my understanding correct here?

Correct. Picard's advanced scripting cannot use existing metadata to make decisions; only MB-retrieved metadata.

To maximise the chance of retrieving a date and avoid having to manually change to a release that has a date (and if you don't care about accurate dates for re-releases), you could consider using %originaldate% instead of date; which comes from the earliest date of any release in the release group. That way there's more likely to be a date; regardless of which individual release MB has chosen.