settings: add option to force-reload the app

Add an option to force-reload the app.

Currently, Auxio will load music once and then never re-load it. This
is a really decision I made early on and now regret completely. The
only way to remedy this properly is to create an automatic rescanning
system, but that is a major technical undertaking that I want to save
for later.

Resolves #71.
This commit is contained in:
OxygenCobalt 2022-02-05 10:27:36 -07:00
parent 0a216def1b
commit b047b50411
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
5 changed files with 25 additions and 0 deletions

View file

@ -37,6 +37,7 @@ import org.oxycblt.auxio.home.tabs.TabCustomizeDialog
import org.oxycblt.auxio.playback.PlaybackViewModel import org.oxycblt.auxio.playback.PlaybackViewModel
import org.oxycblt.auxio.settings.pref.IntListPrefDialog import org.oxycblt.auxio.settings.pref.IntListPrefDialog
import org.oxycblt.auxio.settings.pref.IntListPreference import org.oxycblt.auxio.settings.pref.IntListPreference
import org.oxycblt.auxio.util.hardRestart
import org.oxycblt.auxio.util.isNight import org.oxycblt.auxio.util.isNight
import org.oxycblt.auxio.util.logD import org.oxycblt.auxio.util.logD
import org.oxycblt.auxio.util.showToast import org.oxycblt.auxio.util.showToast
@ -165,6 +166,16 @@ class SettingsListFragment : PreferenceFragmentCompat() {
} }
} }
SettingsManager.KEY_RELOAD -> {
onPreferenceClickListener = Preference.OnPreferenceClickListener {
playbackModel.savePlaybackState(requireContext()) {
requireContext().hardRestart()
}
true
}
}
SettingsManager.KEY_EXCLUDED -> { SettingsManager.KEY_EXCLUDED -> {
onPreferenceClickListener = Preference.OnPreferenceClickListener { onPreferenceClickListener = Preference.OnPreferenceClickListener {
ExcludedDialog().show(childFragmentManager, ExcludedDialog.TAG) ExcludedDialog().show(childFragmentManager, ExcludedDialog.TAG)

View file

@ -291,6 +291,7 @@ class SettingsManager private constructor(context: Context) :
const val KEY_LOOP_PAUSE = "KEY_LOOP_PAUSE" const val KEY_LOOP_PAUSE = "KEY_LOOP_PAUSE"
const val KEY_SAVE_STATE = "auxio_save_state" const val KEY_SAVE_STATE = "auxio_save_state"
const val KEY_RELOAD = "auxio_reload"
const val KEY_EXCLUDED = "auxio_excluded_dirs" const val KEY_EXCLUDED = "auxio_excluded_dirs"
const val KEY_SEARCH_FILTER_MODE = "KEY_SEARCH_FILTER" const val KEY_SEARCH_FILTER_MODE = "KEY_SEARCH_FILTER"

View file

@ -103,6 +103,8 @@
<string name="set_content">Content</string> <string name="set_content">Content</string>
<string name="set_save">Save playback state</string> <string name="set_save">Save playback state</string>
<string name="set_save_desc">Save the current playback state now</string> <string name="set_save_desc">Save the current playback state now</string>
<string name="set_reload">Reload music</string>
<string name="set_reload_desc">Reload the music library (Will restart app)</string>
<string name="set_excluded">Excluded folders</string> <string name="set_excluded">Excluded folders</string>
<string name="set_excluded_desc">The content of excluded folders is hidden from your library</string> <string name="set_excluded_desc">The content of excluded folders is hidden from your library</string>

View file

@ -151,6 +151,12 @@
app:summary="@string/set_save_desc" app:summary="@string/set_save_desc"
app:title="@string/set_save" /> app:title="@string/set_save" />
<Preference
app:iconSpaceReserved="false"
app:key="auxio_reload"
app:summary="@string/set_reload_desc"
app:title="@string/set_reload" />
<Preference <Preference
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
app:key="auxio_excluded_dirs" app:key="auxio_excluded_dirs"

View file

@ -30,6 +30,11 @@ This is probably caused by one of two reasons:
This is expected since reading from the audio database takes awhile, especially with libraries containing 10k songs or more. This is expected since reading from the audio database takes awhile, especially with libraries containing 10k songs or more.
#### Auxio does not detect new music!
This is a current limitation with the music loader. To remedy this, go to Settings -> Reload music whenever new songs are added.
I hope to make the loader do this automatically eventually.
#### ReplayGain isn't working on my music! #### ReplayGain isn't working on my music!
This is for a couple reason: This is for a couple reason: