Merge pull request #3 from gedoor/master

Pull update from owner
pull/1209/head
SkyNight 4 years ago committed by GitHub
commit 76d4705a96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      app/src/main/java/io/legado/app/data/entities/BookSource.kt

@ -12,7 +12,6 @@ import io.legado.app.help.JsExtensions
import io.legado.app.utils.* import io.legado.app.utils.*
import kotlinx.android.parcel.Parcelize import kotlinx.android.parcel.Parcelize
import javax.script.SimpleBindings import javax.script.SimpleBindings
import kotlin.collections.HashMap
@Parcelize @Parcelize
@TypeConverters(BookSource.Converters::class) @TypeConverters(BookSource.Converters::class)
@ -165,31 +164,31 @@ data class BookSource(
class Converters { class Converters {
@TypeConverter @TypeConverter
fun exploreRuleToString(exploreRule: ExploreRule?) = GSON.toJson(exploreRule) fun exploreRuleToString(exploreRule: ExploreRule?): String = GSON.toJson(exploreRule)
@TypeConverter @TypeConverter
fun stringToExploreRule(json: String?) = GSON.fromJsonObject<ExploreRule>(json) fun stringToExploreRule(json: String?) = GSON.fromJsonObject<ExploreRule>(json)
@TypeConverter @TypeConverter
fun searchRuleToString(searchRule: SearchRule?) = GSON.toJson(searchRule) fun searchRuleToString(searchRule: SearchRule?): String = GSON.toJson(searchRule)
@TypeConverter @TypeConverter
fun stringToSearchRule(json: String?) = GSON.fromJsonObject<SearchRule>(json) fun stringToSearchRule(json: String?) = GSON.fromJsonObject<SearchRule>(json)
@TypeConverter @TypeConverter
fun bookInfoRuleToString(bookInfoRule: BookInfoRule?) = GSON.toJson(bookInfoRule) fun bookInfoRuleToString(bookInfoRule: BookInfoRule?): String = GSON.toJson(bookInfoRule)
@TypeConverter @TypeConverter
fun stringToBookInfoRule(json: String?) = GSON.fromJsonObject<BookInfoRule>(json) fun stringToBookInfoRule(json: String?) = GSON.fromJsonObject<BookInfoRule>(json)
@TypeConverter @TypeConverter
fun tocRuleToString(tocRule: TocRule?) = GSON.toJson(tocRule) fun tocRuleToString(tocRule: TocRule?): String = GSON.toJson(tocRule)
@TypeConverter @TypeConverter
fun stringToTocRule(json: String?) = GSON.fromJsonObject<TocRule>(json) fun stringToTocRule(json: String?) = GSON.fromJsonObject<TocRule>(json)
@TypeConverter @TypeConverter
fun contentRuleToString(contentRule: ContentRule?) = GSON.toJson(contentRule) fun contentRuleToString(contentRule: ContentRule?): String = GSON.toJson(contentRule)
@TypeConverter @TypeConverter
fun stringToContentRule(json: String?) = GSON.fromJsonObject<ContentRule>(json) fun stringToContentRule(json: String?) = GSON.fromJsonObject<ContentRule>(json)

Loading…
Cancel
Save