1708 Scripting: ISDBSongData::Year returns 0 for empty Date

This forum is for reporting bugs in MediaMonkey for Windows 4. Note that version 4 is no longer actively maintained as it has been replaced by version 5.

Moderator: Gurus

chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

1708 Scripting: ISDBSongData::Year returns 0 for empty Date

Post by chrisjj »

(Please do not move this MediaMonkey for Windows ‹ Bug Reports (mmw) http://www.mediamonkey.com/forum/viewto ... =7&t=77709 )

Scripting ISDBSongData::Year
http://www.mediamonkey.com/wiki/index.p ... Data::Year
misreports empty Date as Year 0 rather than empty Year as expected e.g.
http://i.imgur.com/mjVz9oC.png

Workaround:

Code: Select all

		Dim fixedyear
		fixedyear = "":IF itm.Year <> 0 THEN fixedyear = itm.Year
    fout.WriteLine itm.path &vbTAB& itm.TrackOrderStr &vbTAB& itm.DiscNumberStr &vbTAB&  itm.Title &vbTAB& itm.ArtistName _
      &vbTAB& itm.AlbumName &vbTAB& itm.AlbumArtistName &vbTAB& itm.Genre &vbTAB& fixedyear &vbTAB& itm.Rating &vbTAB& itm.Custom1 &vbTAB& itm.Publisher
Suggested fix: In the documentation http://www.mediamonkey.com/wiki/index.p ... Data::Year define 0 as the representation for empty.

Note: In the UI track list Date field, entering 0 causes the field to display as empty.
Chris
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: 1708 Scripting

Post by trixmoto »

This is not a bug, the field is defined in the API as a numeric and therefore 0 is perfectly acceptable.

I also disagree with where you have placed this post, but I don't want to start a flame war by daring to move it. Generally speaking we keep issues with the API in the developers forum, not in the bug reports forum.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Re: 1708 Scripting

Post by chrisjj »

trixmoto wrote:the field is defined in the API as a numeric and therefore 0 is perfectly acceptable.
Why do you think it is acceptable to define the field as a numeric? Numeric is unable to represent the empty state that's seen on the UI.
trixmoto wrote:I also disagree with where you have placed this post
I'm surprised, since this is the forum for bug reports in MM Windows.
trixmoto wrote:Generally speaking we keep issues with the API in the developers forum
Meaning:

Addons developer forum
This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

??
Chris
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: 1708 Scripting: ISDBSongData::Year returns 0 for empty D

Post by trixmoto »

Why is it not acceptable? If that's the way it's defined in the API, then it's not a bug. If you want it to be defined differently, then that's a feature request. And one that has the potential to mess up a lot of scripts, for no benefit that I can see.

It's not a bug that a user would see, it's only a bug that an addon developer would see, so there's no point cluttering up the forum that users use for reporting bugs.

Yes, I mean that one. As that's the only one, I'd have thought it wouldn't need clarification.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Re: 1708 Scripting: ISDBSongData::Year returns 0 for empty D

Post by chrisjj »

trixmoto wrote:Why is it not acceptable?
As I said: "Numeric is unable to represent the empty state that's seen on the UI."
trixmoto wrote:If that's the way it's defined in the API, then it's not a bug.
Interesting theory. By that token, anything defined in the API is not a bug in the API. And anything defined in the code is not a bug in the code. Which more or less means nothing can be defined as a program bug.
trixmoto wrote:It's not a bug that a user would see, it's only a bug that an addon developer would see
Well, this user saw this bug - and while developing the script, he didn't.
trixmoto wrote:, so there's no point cluttering up the forum that users use for reporting bugs.
This is the forum for reporting bugs in MediaMonkey. See "How to report a bug" http://www.mediamonkey.com/forum/viewtopic.php?f=7&t=69 .
Chris
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Re: 1708 Scripting: ISDBSongData::Year returns 0 for empty D

Post by trixmoto »

It's not a bug, it's how it was designed to work. A bug is behaviour that was not expected, or not by design. And numeric is able to represent empty, it represents it using 0, as you've seen. This works perfectly well, in fact it makes scripting much simpler, which is probably why they did it.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
chrisjj
Posts: 5007
Joined: Wed Feb 14, 2007 5:14 pm
Location: UK

Re: 1708 Scripting: ISDBSongData::Year returns 0 for empty D

Post by chrisjj »

trixmoto wrote:A bug is behaviour that was not expected
Fine. I didn't expect expect empty year to be returned as 0, so I've reported this bug.
trixmoto wrote:And numeric is able to represent empty, it represents it using 0
Then you might want to report the bug in Rating, where 0 returns 0 and empty returns -1.

I won't, because this is expected, because it is defined behaviour according to the docs.

If the empty Year effect was defined behaviour according to the docs, I wouldn't report it as a bug.
Chris
Post Reply