API createAlbum bug?

ruttrutt Registered Users Posts: 6,511 Major grins
I think createAlbum is it's final (struct) argument. Either that or python isn't properly handling struct arguments to xml-rpc calls. The latter seems unlikely as python is more widely used than the smugmug API.

You can reproduce this bug by picking up a fresh version of my smugmug.py script. Be sure it's at least version 1.4 (look near the top of the script.) Try:
smugmug.py create XXYY --no-public --show-filenames
The created album is public and doesn't show filenamess.

The problem is not limited to booleans. Try:
smugmug.py create XXYY --category=X --subcategory=Y
XXYY is created with category X but no subcategory.
If not now, when?

Comments

  • onethumbonethumb Administrators Posts: 1,269 Major grins
    edited November 21, 2004
    rutt wrote:
    I think createAlbum is it's final (struct) argument. Either that or python isn't properly handling struct arguments to xml-rpc calls. The latter seems unlikely as python is more widely used than the smugmug API.

    You can reproduce this bug by picking up a fresh version of my smugmug.py script. Be sure it's at least version 1.4 (look near the top of the script.) Try:
    smugmug.py create XXYY --no-public --show-filenames
    The created album is public and doesn't show filenamess.

    The problem is not limited to booleans. Try:
    smugmug.py create XXYY --category=X --subcategory=Y
    XXYY is created with category X but no subcategory.

    I'll definitely take a look, but bear in mind that there are applications using createAlbum right now -- and they work.

    fxFoto, for example, supports it and it's working.

    When I get a minute, I'll see what's going wrong. Probably something not clear in the docs, but we'll see.

    Don
  • ruttrutt Registered Users Posts: 6,511 Major grins
    edited November 21, 2004
    onethumb wrote:
    I'll definitely take a look, but bear in mind that there are applications using createAlbum right now -- and they work.

    fxFoto, for example, supports it and it's working.

    When I get a minute, I'll see what's going wrong. Probably something not clear in the docs, but we'll see.

    Don
    Any applications with public source that I can take a look at?

    Anyway, I dug around in python's xmlrpc library enough to capture the xml that it sends for method calls. I did find a bug in my code, specfically with --no-public. I fixed that, so you may need to pick up a new copy of smugmug.py. But even with this bug fixed, these parameters are still ignored.

    I captured the XML sent for:
    create --no-public --no-show_filenames --category=Sports --subcategory="XC Skiiing"
    Here it is. Can you see a problem with this? Should boolean's be 1 or 0 or something else? That's the only potential issue I can see.
    <methodcall>
    </methodcall>
    If not now, when?
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited November 21, 2004
    I second this
    I just created my very first album (I mean, automatically created:-), and it seems that IsPublic and ShowFileNames are swapped.

    Here's a piece of my XML request:
    [PHP]<struct>
    <member>
    <name>Description</name>
    <value>First auto album</value>
    </member>
    <member>
    <name>Keywords</name>
    <value>rpc,xml,delphi,api</value>
    </member>
    <member>
    <name>Password</name>
    <value></value>
    </member>
    <member>
    <name>IsPublic</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>ShowFilenames</name>
    <value><boolean>1</boolean></value>
    </member>[/PHP]


    As it's easy to see, I requested NO public, and SHOW filenames, but the resulted album has been created as public and without filenames.
    "May the f/stop be with you!"
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited November 21, 2004
    Changed the values - no results
    I swapped the values mentioned above, however another gallery was created with identical settings. Guys, I have to admit - This is a BUG!deal.gif
    "May the f/stop be with you!"
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited November 25, 2004
    Just a bit more on the same subject
    I just created a a test gallery with all FALSE options.
    Here's what I got:
    11842692-L.jpg

    Here's the request I used:
    [PHP]
    <?xml version="1.0"?>
    <methodCall>
    <methodName>createAlbum</methodName>
    <params>
    <param><value> *** SESSION ID HERE *** </value></param>
    <param><value>Test</value></param>
    <param><value><int>0</int></value></param>
    <struct>
    <member>
    <name>Description</name>
    <value>Description</value>
    </member>
    <member>
    <name>Keywords</name>
    <value>Keywords</value>
    </member>
    <member>
    <name>Password</name>
    <value></value>
    </member>
    <member>
    <name>IsPublic</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>ShowFilenames</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>AllowComments</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>AllowExternalLinks</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>ShowCameraInfo</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>AllowEasySharing</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>AllowPrintOrdering</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>AllowOriginals</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>CommunityAppearance</name>
    <value><boolean>0</boolean></value>
    </member>
    </struct>
    </params>
    </methodCall>
    [/PHP]

    As it's easy to see, we have "a few" problems:
    1) almost none none of the boolean options was set correctly - I mean, some were, but I remember they are simply OFF by default
    2) number of API call parameters is smaller than the actual set of gallery settings, some important settings ("showLarge" and "clean", for instance) are not available.

    Happy thanksgiving!
    "May the f/stop be with you!"
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited November 25, 2004
    Forgot to mention:-)
    The snapshot image of the gallery settings was uploaded to smugmug by my new app:-) within the same session I used to create the test galleryclap.gif
    Cheers!
    "May the f/stop be with you!"
Sign In or Register to comment.