Sort download item by descending time

This commit is contained in:
seven332 committed 2016-03-14 22:24:15 +08:00
1 parent 34109d3a93
commit 15d4819089
4 files changed
+36 -43

No files matched your search

@@ -297,9 +297,9 @@ public class EhDB {
}
}
public static synchronized List<DownloadInfo> getAllDownloadInfos() {
public static synchronized List<DownloadInfo> getAllDownloadInfo() {
DownloadsDao dao = sDaoSession.getDownloadsDao();
List<DownloadInfo> list = dao.queryBuilder().orderAsc(DownloadsDao.Properties.Time).list();
List<DownloadInfo> list = dao.queryBuilder().orderDesc(DownloadsDao.Properties.Time).list();
// Fix state
for (DownloadInfo info: list) {
if (info.state == DownloadInfo.STATE_WAIT || info.state == DownloadInfo.STATE_DOWNLOAD) {