solved Bridge and group_by option

amartins
@amartins
8 years ago
48 posts
Hello.
I am trying to get a list of available music genres from Jamroom framework with Bridge connection to audio module, the column I am targeting is audio_genre, as so the request URL is like: http://my.cool.jamroom.dom/api/bridge/audio/search?group_by=audio_genre.
Since there is only 3 distinct genres it should return me 3 '_elements', one for each genre. But that's not happening it returns same result as if 'group_by=audio_genre' wasn't there: any idea why?
Thanks for attention.
updated by @amartins: 09/20/16 04:43:43AM
brian
@brian
8 years ago
10,139 posts
Yeah I think that should work - I will check it out.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
Hi Brian, I think I found the issue, I now can have the group_by working, please check if this is what's missing:
On jrProximaBridge > include.php I added, inside function
jrProximaBridge_search_items($module, $_data)
, right before line
$_rt = jrCore_db_search_items($module, $_sc);
, the next lines of code
if(isset($_data['group_by'])){
        $_sc["group_by"] = $_data['group_by'];
    }

Let me know if this is it.
Thanks.
updated by @amartins: 06/15/16 02:38:01PM
brian
@brian
8 years ago
10,139 posts
Sorry - should have updated this that I pushed a new version of the Bridge module a couple days ago - you should be able to use group_by and order_by now - i.e.

&group_by=audio_genre&order_by=audio_genre&order_dir=asc
Let me know if that works for you.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
No problem. I also noticed order_by had the same issue.
Now it is working good!
Thanks
brian
@brian
8 years ago
10,139 posts
amartins:
No problem. I also noticed order_by had the same issue.
Now it is working good!
Thanks

Glad to hear that - thanks :)


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags