Minor changes

This commit is contained in:
len
2017-01-01 20:54:41 +01:00
parent 3a1699f0b3
commit beca2b429c
3 changed files with 7 additions and 2 deletions
@@ -44,6 +44,11 @@ fun syncChaptersWithSource(db: DatabaseHelper,
// Chapters from the db not in the source.
val toDelete = dbChapters.filterNot { it in sourceChapters }
// Return if there's nothing to add or delete, avoiding unnecessary db transactions.
if (toAdd.isEmpty() && toDelete.isEmpty()) {
return Pair(emptyList(), emptyList())
}
val readded = mutableListOf<Chapter>()
db.inTransaction {