Closed jessie-github closed 5 years ago
It seems that it is because the Community plugin is changing the web API. For instance with the Community plugin deactivate, we can retrieve the Categories list with pwg.categories.getList:
<rsp stat="ok"><categories><category id="287" status="private" nb_images="2" total_nb_images="2" date_last="2018-07-21 21:04:06" max_date_last="2018-07-21 21:04:06" nb_categories="0" url="https://photos.example.com/index.php?/category/287"><name>Piwigoclient test</name><comment/><uppercats>287</uppercats><global_rank>1</global_rank><representative_picture_id>7266</representative_picture_id><tn_url>https://photos.example.com/_data/i/upload/2018/07/21/20180721210400-59d1302f-th.jpg</tn_url></category></categories></rsp>
But with the Community plugin activated, the same method return an empty result:
<rsp stat="ok"><categories><category id="286" nb_images="0" total_nb_images="0" nb_categories="0" url="https://photos.example.com/index.php?/category/286"><name>Community</name><uppercats>286</uppercats><global_rank>2</global_rank><comment/></category></categories></rsp>
So how can we retrieve the Categories list with the plugin activated ?
Relevant issue: https://github.com/Piwigo/Piwigo-Mobile/issues/117
But I also don't get any result either with community.categories.getList
Hi @jessie-github
Here is the way Piwigo iOS does the job:
reflection.getMethodList
to determine whether the Community extension is installed (by detecting the presence of community.session.getStatus
)pwg.session.login
to authenticate the usercommunity.session.getStatus
to determine the real user rights (admin or webmaster).pwg.session.getStatus
to check Piwigo version, get token, available image sizes, upload file types, etc. Set the user rights from this call only when the Community extension is not used.pwg.categories.getList
with parameters cat_id
, recursive
and faked_by_community
. As explained in https://github.com/plegall/Piwigo-community/issues/23 the value of faked_by_community
must be "false" if the Community extension is installed and "true" otherwise.community.categories.getList
to identify albums having upload rightsThe actions proposed to the user will then depend on his/her rights: [admin], [upload rights on specific albums] or [none].
Cheers
Solved in the current release of Android piwigoclient.
Hello, It seems that a recent changes is making the plugin incompatible with the Android app Piwigoclient. It is not possible to display albums anymore in Piwigoclient. If I deactivate the Community plugin, everything is working.
I've contacted the Piwigoclient author and here is his answer:
Do you know what I can do to help the Piwigoclient author to make it compatible with the Community plugin ?