removed prints

This commit is contained in:
reduplicated 2022-11-04 19:17:07 +01:00
parent f77fe0a31e
commit a5cee36572
6 changed files with 4 additions and 8 deletions

View file

@ -338,7 +338,7 @@ object CommonActivity {
PlayerEventType.SkipOp PlayerEventType.SkipOp
} }
KeyEvent.KEYCODE_V, KeyEvent.KEYCODE_NUMPAD_5, KeyEvent.KEYCODE_5 -> { KeyEvent.KEYCODE_V, KeyEvent.KEYCODE_NUMPAD_5, KeyEvent.KEYCODE_5 -> {
PlayerEventType.SkipOp PlayerEventType.SkipCurrentChapter
} }
KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, KeyEvent.KEYCODE_P, KeyEvent.KEYCODE_SPACE, KeyEvent.KEYCODE_NUMPAD_ENTER, KeyEvent.KEYCODE_ENTER -> { // space is not captured due to navigation KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, KeyEvent.KEYCODE_P, KeyEvent.KEYCODE_SPACE, KeyEvent.KEYCODE_NUMPAD_ENTER, KeyEvent.KEYCODE_ENTER -> { // space is not captured due to navigation
PlayerEventType.PlayPauseToggle PlayerEventType.PlayPauseToggle

View file

@ -1039,7 +1039,6 @@ class CS3IPlayer : IPlayer {
override fun addTimeStamps(timeStamps: List<EpisodeSkip.SkipStamp>) { override fun addTimeStamps(timeStamps: List<EpisodeSkip.SkipStamp>) {
lastTimeStamps = timeStamps lastTimeStamps = timeStamps
timeStamps.forEach { timestamp -> timeStamps.forEach { timestamp ->
println("ADDING: $timestamp")
exoPlayer?.createMessage { _, payload -> exoPlayer?.createMessage { _, payload ->
if (payload is EpisodeSkip.SkipStamp) // this should always be true if (payload is EpisodeSkip.SkipStamp) // this should always be true
onTimestampInvoked?.invoke(payload) onTimestampInvoked?.invoke(payload)

View file

@ -186,6 +186,7 @@ class GeneratorPlayer : FullScreenPlayer() {
), ),
) )
} }
player.addTimeStamps(listOf()) // clear stamps
} }
private fun sortLinks(useQualitySettings: Boolean = true): List<Pair<ExtractorLink?, ExtractorUri?>> { private fun sortLinks(useQualitySettings: Boolean = true): List<Pair<ExtractorLink?, ExtractorUri?>> {

View file

@ -121,7 +121,6 @@ class PlayerGeneratorViewModel : ViewModel() {
private var currentStampJob: Job? = null private var currentStampJob: Job? = null
fun loadStamps(duration: Long) { fun loadStamps(duration: Long) {
println("Starting loadStamps with duration = $duration")
//currentStampJob?.cancel() //currentStampJob?.cancel()
currentStampJob = ioSafe { currentStampJob = ioSafe {
val meta = generator?.getCurrent() val meta = generator?.getCurrent()

View file

@ -37,7 +37,7 @@ object EpisodeSkip {
private val cachedStamps = HashMap<Int, List<SkipStamp>>() private val cachedStamps = HashMap<Int, List<SkipStamp>>()
private fun shouldSkipToNextEpisode(endMs: Long, episodeDurationMs: Long): Boolean { private fun shouldSkipToNextEpisode(endMs: Long, episodeDurationMs: Long): Boolean {
return (episodeDurationMs - endMs) < 12_000L return episodeDurationMs - endMs < 12_000L
} }
suspend fun getStamps( suspend fun getStamps(
@ -94,11 +94,8 @@ object AniSkip {
Log.i(TAG, "Requesting $url") Log.i(TAG, "Requesting $url")
val a = app.get(url) val a = app.get(url)
//println("GOT RESPONSE:::.")
val res = a.parsed<AniSkipResponse>() val res = a.parsed<AniSkipResponse>()
Log.i(TAG, "Found ${res.found} with ${res.results?.size} results") Log.i(TAG, "Found ${res.found} with ${res.results?.size} results")
// Log.i("AniSkip", "Response = $res")
if (res.found) res.results else null if (res.found) res.results else null
} catch (t: Throwable) { } catch (t: Throwable) {
Log.i(TAG, "error = ${t.message}") Log.i(TAG, "error = ${t.message}")

View file

@ -334,7 +334,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:strokeColor="@color/white" app:strokeColor="@color/white"
app:strokeWidth="1dp" app:strokeWidth="1dp"
android:text="Skip Opening" /> tools:text="Skip Opening" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"