chore: update ReadMeFileGenerator and README-template.md

This commit is contained in:
inotia00 2024-04-26 06:10:43 +09:00
parent 477f189171
commit da63185b81
2 changed files with 11 additions and 11 deletions

View File

@ -15,12 +15,12 @@ Example:
```json ```json
[ [
{ {
"name": "Default video quality", "name": "Alternative thumbnails",
"description": "Adds an option to set the default video quality.", "description": "Adds options to replace video thumbnails using the DeArrow API or image captures from the video.",
"compatiblePackages":[ "compatiblePackages":[
{ {
"name":"com.google.android.youtube", "name": "com.google.android.youtube",
"versions": COMPATIBLE_PACKAGE_YOUTUBE "versions": "COMPATIBLE_PACKAGE_YOUTUBE"
} }
], ],
"use":true, "use":true,
@ -33,7 +33,7 @@ Example:
"compatiblePackages": [ "compatiblePackages": [
{ {
"name": "com.google.android.apps.youtube.music", "name": "com.google.android.apps.youtube.music",
"versions": COMPATIBLE_PACKAGE_MUSIC "versions": "COMPATIBLE_PACKAGE_MUSIC"
} }
], ],
"use":true, "use":true,
@ -46,7 +46,7 @@ Example:
"compatiblePackages": [ "compatiblePackages": [
{ {
"name": "com.reddit.frontpage", "name": "com.reddit.frontpage",
"versions": COMPATIBLE_PACKAGE_REDDIT "versions": "COMPATIBLE_PACKAGE_REDDIT"
} }
], ],
"use":true, "use":true,

View File

@ -33,9 +33,9 @@ internal class ReadMeFileGenerator : PatchesFileGenerator {
// add a list of supported versions to a temp file // add a list of supported versions to a temp file
mapOf( mapOf(
app.revanced.patches.music.utils.integrations.Constants.COMPATIBLE_PACKAGE to "COMPATIBLE_PACKAGE_MUSIC", app.revanced.patches.music.utils.integrations.Constants.COMPATIBLE_PACKAGE to "\"COMPATIBLE_PACKAGE_MUSIC\"",
app.revanced.patches.reddit.utils.integrations.Constants.COMPATIBLE_PACKAGE to "COMPATIBLE_PACKAGE_REDDIT", app.revanced.patches.reddit.utils.integrations.Constants.COMPATIBLE_PACKAGE to "\"COMPATIBLE_PACKAGE_REDDIT\"",
app.revanced.patches.youtube.utils.integrations.Constants.COMPATIBLE_PACKAGE to "COMPATIBLE_PACKAGE_YOUTUBE" app.revanced.patches.youtube.utils.integrations.Constants.COMPATIBLE_PACKAGE to "\"COMPATIBLE_PACKAGE_YOUTUBE\""
).forEach { (compatiblePackage, replaceString) -> ).forEach { (compatiblePackage, replaceString) ->
compatiblePackage.map { CompatiblePackage(it.name, it.versions?.toSet()?.ifEmpty { null }) } compatiblePackage.map { CompatiblePackage(it.name, it.versions?.toSet()?.ifEmpty { null }) }
.forEach { compatiblePackages -> .forEach { compatiblePackages ->
@ -48,7 +48,7 @@ internal class ReadMeFileGenerator : PatchesFileGenerator {
?.replace("[", "[\n \"") ?.replace("[", "[\n \"")
?.replace("]", "\"\n ]") ?.replace("]", "\"\n ]")
?.replace(", ", "\",\n \"") ?.replace(", ", "\",\n \"")
?: "all" ?: "\"ALL\""
} }
StringBuilder(readMeTemplateTempFile.readText()) StringBuilder(readMeTemplateTempFile.readText())
@ -88,7 +88,7 @@ internal class ReadMeFileGenerator : PatchesFileGenerator {
} else if (exception.containsKey(pkg)) } else if (exception.containsKey(pkg))
exception[pkg] + "+" exception[pkg] + "+"
else else
"all" "ALL"
appendLine( appendLine(
"| `${patch.name}` " + "| `${patch.name}` " +