Fix gallery adder trying 3 times even if there are no errors

This commit is contained in:
Jobobby04 2023-05-09 21:53:30 -04:00
parent 45f839c5e1
commit 2ed07181b5

View File

@ -59,7 +59,7 @@ class GalleryAdder(
fav: Boolean = false, fav: Boolean = false,
forceSource: UrlImportableSource? = null, forceSource: UrlImportableSource? = null,
throttleFunc: suspend () -> Unit = {}, throttleFunc: suspend () -> Unit = {},
retry: Int = 1 retry: Int = 1,
): GalleryAddEvent { ): GalleryAddEvent {
logger.d(context.getString(R.string.gallery_adder_importing_gallery, url, fav.toString(), forceSource)) logger.d(context.getString(R.string.gallery_adder_importing_gallery, url, fav.toString(), forceSource))
try { try {
@ -197,6 +197,7 @@ class GalleryAdder(
for (i in 1..retryCount) { for (i in 1..retryCount) {
try { try {
result = block() result = block()
break
} catch (e: Exception) { } catch (e: Exception) {
if (e is EHentai.GalleryNotFoundException) { if (e is EHentai.GalleryNotFoundException) {
throw e throw e