Skip to content

Commit

Permalink
5.3.1 commit
Browse files Browse the repository at this point in the history
  • Loading branch information
XilinJia committed May 18, 2024
1 parent c49af77 commit ae37642
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 27 deletions.
5 changes: 0 additions & 5 deletions Licenses_and_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/assets/licenses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 2 additions & 5 deletions app/src/main/java/ac/mdiq/podcini/storage/DBReader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/ac/mdiq/podcini/storage/DBWriter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/ac/mdiq/podcini/ui/fragment/QueueFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
queue.removeAt(position)
recyclerAdapter?.notifyItemRemoved(position)
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()
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/3020146.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ae37642

Please sign in to comment.