Clean up
This commit is contained in:
parent
7c995f14bb
commit
39f3bd2656
8 changed files with 63 additions and 62 deletions
|
@ -13,9 +13,9 @@ I am developing this application in my spare time.
|
|||
|
||||
|
||||
## Screenshots
|
||||
Home | Library | Movie | Season | Episode
|
||||
-----|---------|-------|--------|--------
|
||||
 |  |  |  | 
|
||||
| Home | Library | Movie | Season | Episode |
|
||||
|-------------------------------------|-------------------------------------|---------------------------------|-----------------------------------|-------------------------------------|
|
||||
|  |  |  |  |  |
|
||||
|
||||
## Features
|
||||
- Completely native interface
|
||||
|
|
|
@ -127,7 +127,7 @@ class MPVPlayer(
|
|||
if (requestAudioFocus) {
|
||||
@Suppress("DEPRECATION")
|
||||
audioFocusRequest = audioManager.requestAudioFocus(
|
||||
/* listener= */ this,
|
||||
/* l = */ this,
|
||||
/* streamType = */ AudioManager.STREAM_MUSIC,
|
||||
/* durationHint = */ AudioManager.AUDIOFOCUS_GAIN
|
||||
)
|
||||
|
@ -359,13 +359,12 @@ class MPVPlayer(
|
|||
fun selectTrack(
|
||||
@TrackType trackType: String,
|
||||
id: Int
|
||||
): Boolean {
|
||||
) {
|
||||
if (id != C.INDEX_UNSET) {
|
||||
MPVLib.setPropertyInt(trackType, id)
|
||||
} else {
|
||||
MPVLib.setPropertyString(trackType, "no")
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Timeline wrapper
|
||||
|
@ -1394,6 +1393,7 @@ class MPVPlayer(
|
|||
trackListText.removeFirst()
|
||||
}
|
||||
if (trackListVideo.isNotEmpty()) {
|
||||
trackGroups.add(
|
||||
with(TrackGroup(*trackListVideo.toTypedArray())) {
|
||||
Tracks.Group(
|
||||
this,
|
||||
|
@ -1401,9 +1401,10 @@ class MPVPlayer(
|
|||
IntArray(this.length) { C.FORMAT_HANDLED },
|
||||
BooleanArray(this.length) { it == indexCurrentVideo }
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (trackListAudio.isNotEmpty()) {
|
||||
trackGroups.add(
|
||||
with(TrackGroup(*trackListAudio.toTypedArray())) {
|
||||
Tracks.Group(
|
||||
this,
|
||||
|
@ -1411,9 +1412,10 @@ class MPVPlayer(
|
|||
IntArray(this.length) { C.FORMAT_HANDLED },
|
||||
BooleanArray(this.length) { it == indexCurrentAudio }
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (trackListText.isNotEmpty()) {
|
||||
trackGroups.add(
|
||||
with(TrackGroup(*trackListText.toTypedArray())) {
|
||||
Tracks.Group(
|
||||
this,
|
||||
|
@ -1421,12 +1423,12 @@ class MPVPlayer(
|
|||
IntArray(this.length) { C.FORMAT_HANDLED },
|
||||
BooleanArray(this.length) { it == indexCurrentText }
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (trackGroups.isNotEmpty()) {
|
||||
tracks = Tracks(trackGroups)
|
||||
}
|
||||
} catch (e: JSONException) {
|
||||
} catch (_: JSONException) {
|
||||
}
|
||||
return Pair(mpvTracks, tracks)
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ internal class MediaDetailFragment : Fragment() {
|
|||
// Check icon
|
||||
when (played) {
|
||||
true -> {
|
||||
if (played) binding.checkButton.imageTintList = ColorStateList.valueOf(
|
||||
binding.checkButton.imageTintList = ColorStateList.valueOf(
|
||||
resources.getColor(
|
||||
R.color.red,
|
||||
requireActivity().theme
|
||||
|
|
|
@ -217,11 +217,9 @@ suspend fun syncPlaybackProgress(
|
|||
}
|
||||
|
||||
if (localPlaybackProgress != null) {
|
||||
if (localPlaybackProgress > playbackProgress) {
|
||||
playbackProgress = localPlaybackProgress
|
||||
playedPercentage = localPlayedPercentage!!
|
||||
}
|
||||
}
|
||||
if (remotePlaybackProgress != null) {
|
||||
if (remotePlaybackProgress > playbackProgress) {
|
||||
playbackProgress = remotePlaybackProgress
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.jdtech.jellyfin.utils
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.media.AudioManager
|
||||
import android.provider.Settings
|
||||
import android.view.GestureDetector
|
||||
|
@ -86,6 +87,7 @@ class PlayerGestureHelper(
|
|||
return true
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onScroll(firstEvent: MotionEvent, currentEvent: MotionEvent, distanceX: Float, distanceY: Float): Boolean {
|
||||
if (firstEvent.y < playerView.resources.dip(Constants.GESTURE_EXCLUSION_AREA_TOP))
|
||||
return false
|
||||
|
|
|
@ -130,7 +130,7 @@ constructor(
|
|||
RecommendedServerInfoScore.BAD -> Unit
|
||||
}
|
||||
}
|
||||
} catch (e: CancellationException) {
|
||||
} catch (_: CancellationException) {
|
||||
|
||||
} catch (e: Exception) {
|
||||
_uiState.emit(
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package dev.jdtech.jellyfin.viewmodels
|
||||
|
||||
import androidx.lifecycle.LifecycleCoroutineScope
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
|
|
|
@ -41,7 +41,7 @@ class HomeViewModel @Inject internal constructor(
|
|||
viewModelScope.launch {
|
||||
try {
|
||||
repository.postCapabilities()
|
||||
} catch (e: Exception) {
|
||||
} catch (_: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue