Skip to content

Commit f56111b

Browse files
Enable the new return-value-checker=full (#3271)
1 parent 4895aa1 commit f56111b

File tree

11 files changed

+15
-10
lines changed

11 files changed

+15
-10
lines changed

core/data/api/src/main/kotlin/voice/core/data/repo/BookmarkRepo.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public interface BookmarkRepo {
99

1010
public suspend fun addBookmark(bookmark: Bookmark)
1111

12+
@IgnorableReturnValue
1213
public suspend fun addBookmarkAtBookPosition(
1314
book: Book,
1415
title: String?,

core/data/impl/src/main/kotlin/voice/core/data/repo/BookContentRepoImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class BookContentRepoImpl(private val dao: BookContentDao) : BookContentR
6666
content.copy(isActive = content.id in ids)
6767
}
6868
}!!
69-
.onEach { dao.insert(it) }
69+
.forEach { dao.insert(it) }
7070
}
7171

7272
override suspend fun put(content: BookContent) {

core/data/impl/src/main/kotlin/voice/core/data/repo/internals/migrations/Migration24to25.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ public class Migration24to25 : IncrementalMigration(24) {
7979
var playingInformation: JSONObject? = null
8080
try {
8181
if (configFileValid) {
82-
configFile.readText(Charsets.UTF_8)
8382
val retString = configFile.readText(Charsets.UTF_8)
8483
if (retString.isNotEmpty()) {
8584
playingInformation = JSONObject(retString)
@@ -179,7 +178,7 @@ public class Migration24to25 : IncrementalMigration(24) {
179178
if (name.isEmpty()) {
180179
name = if (chapterPaths.size == 1) {
181180
val chapterPath = chapterPaths.first()
182-
chapterPath.substring(0, chapterPath.lastIndexOf("."))
181+
chapterPath.take(chapterPath.lastIndexOf("."))
183182
} else {
184183
File(root).name
185184
}

core/data/impl/src/main/kotlin/voice/core/data/repo/internals/transaction.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package voice.core.data.repo.internals
22

33
import androidx.sqlite.db.SupportSQLiteDatabase
44

5+
@IgnorableReturnValue
56
internal inline fun <T> SupportSQLiteDatabase.transaction(
67
exclusive: Boolean = true,
78
body: SupportSQLiteDatabase.() -> T,

core/playback/src/main/kotlin/voice/core/playback/PlayerController.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class PlayerController(
164164
}
165165
}
166166

167+
@IgnorableReturnValue
167168
suspend fun awaitConnect(): MediaController? {
168169
return try {
169170
controller.await()

core/playback/src/main/kotlin/voice/core/playback/player/VoicePlayer.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,12 @@ class VoicePlayer(
345345
}
346346
}
347347

348-
fun setSkipSilenceEnabled(enabled: Boolean): Boolean {
348+
fun setSkipSilenceEnabled(enabled: Boolean) {
349349
scope.launch {
350350
updateBook { it.copy(skipSilence = enabled) }
351351
}
352-
return if (player is ExoPlayer) {
352+
if (player is ExoPlayer) {
353353
player.skipSilenceEnabled = enabled
354-
true
355-
} else {
356-
false
357354
}
358355
}
359356

core/playback/src/test/kotlin/voice/core/playback/player/VoicePlayerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class VoicePlayerTest {
6969
val chapter = currentBook.chapters.single {
7070
it.id == (mediaId.toMediaIdOrNull()!! as MediaId.Chapter).chapterId
7171
}
72-
chapter.duration
7372
FakeMediaSource(
7473
FakeTimeline(
7574
FakeTimeline.TimelineWindowDefinition.Builder()
@@ -334,6 +333,7 @@ class VoicePlayerTest {
334333
TestPlayerRunHelper.runUntilPlaybackState(internalPlayer, Player.STATE_READY)
335334
}
336335

336+
@IgnorableReturnValue
337337
private fun Player.shouldHavePosition(
338338
currentMediaItemIndex: Int,
339339
currentPosition: Long,

core/scanner/src/main/kotlin/voice/core/scanner/BookParser.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ internal fun validateIntegrity(
8080
chapters: List<Chapter>,
8181
) {
8282
// the init block performs integrity validation
83+
@Suppress("RETURN_VALUE_NOT_USED")
8384
Book(content, chapters)
8485
}
8586

core/scanner/src/test/kotlin/voice/core/scanner/MediaScannerTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class MediaScannerTest {
221221
scanner.scan(mapOf(type to roots.map(::FileBasedDocumentFile)))
222222
}
223223

224+
@IgnorableReturnValue
224225
fun audioFile(
225226
parent: File,
226227
name: String,

core/search/src/test/kotlin/voice/core/search/BookSearchTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ private class TestBase(private val search: BookSearch) {
190190
}
191191

192192
suspend fun search(query: String) {
193+
@Suppress("RETURN_VALUE_NOT_USED")
193194
search.search(query)
194195
}
195196
}

0 commit comments

Comments
 (0)