Running on a Ruby on Rails backend, I have a JSON API that serves an array of objects with the following structure:
{
"title_slug": "16-gaijin-games-bittrip-beat-linux-tar-gz",
"platform": "Linux",
"format": ".tar.gz",
"title": "BIT.TRIP BEAT",
"bundle": "Humble Bundle for Android 3",
"unique_games": 9
},
{
"title_slug": "17-gaijin-games-bittrip-beat-linux-deb",
"platform": "Linux",
"format": ".deb",
"title": "BIT.TRIP BEAT",
"bundle": "Humble Bundle for Android 3",
"unique_games": 9
},
The challenge lies in counting only unique titles, as there are different types of downloads for each title within the object array. My initial idea of implementing this in the Ruby on Rails model failed because it required processing the entire array.
Considering I use AngularJS on the frontend and have to update the number of unique titles displayed on a table, I believe filtering should be done in the controller.
To provide more context, here's a screenshot of the page where these functionalities will be integrated: https://i.sstatic.net/DFx3L.png
Thank you,
Thomas Le
P.S. This project is not meant for public access; it's a database site housing information from bundles purchased from IndieGala and HumbleBundle. The functional enhancements are geared towards making the open-source project on GitHub more accessible for personal use.
If you're wondering about the presence of Humble Bundle data in the image shared, now you know why!