desura / Desurium

Free online games platform (juegos gratis), with an open source client. LGPL repo for Desura client. Potentially out of date. See https://github.com/desura/desura-app for newest (LGPL) client.
https://www.desura.com/es
GNU General Public License v3.0
270 stars 42 forks source link

js/playList: parse rating to float #541

Closed karolherbst closed 11 years ago

karolherbst commented 11 years ago

the custom sort function is comparing strings. String comparision in JavaScript is fine as long as both strings have the same lenght and the decimal mark at the same position.

But "10.0" was the only case violating this. "10.0" < a is returning false for all a's matching ^[0-9].[0-9]$

fixes #374

NOTE: this is a candidate for the stable branch

v2: we need to handle the rating coloumn explicitly, also remove this dirty eval hack with an associative array access

karolherbst commented 11 years ago

okay, this broke every other sorting

karolherbst commented 11 years ago

regression fixed

TheSiege commented 11 years ago

works as expected