Skip to content

Commit

Permalink
Don't try to sort add-on versions with the same creation date (March …
Browse files Browse the repository at this point in the history
…5, 2007 AMO API bug)
  • Loading branch information
JustOff committed Jan 19, 2019
1 parent 29edfd2 commit b93cc4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let Addon = {
data.count = dbQuery.row.count;
dbQuery.finalize();

dbQuery = db.createStatement("SELECT addons.addon_id AS addon_id, addons.name AS name, slug, is_experimental, users, reviews, rating, summary, description, homepage, dev_comments, support_email, support_url, r1, r2, r3, r4, r5, version, release_notes, is_restart_required, versions.url AS url, min, max, size, created, licenses.name AS lic_name, licenses.url AS lic_url, eulas.rowid AS eula, policies.rowid AS policy, icon FROM addons INNER JOIN versions ON addons.addon_id = versions.addon_id LEFT JOIN licenses ON licenses.license_id = versions.license_id LEFT JOIN eulas ON eulas.addon_id = addons.addon_id LEFT JOIN policies ON policies.addon_id = addons.addon_id LEFT JOIN icons ON addons.addon_id = icons.addon_id WHERE addons." + col + " = :query ORDER BY versions.created DESC, versions.version DESC LIMIT 1");
dbQuery = db.createStatement("SELECT addons.addon_id AS addon_id, addons.name AS name, slug, is_experimental, users, reviews, rating, summary, description, homepage, dev_comments, support_email, support_url, r1, r2, r3, r4, r5, version, release_notes, is_restart_required, versions.url AS url, min, max, size, created, licenses.name AS lic_name, licenses.url AS lic_url, eulas.rowid AS eula, policies.rowid AS policy, icon FROM addons INNER JOIN versions ON addons.addon_id = versions.addon_id LEFT JOIN licenses ON licenses.license_id = versions.license_id LEFT JOIN eulas ON eulas.addon_id = addons.addon_id LEFT JOIN policies ON policies.addon_id = addons.addon_id LEFT JOIN icons ON addons.addon_id = icons.addon_id WHERE addons." + col + " = :query ORDER BY versions.created DESC LIMIT 1");
dbQuery.params.query = query;
dbQuery.executeStep();
let id;
Expand Down

0 comments on commit b93cc4e

Please sign in to comment.