fix(android): detekt's file-name, function-count and line-length findings on the DRY batch
release / web (push) Successful in 1m41s
release / go (push) Successful in 2m2s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m22s
release / android (push) Failing after 3m45s
release / Build signed APK (push) Successful in 5m2s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

SendOrQueue.kt is named for its one class, WriteOutcome.kt.
toggleTrackLike becomes an extension on LikesRepository, keeping the
class under the function cap. A long test line is split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 10:27:37 -05:00
co-authored by Claude Opus 5.5
parent bae3421057
commit 6a216a9e84
6 changed files with 13 additions and 9 deletions
@@ -9,6 +9,7 @@ import com.fabledsword.minstrel.connectivity.NetworkStatusController
import com.fabledsword.minstrel.connectivity.recoveries
import com.fabledsword.minstrel.library.data.LibraryRepository
import com.fabledsword.minstrel.likes.data.LikesRepository
import com.fabledsword.minstrel.likes.data.toggleTrackLike
import com.fabledsword.minstrel.models.AlbumDetailRef
import com.fabledsword.minstrel.models.AlbumRef
import com.fabledsword.minstrel.nav.AlbumDetail
@@ -151,14 +151,6 @@ class LikesRepository @Inject constructor(
// ── Writes (optimistic local → best-effort REST → enqueue on fail) ──
/**
* Flips a track's like, reading whether it is liked now from [likedIds],
* the set the screen is already showing. The heart buttons on track lists
* (an album, a playlist, the player) call this.
*/
suspend fun toggleTrackLike(trackId: String, likedIds: Set<String>): Boolean =
toggleLike(ENTITY_TRACK, trackId, desiredState = trackId !in likedIds)
/**
* Toggle like state for [entityType]/[entityId]. UI doesn't need to
* await this; the Flow re-emits immediately from the optimistic
@@ -254,3 +246,11 @@ class LikesRepository @Inject constructor(
}
}
}
/**
* Flips a track's like, reading whether it is liked now from [likedIds], the
* set the screen is already showing. The heart buttons on track lists (an
* album, a playlist, the player) call this.
*/
suspend fun LikesRepository.toggleTrackLike(trackId: String, likedIds: Set<String>): Boolean =
toggleLike(LikesRepository.ENTITY_TRACK, trackId, desiredState = trackId !in likedIds)
@@ -3,6 +3,7 @@ package com.fabledsword.minstrel.player.ui
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.fabledsword.minstrel.likes.data.LikesRepository
import com.fabledsword.minstrel.likes.data.toggleTrackLike
import com.fabledsword.minstrel.player.PlayerController
import com.fabledsword.minstrel.player.PlayerUiState
import dagger.hilt.android.lifecycle.HiltViewModel
@@ -66,6 +66,7 @@ import com.fabledsword.minstrel.connectivity.NetworkStatusController
import com.fabledsword.minstrel.connectivity.recoveries
import com.fabledsword.minstrel.events.EventsStream
import com.fabledsword.minstrel.events.LiveEvent
import com.fabledsword.minstrel.likes.data.toggleTrackLike
import com.fabledsword.minstrel.models.PlaylistRef
import com.fabledsword.minstrel.models.PlaylistTrackRef
import com.fabledsword.minstrel.models.TrackRef