Merge pull request #751 from OxygenCobalt/hotfixes

Version 3.4.3
This commit is contained in:
Alexander Capehart 2024-04-04 20:53:01 +00:00 committed by GitHub
commit 9f66a05f2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 70 additions and 15 deletions

View file

@ -1,5 +1,15 @@
# Changelog
## dev
#### What's Improved
- Added back option disable ReplayGain for poorly tagged libraries
#### What's Fixed
- Fixed crash when using play next on the end of a queue or with a single-song queue
- Fixed weird behavior if using play next on the end of a queue with repeat all enabled
- Fixed artist choice dialog not showing up on home screen if playing from artist/genre was enabled
## 3.4.2
#### What's Fixed

View file

@ -2,8 +2,8 @@
<h1 align="center"><b>Auxio</b></h1>
<h4 align="center">A simple, rational music player for android.</h4>
<p align="center">
<a href="https://github.com/oxygencobalt/Auxio/releases/tag/v3.4.2">
<img alt="Latest Version" src="https://img.shields.io/static/v1?label=tag&message=v3.4.2&color=64B5F6&style=flat">
<a href="https://github.com/oxygencobalt/Auxio/releases/tag/v3.4.3">
<img alt="Latest Version" src="https://img.shields.io/static/v1?label=tag&message=v3.4.3&color=64B5F6&style=flat">
</a>
<a href="https://github.com/oxygencobalt/Auxio/releases/">
<img alt="Releases" src="https://img.shields.io/github/downloads/OxygenCobalt/Auxio/total.svg?color=4B95DE&style=flat">

View file

@ -21,8 +21,8 @@ android {
defaultConfig {
applicationId namespace
versionName "3.4.2"
versionCode 43
versionName "3.4.3"
versionCode 44
minSdk 24
targetSdk 34

View file

@ -102,7 +102,7 @@ object IntegerTable {
/** Sort.Mode.ByDateAdded */
const val SORT_BY_DATE_ADDED = 0xA118
/** ReplayGainMode.Off (No longer used but still reserved) */
// const val REPLAY_GAIN_MODE_OFF = 0xA110
const val REPLAY_GAIN_MODE_OFF = 0xA110
/** ReplayGainMode.Track */
const val REPLAY_GAIN_MODE_TRACK = 0xA111
/** ReplayGainMode.Album */

View file

@ -75,6 +75,7 @@ import org.oxycblt.auxio.music.PlaylistDecision
import org.oxycblt.auxio.music.PlaylistMessage
import org.oxycblt.auxio.music.Song
import org.oxycblt.auxio.music.external.M3U
import org.oxycblt.auxio.playback.PlaybackDecision
import org.oxycblt.auxio.playback.PlaybackViewModel
import org.oxycblt.auxio.util.collect
import org.oxycblt.auxio.util.collectImmediately
@ -214,12 +215,13 @@ class HomeFragment :
collectImmediately(homeModel.currentTabType, ::updateCurrentTab)
collectImmediately(homeModel.songList, homeModel.isFastScrolling, ::updateFab)
collect(homeModel.speedDialOpen, ::updateSpeedDial)
collect(detailModel.toShow.flow, ::handleShow)
collect(listModel.menu.flow, ::handleMenu)
collectImmediately(listModel.selected, ::updateSelection)
collectImmediately(musicModel.indexingState, ::updateIndexerState)
collect(musicModel.playlistDecision.flow, ::handleDecision)
collect(musicModel.playlistDecision.flow, ::handlePlaylistDecision)
collectImmediately(musicModel.playlistMessage.flow, ::handlePlaylistMessage)
collect(detailModel.toShow.flow, ::handleShow)
collect(playbackModel.playbackDecision.flow, ::handlePlaybackDecision)
}
override fun onResume() {
@ -487,7 +489,7 @@ class HomeFragment :
}
}
private fun handleDecision(decision: PlaylistDecision?) {
private fun handlePlaylistDecision(decision: PlaylistDecision?) {
if (decision == null) return
val directions =
when (decision) {
@ -539,6 +541,20 @@ class HomeFragment :
musicModel.playlistMessage.consume()
}
private fun handlePlaybackDecision(decision: PlaybackDecision?) {
when (decision) {
is PlaybackDecision.PlayFromArtist -> {
findNavController()
.navigateSafe(HomeFragmentDirections.playFromArtist(decision.song.uid))
}
is PlaybackDecision.PlayFromGenre -> {
findNavController()
.navigateSafe(HomeFragmentDirections.playFromGenre(decision.song.uid))
}
null -> {}
}
}
private fun updateFab(songs: List<Song>, isFastScrolling: Boolean) {
updateFabVisibility(songs, isFastScrolling, homeModel.currentTabType.value)
}

View file

@ -70,7 +70,7 @@ class PlayFromArtistDialog :
}
playbackModel.playbackDecision.consume()
pickerModel.setPickerSongUid(args.artistUid)
pickerModel.setPickerSongUid(args.songUid)
collectImmediately(pickerModel.currentPickerSong, ::updateSong)
}

View file

@ -70,7 +70,7 @@ class PlayFromGenreDialog :
}
playbackModel.playbackDecision.consume()
pickerModel.setPickerSongUid(args.genreUid)
pickerModel.setPickerSongUid(args.songUid)
collectImmediately(pickerModel.currentPickerSong, ::updateSong)
}

View file

@ -29,6 +29,8 @@ import org.oxycblt.auxio.R
* @author Alexander Capehart (OxygenCobalt)
*/
enum class ReplayGainMode {
/** Do not apply any ReplayGain adjustments. */
OFF,
/** Apply the track gain, falling back to the album gain if the track gain is not found. */
TRACK,
/** Apply the album gain, falling back to the track gain if the album gain is not found. */
@ -45,6 +47,7 @@ enum class ReplayGainMode {
*/
fun fromIntCode(intCode: Int) =
when (intCode) {
IntegerTable.REPLAY_GAIN_MODE_OFF -> OFF
IntegerTable.REPLAY_GAIN_MODE_TRACK -> TRACK
IntegerTable.REPLAY_GAIN_MODE_ALBUM -> ALBUM
IntegerTable.REPLAY_GAIN_MODE_DYNAMIC -> DYNAMIC

View file

@ -119,6 +119,11 @@ constructor(
// ReplayGain is configurable, so determine what to do based off of the mode.
val resolvedAdjustment =
when (playbackSettings.replayGainMode) {
// User wants no adjustment.
ReplayGainMode.OFF -> {
logD("ReplayGain is off")
null
}
// User wants track gain to be preferred. Default to album gain only if
// there is no track gain.
ReplayGainMode.TRACK -> {

View file

@ -377,7 +377,21 @@ class PlaybackService :
}
override fun playNext(songs: List<Song>, ack: StateAck.PlayNext) {
player.addMediaItems(player.nextMediaItemIndex, songs.map { it.toMediaItem() })
val currTimeline = player.currentTimeline
val nextIndex =
if (currTimeline.isEmpty) {
C.INDEX_UNSET
} else {
currTimeline.getNextWindowIndex(
player.currentMediaItemIndex, Player.REPEAT_MODE_OFF, player.shuffleModeEnabled)
}
if (nextIndex == C.INDEX_UNSET) {
player.addMediaItems(songs.map { it.toMediaItem() })
} else {
player.addMediaItems(nextIndex, songs.map { it.toMediaItem() })
}
playbackManager.ack(this, ack)
deferSave()
}

View file

@ -491,7 +491,7 @@
android:label="play_from_artist_dialog"
tools:layout="@layout/dialog_music_choices">
<argument
android:name="artistUid"
android:name="songUid"
app:argType="org.oxycblt.auxio.music.Music$UID" />
</dialog>
@ -501,7 +501,7 @@
android:label="play_from_genre_dialog"
tools:layout="@layout/dialog_music_choices">
<argument
android:name="genreUid"
android:name="songUid"
app:argType="org.oxycblt.auxio.music.Music$UID" />
</dialog>

View file

@ -139,12 +139,14 @@
</integer-array>
<string-array name="entries_replay_gain">
<item>@string/set_replay_gain_mode_off</item>
<item>@string/set_replay_gain_mode_track</item>
<item>@string/set_replay_gain_mode_album</item>
<item>@string/set_replay_gain_mode_dynamic</item>
</string-array>
<integer-array name="values_replay_gain">
<item>@integer/replay_gain_off</item>
<item>@integer/replay_gain_track</item>
<item>@integer/replay_gain_album</item>
<item>@integer/replay_gain_dynamic</item>
@ -161,6 +163,7 @@
<integer name="play_song_from_genre">0xA122</integer>
<integer name="play_song_by_itself">0xA124</integer>
<integer name="replay_gain_off">0xA110</integer>
<integer name="replay_gain_track">0xA111</integer>
<integer name="replay_gain_album">0xA112</integer>
<integer name="replay_gain_dynamic">0xA113</integer>

View file

@ -290,8 +290,9 @@
<string name="set_repeat_pause_desc">Pause when a song repeats</string>
<string name="set_remember_pause">Remember pause</string>
<string name="set_remember_pause_desc">Remain playing/paused when skipping or editing queue</string>
<string name="set_replay_gain">ReplayGain</string>
<string name="set_replay_gain">Volume normalization</string>
<string name="set_replay_gain_mode">ReplayGain strategy</string>
<string name="set_replay_gain_mode_off">Off</string>
<string name="set_replay_gain_mode_track">Prefer track</string>
<string name="set_replay_gain_mode_album">Prefer album</string>
<string name="set_replay_gain_mode_dynamic">Prefer album if one is playing</string>

View file

@ -0,0 +1,3 @@
Auxio 3.4.0 adds gapless playback and new widget designs, alongside a variety of fixes.
This release fixes issues identified in the previous version.
For more information, see https://github.com/OxygenCobalt/Auxio/releases/tag/v3.4.3

2
media

@ -1 +1 @@
Subproject commit 2cfefb8f39d84412920d17be4ba76ebaabf2d6a6
Subproject commit e585deaa94cc679ab4fd0a653cc1bf67abb54b7e