This commit is contained in:
Jarne Demeulemeester 2022-09-11 16:42:52 +02:00
parent 7c995f14bb
commit 39f3bd2656
No known key found for this signature in database
GPG key ID: B61B7B150DB6A6D2
8 changed files with 63 additions and 62 deletions

View file

@ -13,9 +13,9 @@ I am developing this application in my spare time.
## Screenshots
Home | Library | Movie | Season | Episode
-----|---------|-------|--------|--------
![Home](images/home-light-dark.png) | ![Library](images/library-dark.png) | ![Movie](images/movie-dark.png) | ![Season](images/season-dark.png) | ![Episode](images/episode-dark.png)
| Home | Library | Movie | Season | Episode |
|-------------------------------------|-------------------------------------|---------------------------------|-----------------------------------|-------------------------------------|
| ![Home](images/home-light-dark.png) | ![Library](images/library-dark.png) | ![Movie](images/movie-dark.png) | ![Season](images/season-dark.png) | ![Episode](images/episode-dark.png) |
## Features
- Completely native interface

View file

@ -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)
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -130,7 +130,7 @@ constructor(
RecommendedServerInfoScore.BAD -> Unit
}
}
} catch (e: CancellationException) {
} catch (_: CancellationException) {
} catch (e: Exception) {
_uiState.emit(

View file

@ -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

View file

@ -41,7 +41,7 @@ class HomeViewModel @Inject internal constructor(
viewModelScope.launch {
try {
repository.postCapabilities()
} catch (e: Exception) {
} catch (_: Exception) {
}
}
}