# Possible Error in Official Discogs.src v1.06

**URL:** https://community.mp3tag.de/t/possible-error-in-official-discogs-src-v1-06/19411
**Category:** Web Sources Discussion
**Created:** [October 4, 2017, 12:16pm UTC](https://community.mp3tag.de/t/possible-error-in-official-discogs-src-v1-06/19411 "2017-10-04T12:16:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![michael\_funk](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@michael\_funk](https://community.mp3tag.de/u/michael_funk)
#### Post date: [October 4, 2017, 12:16pm UTC](https://community.mp3tag.de/t/possible-error-in-official-discogs-src-v1-06/19411/1 "2017-10-04T12:16:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 14, 2017, 8:02am UTC](https://community.mp3tag.de/t/possible-error-in-official-discogs-src-v1-06/19411/2 "2017-10-14T08:02:01Z")

</div>

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:

```
# 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

---

<div class="post-metadata">

### Author: ![michael\_funk](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@michael\_funk](https://community.mp3tag.de/u/michael_funk)
#### Post date: [October 16, 2017, 7:04am UTC](https://community.mp3tag.de/t/possible-error-in-official-discogs-src-v1-06/19411/3 "2017-10-16T07:04:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 16, 2017, 7:14am UTC](https://community.mp3tag.de/t/possible-error-in-official-discogs-src-v1-06/19411/4 "2017-10-16T07:14:32Z")

</div>

Hi Michael,

> [@michael\_funk](#):
>
> 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)

> [@](#):
>
> 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 🙂 Thanks again!

– Florian

---

<div class="post-metadata">

### Author: ![michael\_funk](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/9de053/32.png) [@michael\_funk](https://community.mp3tag.de/u/michael_funk)
#### Post date: [October 17, 2017, 8:43am UTC](https://community.mp3tag.de/t/possible-error-in-official-discogs-src-v1-06/19411/5 "2017-10-17T08:43:01Z")

</div>

> [@Florian](#):
>
> 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](https://www.discogs.com/Miles-Davis-Live-Around-The-World/release/396240)

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

```
		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 🙂
