Move EnhancedSource helper functions to SourceHelpers

This commit is contained in:
Jobobby04
2021-01-26 20:25:59 -05:00
parent 2e580cfb55
commit 5d600166ea
2 changed files with 18 additions and 19 deletions
@@ -105,3 +105,21 @@ fun isMetadataSource(source: Long) = source in 6900..6999 ||
fun Source.isEhBasedSource() = id == EH_SOURCE_ID || id == EXH_SOURCE_ID
fun Manga.isEhBasedManga() = source == EH_SOURCE_ID || source == EXH_SOURCE_ID
fun Source.getMainSource(): Source = if (this is EnhancedHttpSource) {
this.source()
} else {
this
}
fun Source.getOriginalSource(): Source = if (this is EnhancedHttpSource) {
this.originalSource
} else {
this
}
fun Source.getEnhancedSource(): Source = if (this is EnhancedHttpSource) {
this.enhancedSource
} else {
this
}