Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jay 2020-01-05 14:53:11 -08:00
commit c516078531
6 changed files with 11 additions and 6 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
* text=auto
* text eol=lf

View file

@ -74,4 +74,4 @@ open class SourceManager(private val context: Context) {
}
}
class SourceNotFoundException(message: String, val id: Long) : Exception(message)
class SourceNotFoundException(message: String, val id: Long) : Exception(message)

View file

@ -23,7 +23,6 @@ interface SManga : Serializable {
var initialized: Boolean
fun copyFrom(other: SManga) {
if (other.author != null)
author = other.author

View file

@ -496,8 +496,12 @@ class ChaptersController() : NucleusController<ChaptersPresenter>(),
presenter.deleteChapters(chapters)
}
fun onChaptersDeleted() {
fun onChaptersDeleted(chapters: List<ChapterItem>) {
dismissDeletingDialog()
//this is needed so the downloaded text gets removed from the item
chapters.forEach {
adapter?.updateItem(it)
}
adapter?.notifyDataSetChanged()
}

View file

@ -223,7 +223,7 @@ class ChaptersPresenter(
*/
fun getNextUnreadChapter(): ChapterItem? {
return chapters.sortedByDescending { it.source_order }.find { !it.read }
}
}
/**
* Mark the selected chapter list as read/unread.
@ -278,7 +278,7 @@ class ChaptersPresenter(
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeFirst({ view, _ ->
view.onChaptersDeleted()
view.onChaptersDeleted(chapters)
}, ChaptersController::onChaptersDeletedError)
}

View file

@ -5,7 +5,7 @@ import android.view.ViewGroup
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.inflate
class TrackAdapter(controller: TrackController) : androidx.recyclerview.widget.RecyclerView.Adapter<TrackHolder>() {
class TrackAdapter(controller: TrackController) : RecyclerView.Adapter<TrackHolder>() {
var items = emptyList<TrackItem>()
set(value) {