5.3.1 commit

This commit is contained in:
Xilin Jia 2024-05-18 08:04:15 +01:00
parent c49af77af8
commit ae376422a4
10 changed files with 23 additions and 27 deletions

View File

@ -22,11 +22,6 @@ Apache License 2.0
[com.squareup.okhttp3](https://github.com/square/okhttp/blob/master/LICENSE.txt) Apache License 2.0
<!-- [com.squareup.okio](https://github.com/square/okio/blob/master/LICENSE.txt) Apache License 2.0
-->
[org.greenrobot:eventbus](https://github.com/greenrobot/EventBus/blob/master/LICENSE) Apache License 2.0
[io.reactivex.rxjava2](https://github.com/ReactiveX/RxJava/blob/3.x/LICENSE) Apache License 2.0
[com.joanzapata.iconify](https://github.com/JoanZapata/android-iconify/blob/master/LICENSE.txt) Apache License 2.0

View File

@ -159,8 +159,8 @@ android {
// Version code schema (not used):
// "1.2.3-beta4" -> 1020304
// "1.2.3" -> 1020395
versionCode 3020145
versionName "5.3.0"
versionCode 3020146
versionName "5.3.1"
def commit = ""
try {

View File

@ -36,12 +36,6 @@
website="https://github.com/google/conscrypt"
license="Apache 2.0"
licenseText="LICENSE_APACHE-2.0.txt" />
<library
name="EventBus"
author="greenrobot"
website="https://github.com/greenrobot/EventBus"
license="Apache 2.0"
licenseText="LICENSE_APACHE-2.0.txt" />
<library
name="ExoPlayer"
author="Google"

View File

@ -831,7 +831,7 @@ class PlaybackService : MediaSessionService() {
}
private fun getNextInQueue(currentMedia: Playable?): Playable? {
Logd(TAG, "*** expensive call getNextInQueue currentMedia: ${currentMedia?.getEpisodeTitle()}")
Logd(TAG, "call getNextInQueue currentMedia: ${currentMedia?.getEpisodeTitle()}")
if (currentMedia !is FeedMedia) {
Logd(TAG, "getNextInQueue(), but playable not an instance of FeedMedia, so not proceeding")
writeNoMediaPlaying()

View File

@ -12,7 +12,6 @@ import ac.mdiq.podcini.storage.model.download.DownloadResult
import ac.mdiq.podcini.storage.model.feed.*
import ac.mdiq.podcini.storage.model.feed.FeedItemFilter.Companion.unfiltered
import ac.mdiq.podcini.storage.model.feed.FeedPreferences.Companion.TAG_ROOT
import ac.mdiq.podcini.util.FeedItemPermutors
import ac.mdiq.podcini.util.FeedItemPermutors.getPermutor
import ac.mdiq.podcini.util.Logd
import ac.mdiq.podcini.util.LongList
@ -213,7 +212,6 @@ object DBReader {
val indexMediaId = cursor.getColumnIndexOrThrow(PodDBAdapter.SELECT_KEY_MEDIA_ID)
do {
val item = FeedItemCursorMapper.convert(cursor)
// Log.d(TAG, "extractItemlistFromCursor item ${item.title}")
result.add(item)
if (!cursor.isNull(indexMediaId)) item.setMedia(FeedMediaCursorMapper.convert(cursor))
} while (cursor.moveToNext())
@ -543,18 +541,17 @@ object DBReader {
* @return The FeedItem next in queue or null if the FeedItem could not be found.
*/
fun getNextInQueue(item: FeedItem): FeedItem? {
Logd(TAG, "*** expensive call getNextInQueue() with: itemId = [${item.id}]")
Logd(TAG, "getNextInQueue() with: itemId = [${item.id}]")
val adapter = getInstance()
adapter.open()
try {
var nextItem: FeedItem? = null
try {
// TODO: these calls are expensive
adapter.getNextInQueue(item).use { cursor ->
val list = extractItemlistFromCursor(adapter, cursor)
if (list.isNotEmpty()) {
nextItem = list[0]
loadAdditionalFeedItemListData(list)
loadAdditionalFeedItemListData(listOf(list[0]))
}
return nextItem
}

View File

@ -521,9 +521,7 @@ import java.util.concurrent.TimeUnit
events.add(FlowEvent.QueueEvent.removed(item))
updatedItems.add(item)
queueModified = true
} else {
Log.v(TAG, "removeQueueItem - item not in queue:$itemId")
}
} else Log.e(TAG, "removeQueueItem - item not in queue:$itemId")
}
if (queueModified) {
adapter.setQueue(queue)

View File

@ -245,17 +245,17 @@ import java.util.*
FlowEvent.QueueEvent.Action.REMOVED, FlowEvent.QueueEvent.Action.IRREVERSIBLE_REMOVED -> {
if (event.item != null) {
val position: Int = FeedItemUtil.indexOfItemWithId(queue.toList(), event.item.id)
if (position >= 0) {
queue.removeAt(position)
recyclerAdapter?.notifyItemRemoved(position)
} else Log.e(TAG, "Trying to remove item non-existent from queue ${event.item.id} ${event.item.title}")
}
}
FlowEvent.QueueEvent.Action.CLEARED -> {
queue.clear()
recyclerAdapter?.updateItems(queue)
}
FlowEvent.QueueEvent.Action.MOVED -> return
FlowEvent.QueueEvent.Action.ADDED_ITEMS -> return
FlowEvent.QueueEvent.Action.DELETED_MEDIA -> return
FlowEvent.QueueEvent.Action.MOVED, FlowEvent.QueueEvent.Action.ADDED_ITEMS, FlowEvent.QueueEvent.Action.DELETED_MEDIA -> return
}
recyclerAdapter?.updateDragDropEnabled()
refreshToolbarState()

View File

@ -1,3 +1,8 @@
## 5.3.1
* fixed crash issue on some device when attempting to remove item from queue multiple times
* improved efficiency of getNextInQueue in DBReader
## 5.3.0
* change normal scope to life cycle scope when possible

View File

@ -0,0 +1,5 @@
Version 5.3.1 brings several changes:
* fixed crash issue on some device when attempting to remove item from queue multiple times
* improved efficiency of getNextInQueue in DBReader

View File

@ -4,6 +4,8 @@ android.jetifier.ignorelist=bcprov-jdk15on
android.nonTransitiveRClass=false
android.nonFinalResIds=false
org.gradle.caching=true
org.gradle.jvmargs=-Xmx2048m
android.defaults.buildfeatures.buildconfig=true