Do quite a bit of code cleanup

This commit is contained in:
Jobobby04
2021-01-17 22:17:15 -05:00
parent 8db57aef6c
commit 3b364c91f1
16 changed files with 95 additions and 480 deletions
+6 -8
View File
@@ -49,13 +49,11 @@ object SourceTagsUtil {
}
fun parseTag(tag: String) = RaisedTag(
(
if (tag.startsWith("-")) {
tag.substringAfter("-")
} else {
tag
}
).substringBefore(':', missingDelimiterValue = "").trimOrNull(),
if (tag.startsWith("-")) {
tag.substringAfter("-")
} else {
tag
}.substringBefore(':', missingDelimiterValue = "").trimOrNull(),
tag.substringAfter(':', missingDelimiterValue = tag).trim(),
if (tag.startsWith("-")) TAG_TYPE_EXCLUDE else TAG_TYPE_DEFAULT
)
@@ -94,6 +92,6 @@ object SourceTagsUtil {
private const val TAG_TYPE_DEFAULT = 1
}
fun Manga.getRaisedTags(genres: List<String>? = null): List<RaisedTag>? = (genres ?: this.getGenres())?.map {
fun Manga.getRaisedTags(genres: List<String>? = getGenres()): List<RaisedTag>? = genres?.map {
SourceTagsUtil.parseTag(it)
}