views_api: Fix sort order when sorting by review 'score' value
Here, we sort the reviews by submission date (most recent review
first) before sorting them by score
, so the results would not be in
random date order, when the score
values are same for the reviews.
Fixes #25
Below are the fetch
response for GNOME Boxes
before and after fix (limit=30
reviews)
Columns in results:
- Review creation datetime (epoch seconds)
- Review creation datetime (string format)
- Review score
- Review summary
Before fix :
[1708348079.0] - [Mon 19 Feb 13:07:59 GMT 2024] - [33] - [ "Solved the freezing problem" ]
[1704145744.0] - [Mon 1 Jan 21:49:04 GMT 2024] - [24] - [ "Not good" ]
[1704207445.0] - [Tue 2 Jan 14:57:25 GMT 2024] - [24] - [ "Steam Deck User" ]
[1704921262.0] - [Wed 10 Jan 21:14:22 GMT 2024] - [24] - [ "It still being near to useless" ]
[1703617406.0] - [Tue 26 Dec 19:03:26 GMT 2023] - [24] - [ "segfault when loading iso on 22.04 LTS" ]
[1703638401.0] - [Wed 27 Dec 00:53:21 GMT 2023] - [24] - [ "Works but with lots of compromises" ]
[1704741082.0] - [Mon 8 Jan 19:11:22 GMT 2024] - [24] - [ "Works great in --user space" ]
[1704891417.0] - [Wed 10 Jan 12:56:57 GMT 2024] - [24] - [ "Oops something went wrong!" ]
[1703513011.0] - [Mon 25 Dec 14:03:31 GMT 2023] - [10] - [ "I have problems here !!" ]
[1703568573.0] - [Tue 26 Dec 05:29:33 GMT 2023] - [10] - [ "garbage" ]
[1701078154.0] - [Mon 27 Nov 09:42:34 GMT 2023] - [10] - [ "it`s ok" ]
[1702996630.0] - [Tue 19 Dec 14:37:10 GMT 2023] - [10] - [ "Doesn't work at all" ]
[1702933418.0] - [Mon 18 Dec 21:03:38 GMT 2023] - [10] - [ "Does not work" ]
[1467971379.0] - [Fri 8 Jul 10:49:39 IST 2016] - [ 0] - [ "Beautifully simple" ]
[1469406833.0] - [Mon 25 Jul 01:33:53 IST 2016] - [ 0] - [ "Excellent, but not completely stable" ]
[1478337033.0] - [Sat 5 Nov 09:10:33 GMT 2016] - [ 0] - [ "Nice VM App" ]
[1479829602.0] - [Tue 22 Nov 15:46:42 GMT 2016] - [ 0] - [ "What is the name of the executable?" ]
[1480152527.0] - [Sat 26 Nov 09:28:47 GMT 2016] - [ 0] - [ "Very useful" ]
[1480272663.0] - [Sun 27 Nov 18:51:03 GMT 2016] - [ 0] - [ "Very easy to use" ]
[1480695464.0] - [Fri 2 Dec 16:17:44 GMT 2016] - [ 0] - [ "Easy to use" ]
[1483778824.0] - [Sat 7 Jan 08:47:04 GMT 2017] - [ 0] - [ "A Good Alternative to Virtualbox" ]
[1488500017.0] - [Fri 3 Mar 00:13:37 GMT 2017] - [ 0] - [ "Use Oracle VirtualBox instead" ]
[1488907504.0] - [Tue 7 Mar 17:25:04 GMT 2017] - [ 0] - [ "Check your SELinux booleans" ]
[1496420228.0] - [Fri 2 Jun 17:17:08 IST 2017] - [ 0] - [ "Awesome" ]
[1499961471.0] - [Thu 13 Jul 16:57:51 IST 2017] - [ 0] - [ "Need improvement" ]
[1502988063.0] - [Thu 17 Aug 17:41:03 IST 2017] - [ 0] - [ "Too basic" ]
[1507521880.0] - [Mon 9 Oct 05:04:40 IST 2017] - [ 0] - [ "Great idea, but either buggy or not intuitive" ]
[1508646921.0] - [Sun 22 Oct 05:35:21 IST 2017] - [ 0] - [ "Easy to setup, easier to use than virt-manager" ]
[1509076743.0] - [Fri 27 Oct 04:59:03 IST 2017] - [ 0] - [ "Buggy and broken, needs work" ]
[1511179850.0] - [Mon 20 Nov 12:10:50 GMT 2017] - [ 0] - [ "Great overlook" ]
After fix:
[1708348079.0] - [Mon 19 Feb 13:07:59 GMT 2024] - [33] - [ "Solved the freezing problem" ]
[1704921262.0] - [Wed 10 Jan 21:14:22 GMT 2024] - [24] - [ "It still being near to useless" ]
[1704891417.0] - [Wed 10 Jan 12:56:57 GMT 2024] - [24] - [ "Oops something went wrong!" ]
[1704741082.0] - [Mon 8 Jan 19:11:22 GMT 2024] - [24] - [ "Works great in --user space" ]
[1704207445.0] - [Tue 2 Jan 14:57:25 GMT 2024] - [24] - [ "Steam Deck User" ]
[1704145744.0] - [Mon 1 Jan 21:49:04 GMT 2024] - [24] - [ "Not good" ]
[1703638401.0] - [Wed 27 Dec 00:53:21 GMT 2023] - [24] - [ "Works but with lots of compromises" ]
[1703617406.0] - [Tue 26 Dec 19:03:26 GMT 2023] - [24] - [ "segfault when loading iso on 22.04 LTS" ]
[1703568573.0] - [Tue 26 Dec 05:29:33 GMT 2023] - [10] - [ "garbage" ]
[1703513011.0] - [Mon 25 Dec 14:03:31 GMT 2023] - [10] - [ "I have problems here !!" ]
[1702996630.0] - [Tue 19 Dec 14:37:10 GMT 2023] - [10] - [ "Doesn't work at all" ]
[1702933418.0] - [Mon 18 Dec 21:03:38 GMT 2023] - [10] - [ "Does not work" ]
[1701078154.0] - [Mon 27 Nov 09:42:34 GMT 2023] - [10] - [ "it`s ok" ]
[1699827637.0] - [Sun 12 Nov 22:20:37 GMT 2023] - [ 0] - [ "OK when it works" ]
[1699054783.0] - [Fri 3 Nov 23:39:43 GMT 2023] - [ 0] - [ "3d acceleration creates visual bugs" ]
[1697411092.0] - [Mon 16 Oct 00:04:52 IST 2023] - [ 0] - [ "NO USB Redirect" ]
[1697143339.0] - [Thu 12 Oct 21:42:19 IST 2023] - [ 0] - [ "Awesome" ]
[1696007316.0] - [Fri 29 Sep 18:08:36 IST 2023] - [ 0] - [ "Completely pointless" ]
[1695859976.0] - [Thu 28 Sep 01:12:56 IST 2023] - [ 0] - [ "NO USB REDIRECT (FLATPAK)" ]
[1694130381.0] - [Fri 8 Sep 00:46:21 IST 2023] - [ 0] - [ "Snap is great!" ]
[1693882368.0] - [Tue 5 Sep 03:52:48 IST 2023] - [ 0] - [ "idk" ]
[1693185983.0] - [Mon 28 Aug 02:26:23 IST 2023] - [ 0] - [ "no wifi" ]
[1692600941.0] - [Mon 21 Aug 07:55:41 IST 2023] - [ 0] - [ "Quite Useful Virtual Desktop" ]
[1691947431.0] - [Sun 13 Aug 18:23:51 IST 2023] - [ 0] - [ "the best" ]
[1691537360.0] - [Wed 9 Aug 00:29:20 IST 2023] - [ 0] - [ "Super easy to use" ]
[1691383595.0] - [Mon 7 Aug 05:46:35 IST 2023] - [ 0] - [ "LOVE IT" ]
[1690579058.0] - [Fri 28 Jul 22:17:38 IST 2023] - [ 0] - [ "almost perfect" ]
[1690519232.0] - [Fri 28 Jul 05:40:32 IST 2023] - [ 0] - [ "good app" ]
[1690325544.0] - [Tue 25 Jul 23:52:24 IST 2023] - [ 0] - [ "BAD" ]
[1690247603.0] - [Tue 25 Jul 02:13:23 IST 2023] - [ 0] - [ "USB redirect" ]
Edited by Sid