mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
resume fix? + bump
This commit is contained in:
parent
142b800c7b
commit
7dd62737e6
4 changed files with 8 additions and 7 deletions
|
@ -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 ?: ""}"
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue