|
|
@ -45,9 +45,9 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) |
|
|
|
|
|
|
|
|
|
|
|
fun enableSelection(sources: LinkedHashSet<BookSource>) { |
|
|
|
fun enableSelection(sources: LinkedHashSet<BookSource>) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
val list = ArrayList(sources) |
|
|
|
val list = arrayListOf<BookSource>() |
|
|
|
list.forEach { |
|
|
|
sources.forEach { |
|
|
|
it.enabled = true |
|
|
|
list.add(it.copy(enabled = true)) |
|
|
|
} |
|
|
|
} |
|
|
|
App.db.bookSourceDao().update(*list.toTypedArray()) |
|
|
|
App.db.bookSourceDao().update(*list.toTypedArray()) |
|
|
|
} |
|
|
|
} |
|
|
@ -55,9 +55,9 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) |
|
|
|
|
|
|
|
|
|
|
|
fun disableSelection(sources: LinkedHashSet<BookSource>) { |
|
|
|
fun disableSelection(sources: LinkedHashSet<BookSource>) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
val list = ArrayList(sources) |
|
|
|
val list = arrayListOf<BookSource>() |
|
|
|
list.forEach { |
|
|
|
sources.forEach { |
|
|
|
it.enabled = false |
|
|
|
list.add(it.copy(enabled = false)) |
|
|
|
} |
|
|
|
} |
|
|
|
App.db.bookSourceDao().update(*list.toTypedArray()) |
|
|
|
App.db.bookSourceDao().update(*list.toTypedArray()) |
|
|
|
} |
|
|
|
} |
|
|
@ -65,9 +65,9 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) |
|
|
|
|
|
|
|
|
|
|
|
fun enableSelectExplore(sources: LinkedHashSet<BookSource>) { |
|
|
|
fun enableSelectExplore(sources: LinkedHashSet<BookSource>) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
val list = ArrayList(sources) |
|
|
|
val list = arrayListOf<BookSource>() |
|
|
|
list.forEach { |
|
|
|
sources.forEach { |
|
|
|
it.enabledExplore = true |
|
|
|
list.add(it.copy(enabledExplore = true)) |
|
|
|
} |
|
|
|
} |
|
|
|
App.db.bookSourceDao().update(*list.toTypedArray()) |
|
|
|
App.db.bookSourceDao().update(*list.toTypedArray()) |
|
|
|
} |
|
|
|
} |
|
|
@ -75,9 +75,9 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) |
|
|
|
|
|
|
|
|
|
|
|
fun disableSelectExplore(sources: LinkedHashSet<BookSource>) { |
|
|
|
fun disableSelectExplore(sources: LinkedHashSet<BookSource>) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
val list = ArrayList(sources) |
|
|
|
val list = arrayListOf<BookSource>() |
|
|
|
list.forEach { |
|
|
|
sources.forEach { |
|
|
|
it.enabledExplore = false |
|
|
|
list.add(it.copy(enabledExplore = false)) |
|
|
|
} |
|
|
|
} |
|
|
|
App.db.bookSourceDao().update(*list.toTypedArray()) |
|
|
|
App.db.bookSourceDao().update(*list.toTypedArray()) |
|
|
|
} |
|
|
|
} |
|
|
|