gettree&Heavy=1... external attribute?

ebswiftebswift Registered Users Posts: 94 Big grins
Hi, the gettree?heavy=1 call needs the attribute stating whether the image can be externally linked. Currently you can filter results to an external web page via public/passworded, but your page displays everything else, including albums which are not external which results in lots of broken images everywhere.

It needs to happen at gettree - putting it anywhere else would create the need to patch album data together from multiple calls.

My app is a facebook application which means you have seven seconds before facebook will time you out. As it is, seven seconds is not quite enough time to assemble all the information together because you need to make multiple REST calls and latency is a killer. On that note are there any pointers for speeding up calls to SmugMug?

Try Smugfoto in Facebook for displaying your SmugMug galleries.

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 16, 2008
    Using &Heavy=1 is probably a bad idea if you are going for speed. Better option would be to use api 1.2.2, which allows you to customise what you want returned, like below....

    api.smugmug.com/services/api/rest/1.2.2/?method=smugmug.users.getTree&Extras=Passworded,External,Public

    The combination of the Passworded and External parameters will determine if Facebook is able to load the images.

    API 1.2.2 also has a number of speed optimisations over other api versions.

    In regard to general speed improvement, I'd really need to see all the method calls you are making.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 16, 2008
    Thanks David, I've thinned out my getTree response using Extras as you suggested. It looks like 'External' is what I need to identify anything that's not allowed to be linked externally, but the 'External' parameter is not returning any 'External' attributes. My test call is as follows:

    http://api.smugmug.com/services/api/rest/1.2.2/?APIKey=mykey&SessionID=currentsession&method=smugmug.users.getTree&NickName=dgrin&Extras=External

    Is it a bug that External is missing, or am I mis-naming the attribute? Thankyou.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 17, 2008
    ebswift wrote:
    Thanks David, I've thinned out my getTree response using Extras as you suggested. It looks like 'External' is what I need to identify anything that's not allowed to be linked externally, but the 'External' parameter is not returning any 'External' attributes. My test call is as follows:

    http://api.smugmug.com/services/api/rest/1.2.2/?APIKey=mykey&SessionID=currentsession&method=smugmug.users.getTree&NickName=dgrin&Extras=External

    Is it a bug that External is missing, or am I mis-naming the attribute? Thankyou.
    As for the performance I don't think it's possible to optimise any further. When you think about displaying galleries using the same hierarchical fashion as the SmugMug site you need to know a lot in advance so that you don't have the first page filled up with empty image placeholders due to being non-public, empty albums, non-external etc - and all that logic must also be applied all the way down to albums of sub-categories so the top-level category "knows" whether it should display or not. I am going to attempt an AJAX solution if my web host support ever bothers to reply to me - they advertise that they fully support AJAX but it doesn't work.

    The actual solution to display hierarchical galleries goes far beyond the REST calls, information must be cached then re-retrieved using logic to make it efficient for drilling down.

    I'm keen on getting the 'External' attribute, I'm starting to get a number of complaints and uninstalls now. It's the final piece of the puzzle.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 17, 2008
    External is currently only returned for the owner. This means that if a session was created with smugmug.login.withPassword (or smugmug.login.withHash), then smugmug.users.getTree is called without the NickName parameter (or with it set to their own NickName) the External would be returned. However, if the session was created using smugmug.login.anonymously (or if the NickName parameter referencing a different account was used with a valid non-anonymous session), it won't be returned.

    Does that make sense ?
    David Parry
    SmugMug API Developer
    My Photos
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 17, 2008
    devbobo wrote:
    External is currently only returned for the owner. This means that if a session was created with smugmug.login.withPassword (or smugmug.login.withHash), then smugmug.users.getTree is called without the NickName parameter (or with it set to their own NickName) the External would be returned. However, if the session was created using smugmug.login.anonymously (or if the NickName parameter referencing a different account was used with a valid non-anonymous session), it won't be returned.

    Does that make sense ?
    It makes sense, but does External really need to be passworded? In the context of SmugFoto, it shows on a person's profile, and any friend can click on it and view their photo gallery. The interaction is anonymous. Therefore, for people who have lots of albums with External set to 0, the visitor sees a lot of categories and albums full of broken images. The only other way would be for me to record the username & password of SmugMug users just for retrieving the External parameter, and that would be bad practice.

    Can we have External as a public attribute?

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 17, 2008
    A good example, is if you install SmugFoto on facebook and set your SmugMug username to be 'dgrin' which is the gallery for this site. It is a broken mess with all the non-external albums.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 17, 2008
    ebswift wrote:
    A good example, is if you install SmugFoto on facebook and set your SmugMug username to be 'dgrin' which is the gallery for this site. It is a broken mess with all the non-external albums.

    i'm trying ne_nau.gif

    374798240_NSG8U-L.png
    David Parry
    SmugMug API Developer
    My Photos
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 18, 2008
    devbobo wrote:
    i'm trying ne_nau.gif
    Well I really need to ajaxify that application to try to reduce all the latency going back & forth to the SmugMug server on an initial loadup. If you press Try Again it should work after a few goes. I've attached a screenshot of the broken page showing the dgrin galleries; regardless of whether you can reproduce it, the fact remains that without a public External attribute it is impossible to create a gallery view on an external site without either having it all broken, or capturing SmugMug passwords.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 18, 2008
    I've upped the performance a bit now so it has a better chance of working (it appears to be much better now). I have also place a message on the application notifying users of the broken image problem so that should hopefully prevent too many uninstalls.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 19, 2008
    It really would be nice to get a response to this. I have 1200+ users of the app, with 10+ users per day signing up, with thousands more visiting, and apparently this is the last SmugMug app working on facebook; it would be good to be able to deliver some good news. It's taken a total of around ten-to-twelve weeks of coding to get it this far in a voluntary effort...by me... Surely there is something that we can do? I love SmugMug and this is an effort to help other SmugMug users.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 19, 2008
    The other thing you can't derive using 'Extras' is the Highlight Id. HighlightId and HighlightKey need to be moved to an attribute of Album, or returned in an Extras call.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 19, 2008
    ebswift wrote:
    The other thing you can't derive using 'Extras' is the Highlight Id. HighlightId and HighlightKey need to be moved to an attribute of Album, or returned in an Extras call.

    It should be HighlightID, as per the smugmug.album.create/changeSettings thumb.gif
    David Parry
    SmugMug API Developer
    My Photos
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 20, 2008
    I got the case wrong when I replied last, so edit: Thanks David. All I need now is the External attribute :).

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 20, 2008
    ebswift wrote:
    I got the case wrong when I replied last, so edit: Thanks David. All I need now is the External attribute :).

    External should be available now thumb.gif
    David Parry
    SmugMug API Developer
    My Photos
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 20, 2008
    WOW, You Rock!

    Thankyou so much :). Give me about 10 minutes and SmugFoto should start to look much nicer. bowdown.gif

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
  • ebswiftebswift Registered Users Posts: 94 Big grins
    edited September 21, 2008
    Now that I seem to have resolved all of the performance issues, it should work as expected now. If you get a chance, give it a whirl and let me know any thoughts.

    Try Smugfoto in Facebook for displaying your SmugMug galleries.
Sign In or Register to comment.