mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-06 02:40:58 +01:00
Unit tests for PlaybackViewModel & several services (#1592)
## Description This PR contains only tests, there are no user facing changes. Adds tests for playback covering: - Playing next, previous, or within the queue - Media segments (intro/credit) - Playing intros before media Adds basic unit tests for track selection. This uses a new "test track" builder which can model various files and build them as represented (differently) by the server, ExoPlayer, and MPV. In future, this will allow for testing of more complex files. Also add unit tests for services covering things like: - Fetching extras - Deleting media - Server/user management & auth ### Related issues Will help with testing/verifying some issues like #1475, #1548 ### Testing Ran the unit tests! ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
2afac3a1a5
commit
8e0798ee16
14 changed files with 2313 additions and 63 deletions
|
|
@ -24,6 +24,7 @@ import androidx.media3.exoplayer.trackselection.DefaultTrackSelector
|
|||
import androidx.media3.exoplayer.video.MediaCodecVideoRenderer
|
||||
import androidx.media3.exoplayer.video.VideoRendererEventListener
|
||||
import androidx.media3.extractor.DefaultExtractorsFactory
|
||||
import androidx.media3.session.MediaSession
|
||||
import com.github.damontecres.wholphin.preferences.AssPlaybackMode
|
||||
import com.github.damontecres.wholphin.preferences.MediaExtensionStatus
|
||||
import com.github.damontecres.wholphin.preferences.PlaybackPreferences
|
||||
|
|
@ -211,6 +212,11 @@ class PlayerFactory
|
|||
),
|
||||
)
|
||||
}
|
||||
|
||||
fun createMediaSession(player: Player) =
|
||||
MediaSession
|
||||
.Builder(context, player)
|
||||
.build()
|
||||
}
|
||||
|
||||
val Player.isReleased: Boolean
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue