Skip to content

Commit

Permalink
6.11.6 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed Oct 18, 2024
1 parent ca6afe3 commit 29f7c6c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ android {
testApplicationId "ac.mdiq.podcini.tests"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

versionCode 3020275
versionName "6.11.5"
versionCode 3020276
versionName "6.11.6"

applicationId "ac.mdiq.podcini.R"
def commit = ""
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/kotlin/ac/mdiq/podcini/storage/model/Episode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ class Episode : RealmObject {
val imageLocation: String?
get() = when {
imageUrl != null -> imageUrl
media != null && media?.hasEmbeddedPicture() == true -> EpisodeMedia.FILENAME_PREFIX_EMBEDDED_COVER + media!!.getLocalMediaUrl()
feed != null -> {
feed!!.imageUrl
}
// TODO: this can be very expensive for list
// media != null && media?.hasEmbeddedPicture() == true -> EpisodeMedia.FILENAME_PREFIX_EMBEDDED_COVER + media!!.getLocalMediaUrl()
feed != null -> feed!!.imageUrl
else -> null
}

Expand Down
22 changes: 14 additions & 8 deletions app/src/main/kotlin/ac/mdiq/podcini/ui/compose/EpisodesVM.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ import androidx.compose.ui.window.Dialog
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.documentfile.provider.DocumentFile
import coil.compose.rememberAsyncImagePainter
import coil.request.CachePolicy
import coil.request.ImageRequest
import io.realm.kotlin.notifications.SingleQueryChange
import io.realm.kotlin.notifications.UpdatedObject
import kotlinx.coroutines.*
Expand Down Expand Up @@ -326,6 +328,7 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
val lazyListState = rememberLazyListState()
var longPressIndex by remember { mutableIntStateOf(-1) }
val dls = remember { DownloadServiceInterface.get() }
val context = LocalContext.current

val showConfirmYoutubeDialog = remember { mutableStateOf(false) }
val youtubeUrls = remember { mutableListOf<String>() }
Expand Down Expand Up @@ -588,19 +591,24 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
}
val textColor = MaterialTheme.colorScheme.onSurface
Column {
val dur = vm.episode.media?.getDuration() ?: 0
val durText = DurationConverter.getDurationStringLong(dur)
val dur = remember { vm.episode.media?.getDuration() ?: 0 }
val durText = remember { DurationConverter.getDurationStringLong(dur) }
Row(Modifier.background(if (vm.isSelected) MaterialTheme.colorScheme.secondaryContainer else MaterialTheme.colorScheme.surface)) {
if (false) {
val typedValue = TypedValue()
LocalContext.current.theme.resolveAttribute(R.attr.dragview_background, typedValue, true)
Icon(painter = painterResource(typedValue.resourceId), tint = textColor, contentDescription = "drag handle",
modifier = Modifier.width(16.dp).align(Alignment.CenterVertically))
}
Logd(TAG, "episode.imageUrl: ${vm.episode.imageUrl}")
ConstraintLayout(modifier = Modifier.width(56.dp).height(56.dp)) {
val (imgvCover, checkMark) = createRefs()
val imgLoc = ImageResourceUtils.getEpisodeListImageLocation(vm.episode)
val painter = rememberAsyncImagePainter(model = imgLoc)
val imgLoc = remember { ImageResourceUtils.getEpisodeListImageLocation(vm.episode) }
Logd(TAG, "imgLoc: $imgLoc")
val painter = rememberAsyncImagePainter(model = ImageRequest.Builder(context).data(imgLoc)
.memoryCachePolicy(CachePolicy.ENABLED)
.placeholder(R.mipmap.ic_launcher)
.error(R.mipmap.ic_launcher).build())
Image(painter = painter, contentDescription = "imgvCover",
modifier = Modifier.width(56.dp).height(56.dp)
.constrainAs(imgvCover) {
Expand All @@ -614,9 +622,7 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
})
)
val alpha = if (vm.playedState) 1.0f else 0f
if (vm.playedState) Icon(painter = painterResource(R.drawable.ic_check),
tint = textColor,
contentDescription = "played_mark",
if (vm.playedState) Icon(painter = painterResource(R.drawable.ic_check), tint = textColor, contentDescription = "played_mark",
modifier = Modifier.background(Color.Green).alpha(alpha).constrainAs(checkMark) {
bottom.linkTo(parent.bottom)
end.linkTo(parent.end)
Expand Down Expand Up @@ -700,7 +706,7 @@ fun EpisodeLazyColumn(activity: MainActivity, vms: SnapshotStateList<EpisodeVM>,
if (vm.showAltActionsDialog) vm.actionButton?.AltActionsDialog(activity, vm.showAltActionsDialog,
onDismiss = { vm.showAltActionsDialog = false })
}
if (InTheatre.isCurMedia(vm.episode.media) || vm.inProgressState) {
if (vm.inProgressState || InTheatre.isCurMedia(vm.episode.media)) {
val pos = vm.positionState
vm.prog = if (dur > 0 && pos >= 0 && dur >= pos) 1.0f * pos / dur else 0f
Logd(TAG, "$index vm.prog: ${vm.prog}")
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 6.11.6

* fixed a serious performance issue when scrolling list of episode having no defined image url

# 6.11.5

* back to be built to target Android 15
Expand Down
3 changes: 3 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/3020276.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version 6.11.5

* fixed a serious performance issue when scrolling list of episode having no defined image url

0 comments on commit 29f7c6c

Please sign in to comment.