resume fix? + bump

This commit is contained in:
LagradOst 2021-09-04 15:24:37 +02:00
parent 142b800c7b
commit 7dd62737e6
4 changed files with 8 additions and 7 deletions

View file

@ -31,8 +31,8 @@ android {
applicationId "com.lagradost.cloudstream3"
minSdkVersion 21
targetSdkVersion 30
versionCode 18
versionName "1.5.2"
versionCode 19
versionName "1.7.5"
resValue "string", "app_version",
"${defaultConfig.versionName}${versionNameSuffix ?: ""}"

View file

@ -62,7 +62,7 @@ class M3u8Helper {
if (it.quality != null && it.quality <= 1080) it.quality else 0
}.reversed().filter {
it.streamUrl.contains(".m3u8")
// listOf("m3u", "m3u8").contains(absoluteExtensionDetermination(it.streamUrl))
// listOf("m3u", "m3u8").contains(absoluteExtensionDetermination(it.streamUrl))
}
return result.getOrNull(0)
}
@ -118,7 +118,7 @@ class M3u8Helper {
)
fun hlsYield(qualities: List<M3u8Stream>, startIndex: Int = 0): Iterator<HlsDownloadData> {
if (qualities.isEmpty()) return listOf<HlsDownloadData>(HlsDownloadData(byteArrayOf(), 0, 0, true)).iterator()
if (qualities.isEmpty()) return listOf(HlsDownloadData(byteArrayOf(), 0, 0, true)).iterator()
var selected = selectBest(qualities)
if (selected == null) {
@ -156,7 +156,7 @@ class M3u8Helper {
val allTs = TS_EXTENSION_REGEX.findAll(m3u8Data)
val allTsList = allTs.toList()
val totalTs =allTsList .size
val totalTs = allTsList.size
if (totalTs == 0) {
return listOf(HlsDownloadData(byteArrayOf(), 0, 0, true)).iterator()
}

View file

@ -1076,6 +1076,7 @@ object VideoDownloadManager {
if (stream.errorCode != SUCCESS_STREAM) return stream.errorCode
if (!stream.resume!!) realIndex = 0
val fileLengthAdd = stream.fileLength!!
val tsIterator = m3u8Helper.hlsYield(listOf(m3u8), realIndex)
val relativePath = getRelativePath(folder)
@ -1088,7 +1089,7 @@ object VideoDownloadManager {
var isDone = false
var isFailed = false
var isPaused = false
var bytesDownloaded = firstTs.bytes.size.toLong()
var bytesDownloaded = firstTs.bytes.size.toLong() + fileLengthAdd
var tsProgress = 1L + realIndex
val totalTs = firstTs.totalTs.toLong()

View file

@ -143,7 +143,7 @@
<string name="delete_file">Ta bort nerladdad fil</string>
<string name="delete">Ta bort</string>
<string name="delete_message">Denna fil kommer att raderas permanent %s\nÄr du helt säker?</string>
<string name="delete_message">%s kommer att raderas permanent\nÄr du helt säker?</string>
<string name="status_ongoing">Pågående</string>
<string name="status_completed">Färdig</string>