mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-02 15:18:56 +01:00
Initial support for custom images scaling (#40)
This commit is contained in:
@@ -328,7 +328,6 @@ public class DownloadManager {
|
||||
|
||||
// Return the page list from the chapter's directory if it exists, null otherwise
|
||||
public List<Page> getSavedPageList(Source source, Manga manga, Chapter chapter) {
|
||||
List<Page> pages = null;
|
||||
File chapterDir = getAbsoluteChapterDirectory(source, manga, chapter);
|
||||
File pagesFile = new File(chapterDir, PAGE_LIST_FILE);
|
||||
|
||||
@@ -337,14 +336,14 @@ public class DownloadManager {
|
||||
if (pagesFile.exists()) {
|
||||
reader = new JsonReader(new FileReader(pagesFile.getAbsolutePath()));
|
||||
Type collectionType = new TypeToken<List<Page>>() {}.getType();
|
||||
pages = gson.fromJson(reader, collectionType);
|
||||
return gson.fromJson(reader, collectionType);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Timber.e(e.getCause(), e.getMessage());
|
||||
} finally {
|
||||
if (reader != null) try { reader.close(); } catch (IOException e) { /* Do nothing */ }
|
||||
}
|
||||
return pages;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Shortcut for the method above
|
||||
|
||||
@@ -47,7 +47,7 @@ public class DownloadQueue extends ArrayList<Download> {
|
||||
}
|
||||
|
||||
public Observable<Download> getProgressObservable() {
|
||||
return statusSubject
|
||||
return statusSubject.onBackpressureBuffer()
|
||||
.startWith(getActiveDownloads())
|
||||
.flatMap(download -> {
|
||||
if (download.getStatus() == Download.DOWNLOADING) {
|
||||
|
||||
@@ -88,6 +88,10 @@ public class PreferencesHelper {
|
||||
return prefs.getInt(getKey(R.string.pref_default_viewer_key), 1);
|
||||
}
|
||||
|
||||
public Preference<Integer> imageScaleType() {
|
||||
return rxPrefs.getInteger(getKey(R.string.pref_image_scale_type_key), 1);
|
||||
}
|
||||
|
||||
public Preference<Integer> portraitColumns() {
|
||||
return rxPrefs.getInteger(getKey(R.string.pref_library_columns_portrait_key), 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user