mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Fixes
This commit is contained in:
parent
a388c57563
commit
0e0e346bd0
4 changed files with 13 additions and 13 deletions
|
@ -130,9 +130,9 @@ class DownloadAdapter(
|
|||
downloadButton.setProgress(card.currentBytes, card.totalBytes)
|
||||
downloadButton.applyMetaData(card.child.id, card.currentBytes, card.totalBytes)
|
||||
// We will let the view model handle this
|
||||
downloadButton.setProgressText = false
|
||||
downloadButton.doSetProgress = false
|
||||
downloadHeaderInfo.text = formatShortFileSize(downloadHeaderInfo.context, card.totalBytes)
|
||||
} else downloadButton.setProgressText = true
|
||||
} else downloadButton.doSetProgress = true
|
||||
|
||||
downloadButton.setDefaultClickListener(card.child, downloadHeaderInfo, mediaClickCallback)
|
||||
downloadButton.isVisible = true
|
||||
|
@ -192,9 +192,9 @@ class DownloadAdapter(
|
|||
downloadButton.setProgress(card.currentBytes, card.totalBytes)
|
||||
downloadButton.applyMetaData(d.id, card.currentBytes, card.totalBytes)
|
||||
// We will let the view model handle this
|
||||
downloadButton.setProgressText = false
|
||||
downloadButton.doSetProgress = false
|
||||
downloadChildEpisodeTextExtra.text = formatShortFileSize(downloadChildEpisodeTextExtra.context, card.totalBytes)
|
||||
} else downloadButton.setProgressText = true
|
||||
} else downloadButton.doSetProgress = true
|
||||
|
||||
downloadButton.setDefaultClickListener(d, downloadChildEpisodeTextExtra, mediaClickCallback)
|
||||
downloadButton.isVisible = true
|
||||
|
|
|
@ -57,23 +57,23 @@ abstract class BaseFetchButton(context: Context, attributeSet: AttributeSet) :
|
|||
resetViewData()
|
||||
}
|
||||
|
||||
var doSetProgress = true
|
||||
|
||||
open fun resetViewData() {
|
||||
// lastRequest = null
|
||||
isZeroBytes = true
|
||||
doSetProgress = true
|
||||
persistentId = null
|
||||
}
|
||||
|
||||
var currentMetaData: DownloadMetadata =
|
||||
DownloadMetadata(0, 0, 0, null)
|
||||
|
||||
private var progressSet = false
|
||||
var setProgressText = true
|
||||
|
||||
fun setPersistentId(id: Int) {
|
||||
persistentId = id
|
||||
currentMetaData.id = id
|
||||
|
||||
if (progressSet) return
|
||||
if (!doSetProgress) return
|
||||
|
||||
ioSafe {
|
||||
val savedData = VideoDownloadManager.getDownloadFileInfoAndUpdateSettings(context, id)
|
||||
|
@ -112,7 +112,6 @@ abstract class BaseFetchButton(context: Context, attributeSet: AttributeSet) :
|
|||
}
|
||||
|
||||
open fun setProgress(downloadedBytes: Long, totalBytes: Long) {
|
||||
progressSet = true
|
||||
isZeroBytes = downloadedBytes == 0L
|
||||
progressBar.post {
|
||||
val steps = 10000L
|
||||
|
@ -137,7 +136,7 @@ abstract class BaseFetchButton(context: Context, attributeSet: AttributeSet) :
|
|||
if (isZeroBytes) {
|
||||
progressText?.isVisible = false
|
||||
} else {
|
||||
if (setProgressText) {
|
||||
if (doSetProgress) {
|
||||
progressText?.apply {
|
||||
val currentMbString =
|
||||
Formatter.formatShortFileSize(context, downloadedBytes)
|
||||
|
|
|
@ -301,6 +301,7 @@ open class PieFetchButton(context: Context, attributeSet: AttributeSet) :
|
|||
setStatus(null)
|
||||
currentMetaData = DownloadMetadata(0, 0, 0, null)
|
||||
isZeroBytes = true
|
||||
doSetProgress = true
|
||||
progressBar.progress = 0
|
||||
}
|
||||
|
||||
|
|
|
@ -339,9 +339,9 @@
|
|||
<string name="livestreams">Livestreams</string>
|
||||
<string name="nsfw">NSFW</string>
|
||||
<string name="others">Others</string>
|
||||
<plurals name="episodes">
|
||||
<item quantity="one">Episode</item>
|
||||
<item quantity="other">Episodes</item>
|
||||
<plurals name="episodes" translatable="false">
|
||||
<item quantity="one">@string/episode</item>
|
||||
<item quantity="other">@string/episodes</item>
|
||||
</plurals>
|
||||
<!--singular-->
|
||||
<string name="movies_singular">Movie</string>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue