Merge remote-tracking branch 'origin/master' into mergeBack

This commit is contained in:
tzugen 2023-07-31 11:32:10 +02:00
commit 691bfbe594
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
7 changed files with 62 additions and 9 deletions

View File

@ -0,0 +1,15 @@
Features:
- Search is accessible through a new icon on the main screen
- Modernize Back Handling
- Reenable R8 Code minification
- Add a "Play Random Songs" shortcut
Bug fixes:
- Readd the "Star" button to the Now Playing screen
- Fix a rare crash when shuffling playlists with duplicate entries
- Fix a crash when choosing "Play next" on an empty playlist.
- Tracks buttons flash a scrollbar sometimes in Android 13
- Fix EndlessScrolling in genre listing
- Couldn't delete a track when shuffle was active
- Upgrade material to 1.9.0

View File

@ -0,0 +1,15 @@
Features:
- Search is accessible through a new icon on the main screen
- Modernize Back Handling
- Reenable R8 Code minification
- Add a "Play Random Songs" shortcut
Bug fixes:
- Avoid triggering a bug in Supysonic
- Readd the "Star" button to the Now Playing screen
- Fix a rare crash when shuffling playlists with duplicate entries
- Fix a crash when choosing "Play next" on an empty playlist.
- Tracks buttons flash a scrollbar sometimes in Android 13
- Fix EndlessScrolling in genre listing
- Couldn't delete a track when shuffle was active

View File

@ -0,0 +1,15 @@
Features:
- Search is accessible through a new icon on the main screen
- Modernize Back Handling
- Reenable R8 Code minification
- Add a "Play Random Songs" shortcut
Bug fixes:
- Fix a few crashes
- Avoid triggering a bug in Supysonic
- Readd the "Star" button to the Now Playing screen
- Fix a rare crash when shuffling playlists with duplicate entries
- Fix a crash when choosing "Play next" on an empty playlist.
- Tracks buttons flash a scrollbar sometimes in Android 13
- Fix EndlessScrolling in genre listing
- Couldn't delete a track when shuffle was active

View File

@ -9,8 +9,8 @@ android {
defaultConfig {
applicationId "org.moire.ultrasonic"
versionCode 123
versionName "4.6.0"
versionCode 126
versionName "4.6.3"
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk

View File

@ -248,7 +248,10 @@ class MediaPlayerManager(
mediaControllerFuture = MediaController.Builder(
context,
sessionToken
).buildAsync()
)
// Specify mainThread explicitely
.setApplicationLooper(Looper.getMainLooper())
.buildAsync()
mediaControllerFuture?.addListener({
controller = mediaControllerFuture?.get()

View File

@ -12,6 +12,11 @@ import org.moire.ultrasonic.domain.Track
class RxBus {
/**
* IMPORTANT: methods like .delay() or .throttle() will implicitly change the thread to the
* RxComputationScheduler. Always use the function call with the additional arguments of the
* desired scheduler
**/
companion object {
fun mainThread(): Scheduler = AndroidSchedulers.mainThread()
@ -52,7 +57,8 @@ class RxBus {
playerStatePublisher
.replay(1)
.autoConnect(0)
.throttleLatest(300, TimeUnit.MILLISECONDS)
// Need to specify thread, see comment at beginning
.throttleLatest(300, TimeUnit.MILLISECONDS, mainThread())
val playlistPublisher: PublishSubject<List<Track>> =
PublishSubject.create()
@ -64,7 +70,8 @@ class RxBus {
playlistPublisher
.replay(1)
.autoConnect(0)
.throttleLatest(300, TimeUnit.MILLISECONDS)
// Need to specify thread, see comment at beginning
.throttleLatest(300, TimeUnit.MILLISECONDS, mainThread())
val trackDownloadStatePublisher: PublishSubject<TrackDownloadState> =
PublishSubject.create()

View File

@ -235,11 +235,9 @@ class CacheCleaner : CoroutineScope by CoroutineScope(Dispatchers.IO), KoinCompo
private fun findFilesToNotDelete(): Set<String> {
val filesToNotDelete: MutableSet<String> = HashSet(5)
val mediaController = inject<MediaPlayerManager>(
MediaPlayerManager::class.java
)
val mediaPlayerManager: MediaPlayerManager by inject()
val playlist = mainScope.future { mediaController.value.playlist }.get()
val playlist = mainScope.future { mediaPlayerManager.playlist }.get()
for (item in playlist) {
val track = item.toTrack()
filesToNotDelete.add(track.getPartialFile())