Show better error when trying to open RARv5 file
(cherry picked from commit a84305438853cafa9aff194b89fa221603f2f743) (cherry picked from commit 53a381ce285f166a8e2e6c635cf71c0bbc662938) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ChapterLoader.kt
This commit is contained in:
parent
38b7240728
commit
43010e92ac
@ -1,6 +1,7 @@
|
|||||||
package eu.kanade.tachiyomi.ui.reader.loader
|
package eu.kanade.tachiyomi.ui.reader.loader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import com.github.junrar.exception.UnsupportedRarV5Exception
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||||
import eu.kanade.tachiyomi.data.download.DownloadManager
|
import eu.kanade.tachiyomi.data.download.DownloadManager
|
||||||
@ -116,7 +117,11 @@ class ChapterLoader(
|
|||||||
when (format) {
|
when (format) {
|
||||||
is LocalSource.Format.Directory -> DirectoryPageLoader(format.file)
|
is LocalSource.Format.Directory -> DirectoryPageLoader(format.file)
|
||||||
is LocalSource.Format.Zip -> ZipPageLoader(format.file)
|
is LocalSource.Format.Zip -> ZipPageLoader(format.file)
|
||||||
is LocalSource.Format.Rar -> RarPageLoader(format.file)
|
is LocalSource.Format.Rar -> try {
|
||||||
|
RarPageLoader(format.file)
|
||||||
|
} catch (e: UnsupportedRarV5Exception) {
|
||||||
|
error(context.getString(R.string.loader_rar5_error))
|
||||||
|
}
|
||||||
is LocalSource.Format.Epub -> EpubPageLoader(format.file)
|
is LocalSource.Format.Epub -> EpubPageLoader(format.file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -702,6 +702,7 @@
|
|||||||
<string name="transition_pages_error">Failed to load pages: %1$s</string>
|
<string name="transition_pages_error">Failed to load pages: %1$s</string>
|
||||||
<string name="page_list_empty_error">No pages found</string>
|
<string name="page_list_empty_error">No pages found</string>
|
||||||
<string name="loader_not_implemented_error">Source not found</string>
|
<string name="loader_not_implemented_error">Source not found</string>
|
||||||
|
<string name="loader_rar5_error">RARv5 format is not supported</string>
|
||||||
<plurals name="missing_chapters_warning">
|
<plurals name="missing_chapters_warning">
|
||||||
<item quantity="one">Skipping %d chapter, either the source is missing it or it has been filtered out</item>
|
<item quantity="one">Skipping %d chapter, either the source is missing it or it has been filtered out</item>
|
||||||
<item quantity="other">Skipping %d chapters, either the source is missing them or they have been filtered out</item>
|
<item quantity="other">Skipping %d chapters, either the source is missing them or they have been filtered out</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user