Skip to content

Commit

Permalink
feat(repo): Remove default manga repo (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
Secozzi authored May 7, 2024
1 parent 8af46fd commit 39832da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CreateMangaExtensionRepo(private val preferences: SourcePreferences) {
}

// Do not allow invalid formats
if (!name.matches(repoRegex) || name.startsWith(OFFICIAL_TACHIYOMI_REPO_BASE_URL)) {
if (!name.matches(repoRegex)) {
return Result.InvalidUrl
}

Expand All @@ -33,6 +33,5 @@ class CreateMangaExtensionRepo(private val preferences: SourcePreferences) {
}
}

const val OFFICIAL_TACHIYOMI_REPO_BASE_URL = "https://raw.githubusercontent.com/tachiyomiorg/extensions/repo"
private val repoRegex = """^https://.*/index\.min\.json$""".toRegex()
private val githubRepoRegex = """https://github\.com/[^/]+/[^/]+/blob/(?:[^/]+/)+index\.min\.json$""".toRegex()
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package eu.kanade.tachiyomi.extension.manga.api

import android.content.Context
import eu.kanade.domain.extension.manga.interactor.OFFICIAL_TACHIYOMI_REPO_BASE_URL
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.extension.ExtensionUpdateNotifier
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
Expand Down Expand Up @@ -37,10 +36,7 @@ internal class MangaExtensionApi {

suspend fun findExtensions(): List<MangaExtension.Available> {
return withIOContext {
val extensions = buildList {
addAll(getExtensions(OFFICIAL_TACHIYOMI_REPO_BASE_URL))
sourcePreferences.mangaExtensionRepos().get().map { addAll(getExtensions(it)) }
}
val extensions = sourcePreferences.mangaExtensionRepos().get().flatMap { getExtensions(it) }

// Sanity check - a small number of extensions probably means something broke
// with the repo generator
Expand Down

0 comments on commit 39832da

Please sign in to comment.