refactor(ui): improve intent handling and collection view state

- Update `handleStartIntent` and `handleStartPlayer` in `PlayerFragment` to ensure intents are only cleared if successfully handled and stations are valid.
- Refine star icon rendering in `CollectionAdapter` by clearing color filters when appropriate.
- Remove obsolete commented-out code and update log messages in `PlayerFragment`, `PlayerService`, and `LayoutHolder`.
- Uncomment maintenance preference updates in `SettingsFragment`.
- Reformat code for better readability in `CollectionAdapter`.
This commit is contained in:
2026-03-30 10:22:05 +02:00
parent 1eefe1acc4
commit 89b13e152c
6 changed files with 51 additions and 34 deletions
@@ -241,11 +241,6 @@ class PlayerService : MediaLibraryService() {
async(Dispatchers.Default) { FileHelper.readCollectionSuspended(context) }
// wait for result and update collection
collection = deferred.await()
// // special case: trigger metadata view update for stations that have no metadata
// if (player.isPlaying && station.name == getCurrentMetadata()) {
// station = CollectionHelper.getStation(collection, station.uuid)
// updateMetadata(null)
// }
}
}
@@ -429,7 +424,6 @@ class PlayerService : MediaLibraryService() {
currentMediaId,
isPlaying
)
//updatePlayerState(station, playbackState)
if (isPlaying) {
// playback is active
@@ -506,10 +500,6 @@ class PlayerService : MediaLibraryService() {
// try to reconnect every 5 seconds - up to 20 times
if (loadErrorInfo.errorCount <= Keys.DEFAULT_MAX_RECONNECTION_COUNT && loadErrorInfo.exception is HttpDataSource.HttpDataSourceException) {
return Keys.RECONNECTION_WAIT_INTERVAL
// } else {
// CoroutineScope(Main).launch {
// player.stop()
// }
}
return C.TIME_UNSET
}