I may have missed something but I could not find API methods to add an image to favorites and to get the list of favorites. Could this be implemented in a not too far future?
I may have missed something but I could not find API methods to add an image to favorites and to get the list of favorites. Could this be implemented in a not too far future?
<!-- github-sync-id:342873552 -->
@abrenoch I'm making some changes on your code (indentation, function rename...) and I understand that you have never checked the "fetch another user's favorite photos" because you automatically get a fatal error. Considering you've made the code far more complex just to be able to get another user favorites, I'm confused. Even if I include the appropriate function file to have get_username function, the code doesn't work (I get some photos that are not accessible to the user...)
In my opinion, we should remove the user_id input parameter on pwg.users.getFavorites and simply use check_user_favorites and get_sql_condition_FandF mature functions. Later maybe, when needed we can add the user_id parameter. Allright?
The exact question is : for now, for Piwigo 2.10, do you really need to be able to fetch favorites of any user or getting the current user favorites would be enough?
@abrenoch I'm making some changes on your code (indentation, function rename...) and I understand that you have never checked the "fetch another user's favorite photos" because you automatically get a fatal error. Considering you've made the code far more complex just to be able to get another user favorites, I'm confused. Even if I include the appropriate function file to have `get_username` function, the code doesn't work (I get some photos that are not accessible to the user...)
In my opinion, we should remove the user_id input parameter on pwg.users.getFavorites and simply use `check_user_favorites` and `get_sql_condition_FandF` mature functions. Later maybe, when needed we can add the user_id parameter. Allright?
The exact question is : for now, for Piwigo 2.10, do you really need to be able to fetch favorites of any user or getting the current user favorites would be enough?
<!-- github-comment-id:512244193 -->
@plegall that sounds totally fine... it was a while ago I put this together so I can't even remember my original use-case. The current user's favorites are certainly sufficient.
Thanks for looking into including it!
@plegall that sounds totally fine... it was a while ago I put this together so I can't even remember my original use-case. The current user's favorites are certainly sufficient.
Thanks for looking into including it!
<!-- github-comment-id:512244868 -->
Good, I've made some simplifications :-) and IMHO a better naming for methods. Listed on https://piwigo.org/doc/doku.php?id=dev:changes_in_2.10&#new_methods_for_web_api
<!-- github-comment-id:512264015 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I may have missed something but I could not find API methods to add an image to favorites and to get the list of favorites. Could this be implemented in a not too far future?
#810 will do the adding and removing.
@abrenoch I'm making some changes on your code (indentation, function rename...) and I understand that you have never checked the "fetch another user's favorite photos" because you automatically get a fatal error. Considering you've made the code far more complex just to be able to get another user favorites, I'm confused. Even if I include the appropriate function file to have
get_usernamefunction, the code doesn't work (I get some photos that are not accessible to the user...)In my opinion, we should remove the user_id input parameter on pwg.users.getFavorites and simply use
check_user_favoritesandget_sql_condition_FandFmature functions. Later maybe, when needed we can add the user_id parameter. Allright?The exact question is : for now, for Piwigo 2.10, do you really need to be able to fetch favorites of any user or getting the current user favorites would be enough?
@plegall that sounds totally fine... it was a while ago I put this together so I can't even remember my original use-case. The current user's favorites are certainly sufficient.
Thanks for looking into including it!
Yes, the current user's favorites would already satisfy a large number of users.
Good, I've made some simplifications :-) and IMHO a better naming for methods. Listed on https://piwigo.org/doc/doku.php?id=dev:changes_in_2.10&#new_methods_for_web_api
Excellent, looking forward to the update!