Commit 00b2983d authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

remove alias from articles as key

parent 54b1a51a
......@@ -54,7 +54,7 @@ class FeedsContractModule @Inject constructor(
return api.getArticlesPage(feed.alias, 11, 1)
.doOnNext { Timber.d("raw0 $it") }
.map { it.items }
.map { fromRaw(it, feedId, feed.alias) }
.map { fromRaw(it, feedId) }
.doOnNext(db::blockingUpsert)
.subscribeOn(Schedulers.io())
}
......
......@@ -13,9 +13,8 @@ interface Feed : Persistable {
@get:Key
val id: Int
val title:String
@get:Key
val alias: String
@get:JunctionTable(name= "FeedArticlesRule")
@get:OneToMany( cascade = arrayOf(CascadeAction.DELETE))
@get:OneToMany( cascade = [CascadeAction.DELETE])
val articles:Set<Article>?
}
\ No newline at end of file
......@@ -48,7 +48,7 @@ fun fromRaw(raw:ArticleRaw) : ArticleEntity {
}
fun fromRaw(raw:NewsArticleRaw,feedId:Int,feedAlias:String):ArticleEntity{
fun fromRaw(raw:NewsArticleRaw,feedId:Int):ArticleEntity{
val entity = ArticleEntity()
entity.setId(raw.id)
entity.setPreview("https://room-park.ru${raw.preview}")
......@@ -64,9 +64,7 @@ fun fromRaw(raw:NewsArticleRaw,feedId:Int,feedAlias:String):ArticleEntity{
fun fromRaw(raw: List<FeedRaw>):List<FeedEntity> = List(raw.size) { index-> fromRaw(raw[index]) }
fun fromRaw(raw: List<NewsArticleRaw>,feedId:Int,feedAlias:String):List<ArticleEntity> =
List(raw.size) { index-> fromRaw(raw[index],feedId,feedAlias) }
fun fromRaw(raw: List<NewsArticleRaw>,feedId:Int):List<ArticleEntity> =
List(raw.size) { index-> fromRaw(raw[index],feedId) }
val calcTargetResolution = max(display.widthPixels,display.heightPixels)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment