Add 1.x page model converters

This commit is contained in:
arkon
2020-11-07 19:22:01 -05:00
parent e32445f2cf
commit 7dc70c9eab
2 changed files with 10 additions and 3 deletions
@@ -63,8 +63,15 @@ open class Page(
}
}
fun Page.toPageInfo(): PageUrl {
fun Page.toPageUrl(): PageUrl {
return PageUrl(
url = this.imageUrl ?: this.url
)
}
fun PageUrl.toPage(index: Int): Page {
return Page(
index = index,
imageUrl = this.url
)
}