Fix import db
This commit is contained in:
2 files changed
+9
-3
No files matched your search
@@ -728,7 +728,7 @@ public class EhDB {
|
||||
// Downloads
|
||||
DownloadManager manager = EhApplication.getDownloadManager(context);
|
||||
List<DownloadInfo> downloadInfoList = session.getDownloadsDao().queryBuilder().list();
|
||||
manager.addDownload(downloadInfoList);
|
||||
manager.addDownload(downloadInfoList, false);
|
||||
|
||||
// Download label
|
||||
List<DownloadLabel> downloadLabelList = session.getDownloadLabelDao().queryBuilder().list();
|
||||
|
||||
@@ -358,6 +358,10 @@ public class DownloadManager implements SpiderQueen.OnSpiderListener {
|
||||
}
|
||||
|
||||
public void addDownload(List<DownloadInfo> downloadInfoList) {
|
||||
addDownload(downloadInfoList, true);
|
||||
}
|
||||
|
||||
public void addDownload(List<DownloadInfo> downloadInfoList, boolean notify) {
|
||||
for (DownloadInfo info : downloadInfoList) {
|
||||
if (containDownloadInfo(info.gid)) {
|
||||
// Contain
|
||||
@@ -397,8 +401,10 @@ public class DownloadManager implements SpiderQueen.OnSpiderListener {
|
||||
Collections.sort(mAllInfoList, DATE_DESC_COMPARATOR);
|
||||
|
||||
// Notify
|
||||
for (DownloadInfoListener l : mDownloadInfoListeners) {
|
||||
l.onReload();
|
||||
if (notify) {
|
||||
for (DownloadInfoListener l : mDownloadInfoListeners) {
|
||||
l.onReload();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user