Announcement

  •  » Engine
  •  » pwg.categories.delete returns OK even with wrong category id

#1 2017-11-08 00:09:08

esppat
Member
2017-09-05
3

pwg.categories.delete returns OK even with wrong category id

Dear All,

Quite new to Piwigo (user since a year), and writing a small set of Python 3.5 scripts to automate my picture collection upload (+20K), I found that API function pwg.categories.delete does return positive answer even if the given category ID does not exist:

{'stat': 'ok', 'result': None}

This is not a big deal (except for error checking and tests), but I wonder if I am wrong somewhere (I am able to make calls to other API)?

Thanks a lot for this nice product!
Patrice E.

Piwigo version: 2.9.2

Offline

 

#2 2017-11-08 11:20:41

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13082

Re: pwg.categories.delete returns OK even with wrong category id

Hi esppat,

This behavior from Piwigo is perfectly normal (or at least "expected"). Imagine you pwg.categories.delete on several categories, what if only one of these categories does not exist? Would like to have an error code returned, while Piwigo has deleted the other relevant categories? Or imagine you have concurrentpwg.categories.delete calls on the same category id, you don't really care which call won the race, you just want your category to be deleted.

I hope you'll publish your scripts on Github (or somewhere else), so that we can have some examples in Python using Piwigo API :-) (we already have PHP, Java, Perl, ObjectiveC for iOS)


Latest blog post (March 23th 2017) Piwigo.com Enterprise plans, now official!

Offline

 

#3 2017-11-08 20:43:09

esppat
Member
2017-09-05
3

Re: pwg.categories.delete returns OK even with wrong category id

OK, thanks for the explanation. I do not agree, as testing this kind of behavior is not possible, but that's not a big deal, as I said in my previous message.

Concerning sharing Python scripts, for sure I will send you some excerpt of my code, if this can help.

Once again, thanks for this beautiful product, it's amazing!

Patrice E.

Offline

 
  •  » Engine
  •  » pwg.categories.delete returns OK even with wrong category id

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2017 · Contact