IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Possible Error in Official Discogs.src v1.06, Section "Media Type" not working
michael_funk
post Oct 4 2017, 15:16
Post #1


Member


Group: Full Members
Posts: 32
Joined: 18-July 06
Member No.: 3451
Mp3tag Version: 2.43



Hi!

When I use Discogs.src to get the tags for Discogs Release ID 996990, the output to the MEDIATYPE field is "CD". I would expect it to be "CD, Album, Reissue", since the code in Discogs.src explicitly selects the values in descriptions.

# Media Type
outputto "MEDIATYPE"
json_select_many "formats" "name" ", "
sayrest
json_select_many "formats" "descriptions" ", "
ifnot ""
say " "
endif
sayrest

The data structures (as shown in mp3debug.txt) are:

"formats": [{"qty": "1", "descriptions": ["Album", "Reissue"], "name": "CD"}]

So my question is: How do you correctly reference the values in the descriptions array?

Michael

Go to the top of the page
 
+Quote Post
Florian
post Oct 14 2017, 11:02
Post #2


Developer


Group: Admin
Posts: 8106
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.85a



Hi Michael,

many thanks for bringing this to my attention — it's indeed not correct. A good way to also output the descriptions (while at the same time making clear that it's not the actual format) would be:

CODE
# Media Type
outputto "MEDIATYPE"
json_foreach "formats"
    json_select "name"
    sayrest
    json_select_array "descriptions" -1 ", "
    ifnot ""
        say " ("
        sayrest
        say ")"
    endif
json_foreach_end


What do you think?

Kind regards
– Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
michael_funk
post Oct 16 2017, 10:04
Post #3


Member


Group: Full Members
Posts: 32
Joined: 18-July 06
Member No.: 3451
Mp3tag Version: 2.43



Hi Florian,

thank you for your reply and the solution.

What do you mean by "... (while at the same time making clear that it's not the actual format) ..."? I just generated a new debug.txt - the format is exactly as displayed in the original post. Or did I get something wrong here?

Your solution works quite nicely and I think, it should become part of the next official discogs.src. I'll keep an eye on the output of the new code while tagging other records.

Many thanks and best regards,
Michael
Go to the top of the page
 
+Quote Post
Florian
post Oct 16 2017, 10:14
Post #4


Developer


Group: Admin
Posts: 8106
Joined: 12-December 01
From: Germany, Dresden
Member No.: 203
Mp3tag Version: 2.85a



Hi Michael,

QUOTE (michael_funk @ Oct 16 2017, 11:04) *
I just generated a new debug.txt - the format is exactly as displayed in the original post. Or did I get something wrong here?

It's just a little bit different, but it's only a minor change: I've but the format descriptions in brackets to distinguish the actual format from the descriptions

CD, Album, Reissue
vs.
CD (Album, Reissue)


QUOTE
Your solution works quite nicely and I think, it should become part of the next official discogs.src. I'll keep an eye on the output of the new code while tagging other records.

Great smile.gif Thanks again!

– Florian


--------------------
♫ If you like using Mp3tag please donate to support further development.

Go to the top of the page
 
+Quote Post
michael_funk
post Oct 17 2017, 11:43
Post #5


Member


Group: Full Members
Posts: 32
Joined: 18-July 06
Member No.: 3451
Mp3tag Version: 2.43



ZITAT(Florian @ Oct 16 2017, 11:14) *
CD, Album, Reissue
vs.
CD (Album, Reissue)


Oh, THAT you mean! Yeah, sure ... I thought you were reffering to the format of the input.

I also extended the original script to fill the tag MIXARTIST if present.

In the following discogs release I found interesting info on the musicians that played on an individual track:

https://www.discogs.com/Miles-Davis-Live-Ar.../release/396240

If you would like to adapt the official script, here is my suggestion:

CODE
json_select_many "extraartists" "name" ", "
ifnot ""
outputto "MIXARTIST"
set "tmp_join"
json_foreach "extraartists"
sayoutput "tmp_join"
set "tmp_join"
json_select "role"
ifnot ""
sayrest
endif
json_select "anv"
ifnot ""
say ": "
sayrest
saynewline
else
json_select "name"
say ": "
sayrest
saynewline
endif
json_foreach_end
say "|"
else
outputto "MIXARTIST"
say "|"
endif


I placed this right after the "artists" section in the tracklist loop.

Best regards,
Michael smile.gif

This post has been edited by michael_funk: Oct 17 2017, 13:22
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd November 2017 - 08:28