Add extension fields for hasReadme and hasChangelog (#10469)

* Add extension fields for hasReadme and hasChangelog

* Dump Komga extVersionCode
This commit is contained in:
Andreas 2022-01-22 15:48:52 +01:00 committed by GitHub
parent 5d7f7e202a
commit ca9645288f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 156 additions and 5 deletions

View File

@ -21,6 +21,8 @@ for APK in ${APKS[@]}; do
VCODE=$(echo $PACKAGE | grep -Po "versionCode='\K[^']+")
VNAME=$(echo $PACKAGE | grep -Po "versionName='\K[^']+")
NSFW=$(echo $BADGING | grep -Po "tachiyomi.extension.nsfw' value='\K[^']+")
HASREADME=$(echo $BADGING | grep -Po "tachiyomi.extension.hasReadme' value='\K[^']+")
HASCHANGELOG=$(echo $BADGING | grep -Po "tachiyomi.extension.hasChangelog' value='\K[^']+")
APPLICATION=$(echo "$BADGING" | grep application:)
LABEL=$(echo $APPLICATION | grep -Po "label='\K[^']+")
@ -51,8 +53,10 @@ for APK in ${APKS[@]}; do
--argjson code $VCODE \
--arg version "$VNAME" \
--argjson nsfw $NSFW \
--argjson hasReadme $HASREADME \
--argjson hasChangelog $HASCHANGELOG \
--argjson sources "$SOURCE_INFO" \
'{name:$name, pkg:$pkg, apk:$apk, lang:$lang, code:$code, version:$version, nsfw:$nsfw, sources:$sources}'
'{name:$name, pkg:$pkg, apk:$apk, lang:$lang, code:$code, version:$version, nsfw:$nsfw, hasReadme:$hasReadme, hasChangelog:$hasChangelog, sources:$sources}'
done | jq -sr '[.[]]' > index.json

View File

@ -24,11 +24,23 @@ android {
versionCode extVersionCode
versionName project.ext.properties.getOrDefault("libVersion", "1.2") + ".$extVersionCode"
setProperty("archivesBaseName", "tachiyomi-$pkgNameSuffix-v$versionName")
def readmes = project.projectDir.listFiles({ File file ->
file.name.equals("README.md") ||
file.name.equals("CHANGELOG.md")
} as FileFilter)
def hasReadme = readmes != null && readmes.any { File file ->
file.name.startsWith("README")
}
def hasChangelog = readmes != null && readmes.any { File file ->
file.name.startsWith("CHANGELOG")
}
manifestPlaceholders = [
appName : "Tachiyomi: $extName",
extClass: extClass,
extFactory: project.ext.properties.getOrDefault("extFactory", ""),
nsfw: project.ext.properties.getOrDefault("isNsfw", false) ? 1 : 0,
hasReadme: hasReadme ? 1 : 0,
hasChangelog: hasChangelog ? 1 : 0,
]
}

View File

@ -9,6 +9,8 @@
<meta-data android:name="tachiyomi.extension.class" android:value="${extClass}" />
<meta-data android:name="tachiyomi.extension.factory" android:value="${extFactory}" />
<meta-data android:name="tachiyomi.extension.nsfw" android:value="${nsfw}" />
<meta-data android:name="tachiyomi.extension.hasReadme" android:value="${hasReadme}" />
<meta-data android:name="tachiyomi.extension.hasChangelog" android:value="${hasChangelog}" />
</application>

View File

@ -9,7 +9,7 @@ class MangaBoxGenerator : ThemeSourceGenerator {
override val themeClass = "MangaBox"
override val baseVersionCode: Int = 4
override val baseVersionCode: Int = 5
override val sources = listOf(
SingleLang("Mangakakalot", "https://mangakakalot.com", "en", overrideVersionCode = 3),

View File

@ -0,0 +1,15 @@
# MangaBox
Table of Content
- [FAQ](#FAQ)
[Uncomment this if needed; and replace &#40; and &#41; with ( and )]: <> (- [Guides]&#40;#Guides&#41;)
Don't find the question you are look for go check out our general FAQs and Guides over at [Extension FAQ](https://tachiyomi.org/help/faq/#extensions) or [Getting Started](https://tachiyomi.org/help/guides/getting-started/#installation)
## FAQ
#### What do `Page list is empty` and `Source URL has changed` mean?
The former **Mangabox** extensions have created new entries for many of the manga on their websites. The old entries are obsolete and will not work. To resolve this, [migrate](/help/guides/source-migration/) the manga from the source to itself to get the new entry, or better yet, to a different source entirely to avoid similar errors in the future.
[Uncomment this if needed]: <> (## Guides)

View File

@ -131,12 +131,33 @@ ${placeholders.map { "${" ".repeat(28)}${it.key}: \"${it.value}\""}.joinToString
writeAndroidManifest(projectAndroidManifestFile, manifestOverridePath, defaultAndroidManifestPath)
writeSourceClasses(projectSrcPath, srcOverridePath, source, themePkg, themeClass)
copyThemeReadmes(userDir, themePkg, projectRootPath)
copyThemeClasses(userDir, themePkg, projectRootPath)
copyResFiles(resOverridePath, defaultResPath, source, projectRootPath)
}
}
private fun copyThemeReadmes(userDir: String, themePkg: String, projectRootPath: String) {
val sourcePath = "$userDir/multisrc/src/main/java/${themeSuffix(themePkg, "/")}"
val sourceFile = File(sourcePath)
val destinationPath = "$projectRootPath"
val destinationFile = File(destinationPath)
destinationFile.mkdirs()
sourceFile.list()!!
.filter { it.endsWith("README.md") || it.endsWith("CHANGELOG.md") }
.forEach {
Files.copy(
File("$sourcePath/$it").toPath(),
File("$destinationPath/$it").toPath(),
StandardCopyOption.REPLACE_EXISTING
)
}
}
private fun copyThemeClasses(userDir: String, themePkg: String, projectRootPath: String) {
val themeSrcPath = "$userDir/multisrc/src/main/java/${themeSuffix(themePkg, "/")}"
val themeSrcFile = File(themeSrcPath)

View File

@ -6,7 +6,7 @@ ext {
extName = 'Komga'
pkgNameSuffix = 'all.komga'
extClass = '.KomgaFactory'
extVersionCode = 36
extVersionCode = 37
}
dependencies {

View File

@ -0,0 +1,54 @@
# MangaDex
Table of Content
- [FAQ](#FAQ)
- [Version 5 API Rewrite](#Version 5 API Rewrite)
- [Guides](#Guides)
- [How can I block particular Scanlator Groups?](#How can I block particular Scanlator Groups?)
Don't find the question you are look for go check out our general FAQs and Guides over at [Extension FAQ](https://tachiyomi.org/help/faq/#extensions) or [Getting Started](https://tachiyomi.org/help/guides/getting-started/#installation)
## FAQ
### Version 5 API Rewrite
#### Why are all my manga saying "Manga ID format has changed, migrate from MangaDex to MangaDex to continue reading"?
You need to [migrate](https://tachiyomi.org/help/guides/source-migration/) all your MangaDex manga from MangaDex to MangaDex as MangaDex has changed their manga ID system from IDs to UUIDs.
#### Why can I not restore from a JSON backup?
JSON backups are now unusable due to the ID change. You will have to manually re-add your manga.
## Guides
### How can I block particular Scanlator Groups?
The **MangaDex** extension allows blocking **Scanlator Groups**. Chapters uploaded by a **Blocked Scanlator Group** will not show up in **Latest** or in **Manga feed** (chapters list). For now, you can only block Groups by entering their UUIDs manually.
Follow the following steps to easily block a group from the Tachiyomi MangaDex extension:
A. Finding the **UUIDs**:
- Go to [https://mangadex.org](https://mangadex.org) and <NavigationText item="search"/> for the Scanlation Group that you wish to block and view their Group Details
- Using the URL of this page, get the 16-digit alphanumeric string which will be the UUID for that scanlation group
- For Example:
* The Group *Tristan's test scans* has the URL
- [https://mangadex.org/group/6410209a-0f39-4f51-a139-bc559ad61a4f/tristan-s-test-scans](https://mangadex.org/group/6410209a-0f39-4f51-a139-bc559ad61a4f/tristan-s-test-scans)
- Therefore, their UUID will be `6410209a-0f39-4f51-a139-bc559ad61a4f`
* Other Examples include:
+ Azuki Manga | `5fed0576-8b94-4f9a-b6a7-08eecd69800d`
+ Bilibili Comics | `06a9fecb-b608-4f19-b93c-7caab06b7f44`
+ Comikey | `8d8ecf83-8d42-4f8c-add8-60963f9f28d9`
+ MangaPlus | `4f1de6a2-f0c5-4ac5-bce5-02c7dbb67deb`
B. Blocking a group using their UUID in Tachiyomi MangaDex extension `v1.2.150+`:
1. Go to <NavigationText item="browse"/><NavigationText item="extensions"/>.
1. Click on **MangaDex** extension and then <NavigationText item="settings"/> under your Language of choice.
1. Tap on the option **Block Groups by UUID** and enter the UUIDs.
- By Default, the following groups are blocked:
```
Azuki Manga, Bilibili Comics, Comikey & MangaPlus
```
- Which are entered as:
```
5fed0576-8b94-4f9a-b6a7-08eecd69800d, 06a9fecb-b608-4f19-b93c-7caab06b7f44,
8d8ecf83-8d42-4f8c-add8-60963f9f28d9, 4f1de6a2-f0c5-4ac5-bce5-02c7dbb67deb
```

View File

@ -6,7 +6,7 @@ ext {
extName = 'MangaDex'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangaDexFactory'
extVersionCode = 153
extVersionCode = 154
isNsfw = true
}

View File

@ -0,0 +1,20 @@
# MangaPark
Table of Content
- [FAQ](#FAQ)
[Uncomment this if needed; and replace &#40; and &#41; with ( and )]: <> (- [Guides]&#40;#Guides&#41;)
Don't find the question you are look for go check out our general FAQs and Guides over at [Extension FAQ](https://tachiyomi.org/help/faq/#extensions) or [Getting Started](https://tachiyomi.org/help/guides/getting-started/#installation)
## FAQ
### How do I deal with duplicate chapters?
To solve this issue, follow the below steps.
1. Go to <NavigationText item="browse"/><NavigationText item="extensions"/>.
1. Click on **MangaPark** extension and then **Chapter List Source**.
1. Choose an option like **Smart list** or **Prioritize source**.
1. Go back to **MangaPark**'s chapter list and refresh it.
[Uncomment this if needed]: <> (## Guides)

View File

@ -6,7 +6,7 @@ ext {
extName = 'MangaPark'
pkgNameSuffix = 'en.mangapark'
extClass = '.MangaPark'
extVersionCode = 22
extVersionCode = 23
}
apply from: "$rootDir/common.gradle"

View File

@ -0,0 +1,11 @@
# Extension name
## Why
Link to the related issue where it is explained why it was removed.
Or a short description to why it was removed.
Or both the related issue link and short description to why
---
Don't find the question you are look for go check out our general FAQs and Guides over at [Extension FAQ](https://tachiyomi.org/help/faq/#extensions) or [Getting Started](https://tachiyomi.org/help/guides/getting-started/#installation)

View File

@ -0,0 +1,12 @@
# Extension name
Table of Content
- [FAQ](#FAQ)
[Uncomment this if needed; and replace &#40; and &#41; with ( and )]: <> (- [Guides]&#40;#Guides&#41;)
Don't find the question you are look for go check out our general FAQs and Guides over at [Extension FAQ](https://tachiyomi.org/help/faq/#extensions) or [Getting Started](https://tachiyomi.org/help/guides/getting-started/#installation)
## FAQ
[Uncomment this if needed]: <> (## Guides)