File tree Expand file tree Collapse file tree 11 files changed +15
-10
lines changed
api/src/main/kotlin/voice/core/data/repo
impl/src/main/kotlin/voice/core/data/repo
main/kotlin/voice/core/playback
test/kotlin/voice/core/playback/player
main/kotlin/voice/core/scanner
test/kotlin/voice/core/scanner
search/src/test/kotlin/voice/core/search Expand file tree Collapse file tree 11 files changed +15
-10
lines changed Original file line number Diff line number Diff 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? ,
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package voice.core.data.repo.internals
22
33import androidx.sqlite.db.SupportSQLiteDatabase
44
5+ @IgnorableReturnValue
56internal inline fun <T > SupportSQLiteDatabase.transaction (
67 exclusive : Boolean = true,
78 body : SupportSQLiteDatabase .() -> T ,
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ class PlayerController(
164164 }
165165 }
166166
167+ @IgnorableReturnValue
167168 suspend fun awaitConnect (): MediaController ? {
168169 return try {
169170 controller.await()
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments