2 Properties with the same name on Album?

MaRiMaRi Registered Users Posts: 21 Big grins
I've noticed that Album has two properties with the same name Comments
- one is a bool
- the other is a list of objects of type Comment

{
"stat": "ok",
"method": "smugmug.albums.getInfo",
"Album": {
"id": 1234,
...
"ColorCorrection": 0,
"Comments": true,
"Description": "Photos
"EXIF": true,
...
}

{ "stat": "ok", "method": "smugmug.albums.comments.get", "Album": { "id": 1234, "Key": "xCXXu", "Comments": [ { "id": 1234, "Date": "2007-09-11 00:46:21", "Rating": 5, "Text": "Great photos, looks like a fun party", "Type": "SmugMug", "User": { "Name": "Fred Nerk", "URL": "http://fred.smugmug.com" } } ] }}

Is this a feature? And is it going to remain like that?

Comments

  • MaRiMaRi Registered Users Posts: 21 Big grins
    edited January 4, 2011
    *Bump*
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited January 5, 2011
    I wouldn't really call it the same properties on album since they are in totally different calls.

    In a future version of the api, I'm considering changing the response format to...

    {
    "stat": "ok",
    "method": "smugmug.albums.comments.get",
    "Album": { "id": 1234, "Key": "xCXXu"},
    "Comments": [ { "id": 1234, "Date": "2007-09-11 00:46:21", "Rating": 5, "Text": "Great photos, looks like a fun party", "Type": "SmugMug", "User": { "Name": "Fred Nerk", "URL": "http://fred.smugmug.com" } } ]
    }
    David Parry
    SmugMug API Developer
    My Photos
  • MaRiMaRi Registered Users Posts: 21 Big grins
    edited January 7, 2011
    That is great news!
    In my case, they are two properties on the class Album. I have no other way of mapping the responses from smugmug.albums.getInfo and smugmug.albums.comments.get to the Album class except for using a property on Album called Comments and making it a bool for the first case and a Comment object in the second case. And this making it a bool or an instance of the Comment class depending on the circumstances, is a convoluted and prone to bugs way. So I would be very interested in the update you’re thinking of doing. That would most certainly solve the problem!
    Thanks!
Sign In or Register to comment.