mirror of
https://github.com/Michatec/Radio.git
synced 2026-05-31 06:32:39 +02:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user