Minor API changes

onethumbonethumb Administrators Posts: 1,269 Major grins
You'll see updated docs tomorrow, but I thought I'd let the hardcore know in advance:

- smugmug.images.getInfo now also includes the proper URLs, saving you a call if you were doing both that and getURLs

- smugmug.albums.changeSettings should work again.

- smugmug.images.upload 's bug was fixed.

I think that's probably it. The new album setting ('DefaultColor') also works, and will be reflected in the new docs.

Don

Comments

  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited April 15, 2005
    Thank you!
    onethumb wrote:
    You'll see updated docs tomorrow, but I thought I'd let the hardcore know in advance:

    - smugmug.images.getInfo now also includes the proper URLs, saving you a call if you were doing both that and getURLs

    - smugmug.albums.changeSettings should work again.

    - smugmug.images.upload 's bug was fixed.

    I think that's probably it. The new album setting ('DefaultColor') also works, and will be reflected in the new docs.

    Don
    Don,
    Thank you for the fixes, hopefully we'll be able to get your feedback on them soon!
    And I *realy* appreciate this "what's new"!thumb.gif
    Please keep doing that!
    Now with APi becoming more extensive and complex going through all the help pages and compare line to line is no fun at all..

    Cheers!1drink.gif
    "May the f/stop be with you!"
  • jefjef Registered Users Posts: 42 Big grins
    edited April 16, 2005
    Are you saying these changes are installed now, with the docs to follow tomorrow? Cause I just tried smugmug.albums.changeSettings and it looks like it is still returning null results.
  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited April 17, 2005
    jef wrote:
    Are you saying these changes are installed now, with the docs to follow tomorrow? Cause I just tried smugmug.albums.changeSettings and it looks like it is still returning null results.

    REST or XML-RPC? REST looks like it's working for me, and since they share a common codebase, I assume XML-RPC is working too. I can double-check later, though.

    Don
  • jefjef Registered Users Posts: 42 Big grins
    edited April 18, 2005
    I'm still only using XML-RPC. I just tried it again and now it gives an actual response - fault code 5, system error.
  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited April 18, 2005
    jef wrote:
    I'm still only using XML-RPC. I just tried it again and now it gives an actual response - fault code 5, system error.

    Alright, well, I'm at a loss since I'm able to change my settings just fine.

    Can you please post your XML-RPC request so I can take a look? I must be missing some corner-case.

    Don
  • jefjef Registered Users Posts: 42 Big grins
    edited April 19, 2005
    Ok, I'll attempt to post the XML request as a text attachment. No idea if this will work right.

    The only slightly unusual thing is that I use CDATA for the session ID string - my XML-RPC tool uses CDATA for all string values. But the same is true for all my other requests, and they all work fine.
  • jefjef Registered Users Posts: 42 Big grins
    edited April 26, 2005
    No ideas about this? It's still doing the same thing, system error 5.
  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited April 30, 2005
    jef wrote:
    No ideas about this? It's still doing the same thing, system error 5.

    Spent some time playing with your XML, and it seems to work for me.

    Then I got the brilliant idea of actually checking your album in question, and discovered that it already has those three settings.

    Setting an albums' settings to the exact same settings will fail with a system error 5.

    Can you try setting a property which is different, instead?

    Can anyone else verify that changing album settings is still broken? Every test I've tried for a few weeks has worked, so I'm still lost.

    Don
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited April 30, 2005
    Don,
    onethumb wrote:
    Can anyone else verify that changing album settings is still broken? Every test I've tried for a few weeks has worked, so I'm still lost.

    Don
    I'll give it a try. I'm not sure if I'll be the first one to report since I'm leaving for my El Camino Real - Yosemite trip soon. Hopefully other guys will be faster..
    "May the f/stop be with you!"
  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited April 30, 2005
    onethumb wrote:
    Spent some time playing with your XML, and it seems to work for me.

    Then I got the brilliant idea of actually checking your album in question, and discovered that it already has those three settings.

    Setting an albums' settings to the exact same settings will fail with a system error 5.

    Can you try setting a property which is different, instead?

    Can anyone else verify that changing album settings is still broken? Every test I've tried for a few weeks has worked, so I'm still lost.

    Don

    Oh, I doubt this is your problem, but I should note that for some reason, your a.txt file has "xml.version" instead of "xml version" which caused the parser to choke.

    Once I changed that period, though, I haven't gotten any system errors with that XML or similar XML.

    Don
  • jefjef Registered Users Posts: 42 Big grins
    edited May 1, 2005
    onethumb wrote:
    Oh, I doubt this is your problem, but I should note that for some reason, your a.txt file has "xml.version" instead of "xml version" which caused the parser to choke.

    Oh, sorry, that was because I re-created the XML input from a tcpdump trace file, and in that file all the non-printable characters are shown as periods. This includes space. So I guess I missed converting that one back to a space.

    Anyway, your explanation that changing settings to what they already are causes the error makes sense, I'm sure that's what was happening.

    What do you think about not generating an error for that case?
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited May 1, 2005
    changeSettings questions
    onethumb wrote:
    Can anyone else verify that changing album settings is still broken? Every test I've tried for a few weeks has worked, so I'm still lost.

    Don
    Don, I had a couple hours to burn last night so I decided to look at that method again. And now that I was paying an attention to details I have noticed two things which kinda stopped me from going any further:
    1. There is no CategoryID in the struct.
      This means that while you can use this method to move the album to a different SubCategory, you cannot change the Category, so API-wise albums are stuck within the original categories. I was hoping for this method to do the job, but it does not look so.
      Am I wrong, and CategoryID simply didn't make it to the manual?
    2. Judging from the presence of Default values I'm guessing that if I skip an option it will be set to default, not "left as is". That immediately means that if I'm to try to change settings of several albums at a time (in which action many SM users expressed a keen interest) I would have to read each album' settings first, update the "changed" settings, and post the whole set back (otherwise the "unset" options would be reset to default values).
      Which increases the total time approximately twice.:-(
      Am I correct?
    Please confirm or correct.
    "May the f/stop be with you!"
  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited May 1, 2005
    jef wrote:
    Oh, sorry, that was because I re-created the XML input from a tcpdump trace file, and in that file all the non-printable characters are shown as periods. This includes space. So I guess I missed converting that one back to a space.

    Anyway, your explanation that changing settings to what they already are causes the error makes sense, I'm sure that's what was happening.

    What do you think about not generating an error for that case?

    I'll have to give it some thought, but it's really not that easy to "not generate" an error since multiple writers could be writing to the same album at nearly the same time and I could just be missing something temporally. I suppose "close enough" could be good enough, but I'll have to think about it.

    Don
  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited May 1, 2005
    Nikolai wrote:
    Don, I had a couple hours to burn last night so I decided to look at that method again. And now that I was paying an attention to details I have noticed two things which kinda stopped me from going any further:
    1. There is no CategoryID in the struct.
      This means that while you can use this method to move the album to a different SubCategory, you cannot change the Category, so API-wise albums are stuck within the original categories. I was hoping for this method to do the job, but it does not look so.
      Am I wrong, and CategoryID simply didn't make it to the manual?
    2. Judging from the presence of Default values I'm guessing that if I skip an option it will be set to default, not "left as is". That immediately means that if I'm to try to change settings of several albums at a time (in which action many SM users expressed a keen interest) I would have to read each album' settings first, update the "changed" settings, and post the whole set back (otherwise the "unset" options would be reset to default values).
      Which increases the total time approximately twice.:-(
      Am I correct?
    Please confirm or correct.

    Any setting you get back, except for AlbumID, can be set, including CategoryID. If the docs don't have that, it's a doc problem, not a problem with the method. You tried this and it failed?

    You're wrong. Any setting you don't set will be left as-is, meaning the Default for newly created albums, and whatever is currently set on a changeSettings call.

    Were you able to use the method, then? Can I stop tearing my hair out because everything I do works? :)

    As a general note, you should never be afraid to try something in the API to see if it works. If something breaks, we've found a bug. If something works, we can clarify the docs. But not trying it just tends to waste time. :)

    Don
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited May 1, 2005
    Thank you for the answer!
    I will give it another try..
    onethumb wrote:
    Any setting you get back, except for AlbumID, can be set, including CategoryID.
    And how was I supposed to know this without the docs, may I ask you?ne_nau.gif
    onethumb wrote:
    If the docs don't have that, it's a doc problem, not a problem with the method.
    Again, who wrote the docs? Album settings APIs are hands down the most complicated API you've published so far, and giving the considerable history of it's being in non-working state I hope you'd understand my being cautios..rolleyes1.gif
    onethumb wrote:
    You tried this and it failed?
    Don, please.. I did waste more than a fair value of *my* time burning fingers on the new APIs since January.. This one requires a lot of associated UI work, hence I simply want to be sure it's worth it. I trust you got it working for you, and I'm extremely glad to hear this, but with the incomplete docs and the whole "highly experimental nature" aspect, what do you expect me to do, dive in head first?
    *You've* asked for assistance in testing/confirming, I'm trying to help, so please level with me..
    onethumb wrote:
    You're wrong. Any setting you don't set will be left as-is, meaning the Default for newly created albums, and whatever is currently set on a changeSettings call.
    Boy, am I glad to hear this:-)! thumb.gif
    onethumb wrote:
    Were you able to use the method, then? Can I stop tearing my hair out because everything I do works? :)
    Not yet. Now that you have confirmed it should work as I hoped it would I will proceed..
    onethumb wrote:
    As a general note, you should never be afraid to try something in the API to see if it works. If something breaks, we've found a bug. If something works, we can clarify the docs. But not trying it just tends to waste time. :)
    As a general note, I have a deep respect for you and your work.

    And being around various computers for 28 years I'm not afraid to try virtually anything.

    But speaking of time-wasting I've wasted too much of mine (because it was said something works while it didn't) to advance without at least getting some solid recon.

    Things are getting much better now in the API department, but it's still a lot of efforts on our side.

    Up-to-date docs would also help to avoid the confusions, misunderstandings and frustration.

    I will let you know my results.

    Cheers!1drink.gif
    "May the f/stop be with you!"
  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited May 1, 2005
    Nickolai wrote:
    Judging from the presence of Default values I'm guessing that if I skip an option it will be set to default, not "left as is". That immediately means that if I'm to try to change settings of several albums at a time (in which action many SM users expressed a keen interest) I would have to read each album' settings first, update the "changed" settings, and post the whole set back (otherwise the "unset" options would be reset to default values).
    Which increases the total time approximately twice.:-(
    Am I correct?

    From the docs: "All settings are optional, if omitted, the current value for that setting is preserved." Been there since this method was exposed.

    Don
  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited May 1, 2005
    Nikolai wrote:
    And how was I supposed to know this without the docs, may I ask you?
    Nikolai wrote:
    Don, I had a couple hours to burn last night so I decided to look at that method again.

    It doesn't take a couple of hours to submit a CategoryID change and see what happens.

    Don
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited May 1, 2005
    OK, this one you double-confirmed
    onethumb wrote:
    From the docs: "All settings are optional, if omitted, the current value for that setting is preserved." Been there since this method was exposed.

    Don
    Let me ask you - is CategoryID mentioned there, too? Or was I again asking a silly question?
    So how shall I know which part of the doc to trust and which not?
    "May the f/stop be with you!"
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited May 1, 2005
    You're absolutely correct
    onethumb wrote:
    It doesn't take a couple of hours to submit a CategoryID change and see what happens.
    Don
    I spent 15 minutes. I decided it's too much of uncertainty and decided to ask first. I spent other 1:45:00 downloading, installing and playing with CS2.

    And I'd like to remind you of this (*still* being the operative word):
    onethumb wrote:
    Can anyone else verify that changing album settings is still broken?
    Don
    Just trying to help.. I'm known to be a slow starter. As I said in the very first reply to this post of yours, I hope you'll get quicker answer from somebody else..
    If it does not fit the help profile you need - sorry...

    Cheers!1drink.gif
    "May the f/stop be with you!"
  • jefjef Registered Users Posts: 42 Big grins
    edited May 2, 2005
    onethumb wrote:
    I'll have to give it some thought, but it's really not that easy to "not generate" an error since multiple writers could be writing to the same album at nearly the same time and I could just be missing something temporally. I suppose "close enough" could be good enough, but I'll have to think about it.

    Sounds like you're overthinking it.

    Here's a little thought experiment. The API doc for smugmug.albums.changeSettings says, regarding the struct of things to change, "optional, any or none of these can be present". If the struct is empty or not there, what happens? Does it generate a system error 5 every time? According to your earlier post, it should, since the call is changing the album's settings to what they already were. And yet the doc says such a call is ok.
Sign In or Register to comment.