extension fixes
This commit is contained in:
parent
d33568f0ad
commit
5b6e351a56
4 changed files with 33 additions and 10 deletions
|
@ -17,6 +17,7 @@ import android.graphics.drawable.Animatable
|
|||
import android.hardware.SensorManager
|
||||
import android.media.AudioManager
|
||||
import android.media.AudioManager.*
|
||||
import android.media.PlaybackParams
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
|
@ -807,16 +808,15 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
}
|
||||
|
||||
fun fastForward() {
|
||||
val newSpeed = playbackParameters.speed * 2f
|
||||
exoPlayer.playbackParameters = playbackParameters.withSpeed(newSpeed)
|
||||
isFastForwarding = true
|
||||
snackString("Playing at ${newSpeed}x speed")
|
||||
exoPlayer.setPlaybackSpeed(2f)
|
||||
snackString("Playing at 2x speed")
|
||||
}
|
||||
|
||||
fun stopFastForward() {
|
||||
if (isFastForwarding) {
|
||||
exoPlayer.playbackParameters = playbackParameters
|
||||
isFastForwarding = false
|
||||
exoPlayer.setPlaybackSpeed(1f)
|
||||
snackString("Playing at normal speed")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,8 +84,27 @@ class DynamicAnimeParser(extension: AnimeExtension.Installed) : AnimeParser() {
|
|||
try {
|
||||
val res = source.getEpisodeList(sAnime)
|
||||
|
||||
// Sort episodes by episode_number
|
||||
val sortedEpisodes = res.sortedBy { it.episode_number }
|
||||
val sortedEpisodes = if (res[0].episode_number == -1f) {
|
||||
// Find the number in the string and sort by that number
|
||||
val sortedByStringNumber = res.sortedBy {
|
||||
val matchResult = "\\d+".toRegex().find(it.name)
|
||||
val number = matchResult?.value?.toFloat() ?: Float.MAX_VALUE
|
||||
it.episode_number = number // Store the found number in episode_number
|
||||
number
|
||||
}
|
||||
|
||||
// If there is no number, reverse the order and give them an incrementing number
|
||||
var incrementingNumber = 1f
|
||||
sortedByStringNumber.map {
|
||||
if (it.episode_number == Float.MAX_VALUE) {
|
||||
it.episode_number = incrementingNumber++ // Update episode_number with the incrementing number
|
||||
}
|
||||
it
|
||||
}
|
||||
} else {
|
||||
// Sort by the episode_number field
|
||||
res.sortedBy { it.episode_number }
|
||||
}
|
||||
|
||||
// Transform SEpisode objects to Episode objects
|
||||
|
||||
|
@ -167,7 +186,11 @@ class DynamicAnimeParser(extension: AnimeExtension.Installed) : AnimeParser() {
|
|||
sEpisode.episode_number
|
||||
}
|
||||
return Episode(
|
||||
episodeNumberInt.toString(),
|
||||
if(episodeNumberInt.toInt() != -1){
|
||||
episodeNumberInt.toString()
|
||||
}else{
|
||||
sEpisode.name
|
||||
},
|
||||
sEpisode.url,
|
||||
sEpisode.name,
|
||||
null,
|
||||
|
@ -530,7 +553,7 @@ class VideoServerPassthrough(val videoServer: VideoServer) : VideoExtractor() {
|
|||
fileName.endsWith(".mp4", ignoreCase = true) || fileName.endsWith(".mkv", ignoreCase = true) -> VideoType.CONTAINER
|
||||
fileName.endsWith(".m3u8", ignoreCase = true) -> VideoType.M3U8
|
||||
fileName.endsWith(".mpd", ignoreCase = true) -> VideoType.DASH
|
||||
else -> null
|
||||
else -> VideoType.CONTAINER
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
app:abb_indicatorLocation="bottom"
|
||||
app:abb_indicatorMargin="28dp"
|
||||
app:abb_selectedTabType="text"
|
||||
app:abb_tabColor="?attr/colorTertiary"
|
||||
app:abb_tabColor="?attr/colorSecondary"
|
||||
app:abb_tabColorDisabled="?attr/colorPrimaryContainer"
|
||||
app:abb_tabColorSelected="?attr/colorPrimary"
|
||||
app:abb_tabs="@menu/bottom_navbar_menu"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<color name="warning">#FF0000</color>
|
||||
<color name="grey_20">#444444</color>
|
||||
<color name="grey_60">#999999</color>
|
||||
<color name="darkest_Black">#030201</color>
|
||||
<color name="darkest_Black">#000000</color>
|
||||
|
||||
<color name="grey_nav">#E8EDEDED</color>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue