API createAlbum bug?
rutt
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:
The problem is not limited to booleans. Try:
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?
0
Comments
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
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:
<methodcall>
</methodcall>
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.
I swapped the values mentioned above, however another gallery was created with identical settings. Guys, I have to admit - This is a BUG!
I just created a a test gallery with all FALSE options.
Here's what I got:
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!
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 gallery
Cheers!