illogical-robot / apkmirror-public

APKMirror.com bugs
http://www.apkmirror.com
100 stars 32 forks source link

Ability to sort by version rather than date #233

Open archon810 opened 1 year ago

archon810 commented 1 year ago

Suggestion received via email: "Now the uploads under an app is ranked by upload date, but sometimes old versions are uploaded later than newer version, causing the versions to mox together, and is difficult to define the latest version. Please allow users to select the default method to rank the versions."

archon810 commented 1 year ago

There are several reasons we haven't done this yet.

There are two ways of sorting - by version name and by internal version code (always numeric).

Version name is inconsistent: a) Many apps switch version formats at some point which breaks such sorting. b) Some use multiple version formats at the same time - whether for beta/alpha apps or for apps in different regions.

Numeric version codes are better for this but also problematic because of release variants. One app release could contain wildly different version codes that differ by millions or billions (such as 1000001 for arm and 2000001 for arm64, for example). So a single release could have APKs with version codes that are all over the place. Therefore, depending on which APKs are uploaded at any given moment for a given release, we may have a completely inconsistent sorting.

We haven't come up with a foolproof reliable way to add version sorting, and therefore as a result haven't offered it. Date sorting with me manually deciding where obviously older uploaded APKs should be pushed back to is what has been working OK so far.

Open to suggestions for algorithms though.