Merge branch 'master' of github.com:OxygenCobalt/Auxio into dev

This commit is contained in:
Alexander Capehart
2025-06-23 12:54:55 -06:00
8 changed files with 35 additions and 5 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ android {
defaultConfig {
applicationId namespace
versionName "4.0.5"
versionCode 64
versionName "4.0.6"
versionCode 65
minSdk min_sdk
targetSdk target_sdk
@@ -42,6 +42,7 @@ import org.oxycblt.musikr.Song
import org.oxycblt.musikr.Storage
import org.oxycblt.musikr.cache.MutableCache
import org.oxycblt.musikr.fs.mediastore.MediaStoreFS
import org.oxycblt.musikr.fs.saf.SAF
import org.oxycblt.musikr.playlist.db.StoredPlaylists
import org.oxycblt.musikr.tag.interpret.Naming
import org.oxycblt.musikr.tag.interpret.Separators
@@ -394,8 +395,7 @@ constructor(
val newRevision = currentRevision?.takeIf { withCache } ?: UUID.randomUUID()
val cache = if (withCache) cache else WriteOnlyMutableCache(cache)
val covers = settingCovers.mutate(context, newRevision)
// val fs = SAF.from(context, SAF.Query(locations, excludedLocations, withHidden))
val fs = MediaStoreFS.from(context)
val fs = SAF.from(context, SAF.Query(locations, excludedLocations, withHidden))
val storage = Storage(cache, covers, storedPlaylists)
val interpretation = Interpretation(nameFactory, separators)
val config = Config(fs, storage, interpretation)
@@ -51,6 +51,8 @@ interface MusicSettings : Settings<MusicSettings.Listener> {
var separators: String
/** Whether to enable more advanced sorting by articles and numbers. */
val intelligentSorting: Boolean
/** Whether to use the file-system cache for improved loading times. */
val useFileTreeCache: Boolean
interface Listener {
/** Called when the current music locations changed. */
@@ -133,6 +135,9 @@ class MusicSettingsImpl @Inject constructor(@ApplicationContext private val cont
override val intelligentSorting: Boolean
get() = sharedPreferences.getBoolean(getString(R.string.set_key_auto_sort_names), true)
override val useFileTreeCache: Boolean
get() = sharedPreferences.getBoolean(getString(R.string.set_key_fs_cache), false)
override fun onSettingChanged(key: String, listener: MusicSettings.Listener) {
// TODO: Differentiate "hard reloads" (Need the cache) and "Soft reloads"
// (just need to manipulate data)
@@ -145,7 +150,8 @@ class MusicSettingsImpl @Inject constructor(@ApplicationContext private val cont
getString(R.string.set_key_separators),
getString(R.string.set_key_auto_sort_names),
getString(R.string.set_key_with_hidden),
getString(R.string.set_key_exclude_non_music) -> {
getString(R.string.set_key_exclude_non_music),
getString(R.string.set_key_fs_cache) -> {
L.d("Dispatching indexing setting change for $key")
listener.onIndexingSettingChanged()
}
+1
View File
@@ -15,6 +15,7 @@
<string name="set_key_observing" translatable="false">auxio_observing</string>
<string name="set_key_music_dirs" translatable="false">auxio_music_dirs</string>
<string name="set_key_excluded_dirs" translatable="false">auxio_excluded_dirs</string>
<string name="set_key_fs_cache" translatable="false">auxio_fs_cache</string>
<string name="set_key_cover_mode" translatable="false">auxio_cover_mode2</string>
<string name="set_key_square_covers" translatable="false">auxio_square_covers</string>
<string name="set_key_exclude_non_music" translatable="false">auxio_exclude_non_music</string>
+2
View File
@@ -315,6 +315,8 @@
<string name="set_locations">Music folders</string>
<string name="set_locations_desc">Manage where music should be loaded from</string>
<string name="set_locations_new">New folder</string>
<string name="set_fs_cache">Use file-system cache</string>
<string name="set_fs_cache_desc">Improves loading times, but can prevent new music from being added</string>
<string name="set_excluded_locations">Excluded folders</string>
<string name="set_excluded_locations_desc">Manage folders to exclude from music loading</string>
<string name="set_reindex">Refresh music</string>
@@ -38,6 +38,13 @@
app:summary="@string/set_excluded_locations_desc"
app:title="@string/set_excluded_locations" />
<SwitchPreferenceCompat
app:key="@string/set_key_fs_cache"
app:summary="@string/set_fs_cache_desc"
app:title="@string/set_fs_cache"
app:defaultValue="false" />
<Preference
app:key="@string/set_key_reindex"
app:summary="@string/set_reindex_desc"