mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-19 15:31:13 +01:00
Minor changes
This commit is contained in:
@@ -340,6 +340,7 @@ public class DownloadManager {
|
||||
public void deleteChapter(Source source, Manga manga, Chapter chapter) {
|
||||
File path = getAbsoluteChapterDirectory(source, manga, chapter);
|
||||
DiskUtils.deleteFiles(path);
|
||||
queue.remove(chapter);
|
||||
}
|
||||
|
||||
public DownloadQueue getQueue() {
|
||||
|
||||
@@ -35,7 +35,6 @@ public class Download {
|
||||
this.source = source;
|
||||
this.manga = manga;
|
||||
this.chapter = chapter;
|
||||
this.status = QUEUE;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
|
||||
@@ -3,7 +3,7 @@ package eu.kanade.mangafeed.data.download.model;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import eu.kanade.mangafeed.data.download.model.Download;
|
||||
import eu.kanade.mangafeed.data.database.models.Chapter;
|
||||
import rx.Observable;
|
||||
import rx.subjects.PublishSubject;
|
||||
|
||||
@@ -19,14 +19,25 @@ public class DownloadQueue {
|
||||
|
||||
public void add(Download download) {
|
||||
download.setStatusSubject(statusSubject);
|
||||
download.setStatus(Download.QUEUE);
|
||||
queue.add(download);
|
||||
}
|
||||
|
||||
public void remove(Download download) {
|
||||
queue.remove(download);
|
||||
download.setStatus(Download.NOT_DOWNLOADED);
|
||||
download.setStatusSubject(null);
|
||||
}
|
||||
|
||||
public void remove(Chapter chapter) {
|
||||
for (Download download : queue) {
|
||||
if (download.chapter.id == chapter.id) {
|
||||
remove(download);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<Download> get() {
|
||||
return queue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user