diff --git a/CHANGELOG.md b/CHANGELOG.md index f05f3f5fd..bfe8ad8c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 4.0.7 + +#### What's New +- The MediaStore backend is back, enabling faster loading at without a file manager +the cost of reliability. +- All of the loading options added prior have been consolidated into a single +"music sources" dialog + +#### Date Added +- Date added now reflects FileSystem date added + +#### What's Fixed +- Fixed playlist songs incorrectly updating when resorting +- Fixed artists without songs having enabled play/pause toolbar options + ## 4.0.6 #### What's Improved diff --git a/CLAUDE.md b/CLAUDE.md index 7ebb3c146..53bcc322b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,120 +4,162 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project Overview -Auxio is a modern Android music player written in Kotlin that emphasizes simplicity and performance. It uses Media3 ExoPlayer for playback and includes a custom native music indexing library called musikr. +Auxio is a simple, rational music player for Android built on Media3 ExoPlayer. It features gapless playback, ReplayGain support, Android Auto integration, and advanced music indexing capabilities. -## Build System & Commands +## Essential Build Commands ### Prerequisites -- `cmake` and `ninja-build` must be installed before building -- Project uses git submodules - clone with `git clone --recurse-submodules` -- **Cannot build on Windows** - requires Unix-based system for Media3 build scripts +- Unix-based system (cannot build on Windows) +- Install `cmake` and `ninja-build` +- Clone with submodules: `git clone --recurse-submodules` -### Common Build Commands +### Build Commands ```bash -# Build debug version +# Build debug APK ./gradlew assembleDebug -# Build release version +# Build release APK ./gradlew assembleRelease -# Run tests -./gradlew test +# Clean build +./gradlew clean build -# Run connected tests -./gradlew connectedAndroidTest - -# Code formatting (Spotless) -./gradlew spotlessApply - -# Check code formatting -./gradlew spotlessCheck +# Install debug build on device +./gradlew installDebug ``` -### Development Modules -- `app/` - Main Android application -- `musikr/` - Native music indexing library with TagLib integration -- `media/` - Patched Media3 ExoPlayer libraries (git submodule) +### Code Quality Commands +```bash +# Check code formatting (MUST pass before committing) +./gradlew spotlessCheck + +# Apply code formatting fixes +./gradlew spotlessApply + +# Run Android lint +./gradlew lint + +# Run lint with automatic fixes +./gradlew lintFix +``` + +### Testing Commands +```bash +# Run unit tests +./gradlew test + +# Run debug unit tests +./gradlew testDebugUnitTest + +# Run musikr module tests specifically +./gradlew musikr:testDebug + +# Run instrumentation tests (requires device/emulator) +./gradlew connectedAndroidTest +``` + +### Development Workflow +```bash +# Before committing: format code and run checks +./gradlew spotlessApply +./gradlew check + +# Run a single test class +./gradlew test --tests "org.oxycblt.auxio.YourTestClass" + +# Run a single test method +./gradlew test --tests "org.oxycblt.auxio.YourTestClass.yourTestMethod" +``` ## Architecture Overview -### Core Architecture Pattern -- **MVVM** with ViewModels for each major screen (Home, Detail, Playback, Search) -- **Repository Pattern** - MusicRepository as single source of truth for music data -- **Dependency Injection** - Hilt/Dagger for modular dependency management -- **Single Activity Architecture** with Navigation Components -- **Service-Oriented** background music processing +### High-Level Architecture +- **Pattern**: MVVM (Model-View-ViewModel) with Dagger Hilt dependency injection +- **Navigation**: Single Activity architecture with Navigation Component +- **UI**: Material Design 3 with edge-to-edge display +- **Data**: Repository pattern with Room database and custom Musikr library +- **Playback**: MediaBrowserServiceCompat with vendored Media3/ExoPlayer -### Key Modules & Components +### Key Components -#### Music Management (`app/src/main/java/org/oxycblt/auxio/music/`) -- `MusicRepository` - Central music library state management -- `MusicViewModel` - UI layer for music data access -- `service/` - MediaBrowserServiceCompat integration -- `shim/` - Abstraction layer for musikr integration +#### Service Architecture +- `AuxioService` - Main MediaBrowserService for background playback +- `PlaybackServiceFragment` - Handles all playback operations +- `MusicServiceFragment` - Manages music browsing and library -#### Playback Engine (`app/src/main/java/org/oxycblt/auxio/playback/`) -- `PlaybackViewModel` - Main playback UI interface -- `PlaybackStateManager` - Core playback state management -- `service/` - Background ExoPlayer integration -- `queue/` - Playback queue management -- `persist/` - Playback state persistence (Room database) -- `replaygain/` - Audio processing for volume normalization +#### Data Layer +- `MusicRepository` - Primary interface for music data access +- `PersistenceRepository` - Handles playback state and playlists +- `Musikr` - Custom music indexing library (separate module) + - Bypasses MediaStore limitations + - Supports advanced metadata and tags + - Background indexing with progress -#### UI Structure (`app/src/main/java/org/oxycblt/auxio/`) -- `home/` - Main library browsing with customizable tabs -- `detail/` - Album, artist, genre, and playlist detail views -- `search/` - Music search functionality -- `list/` - Shared list components with sorting/filtering -- `ui/` - Custom UI components, theming, animations +#### UI Layer Structure +``` +app/src/main/java/org/oxycblt/auxio/ +├── MainActivity.kt # Single activity host +├── MainFragment.kt # Main container with bottom sheets +├── home/ # Home screen tabs (songs, albums, artists, etc.) +├── detail/ # Detail screens for albums/artists +├── playback/ # Playback UI and controls +├── search/ # Search functionality +├── settings/ # Preferences screens +├── list/ # Reusable list components +└── music/ # Music data models and repository +``` -#### Native Music Library (`musikr/`) -- **Pipeline-based indexing** - Multi-stage scanning (Explore → Extract → Evaluate) -- **TagLib integration** - Native C++ metadata extraction -- **File system caching** - Device storage access optimization -- **Cover art management** - Embedded and external cover support +#### State Management +- StateFlow/MutableStateFlow for reactive state +- Shared ViewModels between fragments +- Event wrapper pattern for one-time UI events +- Lifecycle-aware observers -### Data Flow -1. musikr scans and indexes music files from device storage -2. MusicRepository manages indexed library and exposes to UI -3. ViewModels provide reactive state for UI components using StateFlow -4. PlaybackService handles audio playback via ExoPlayer -5. UI observes ViewModels and updates reactively +### Navigation Flow +1. `MainActivity` hosts all navigation +2. Two navigation graphs: `inner.xml` (main) and `outer.xml` (onboarding) +3. Bottom sheet for playback UI +4. Dialog destinations for popups -## Code Conventions +### Dependency Injection Setup +- `@HiltAndroidApp` on Auxio application class +- `@AndroidEntryPoint` on activities/fragments +- Modules: `MusicModule`, `PlaybackModule`, `UIModule` +- Scoped with `@Singleton` for app-wide instances -### Language & Libraries -- **Kotlin** - Primary language with coroutines for async operations -- **Hilt/Dagger** - Dependency injection -- **Room** - Local database for persistence -- **Navigation Components** - Fragment navigation -- **ViewBinding** - Type-safe view access -- **StateFlow/LiveData** - Reactive state management -- **Coil** - Image loading for cover art +## Important Development Notes ### Code Style -- Uses Spotless with ktfmt Dropbox style formatting -- License header required (see NOTICE file) -- C++ code uses Eclipse CDT formatting (eclipse-cdt.xml) +- Kotlin code formatted with ktfmt (Dropbox style) +- C++ code uses Eclipse CDT formatting +- Spotless enforces formatting automatically +- License headers required (enforced by Spotless) -## Testing +### Git Workflow +- Default branch: `dev` (development) +- PRs should target `dev` branch +- `master` contains stable releases only -### Test Structure -- Unit tests: `src/test/` directories -- Integration tests: `src/androidTest/` directories -- musikr module includes Robolectric tests +### Architectural Constraints +- Stick to F-Droid inclusion guidelines +- No proprietary dependencies +- Feature additions unlikely to be accepted +- Major UI changes discouraged -### Test Dependencies -- JUnit 4 for unit testing -- MockK for mocking -- Robolectric for Android unit tests -- Espresso for UI tests +### Testing Requirements +- Test all changes thoroughly +- Unit tests for business logic +- Consider edge cases for music metadata +- Test on different Android versions (min SDK 24) -## Key Development Notes +### Key Libraries +- AndroidX Navigation, Room, Media3 +- Dagger Hilt for DI +- Kotlin Coroutines for async +- Coil for image loading +- Material Design Components 3 -- **Custom Media3**: Uses patched Media3 ExoPlayer for enhanced playback features -- **Native Dependencies**: musikr module builds TagLib from source during compilation -- **Permission Handling**: Requires storage permissions for music file access -- **Background Services**: Foreground service for continuous music playback -- **Widget Support**: Multiple widget layouts with automatic sizing adaptation -- **ReplayGain**: Full support for MP3, FLAC, OGG, OPUS, and MP4 files \ No newline at end of file +### Custom Modifications +- Vendored/patched Media3 in `media/` directory +- Custom patches for ExoPlayer features +- Modified libraries shouldn't be updated directly \ No newline at end of file diff --git a/README.md b/README.md index b99e6d825..c84a81dc3 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@

Auxio

A simple, rational music player for android.

- - Latest Version + + Latest Version Releases diff --git a/app/build.gradle b/app/build.gradle index e12d5daf3..ce3b02c97 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,8 +18,8 @@ android { defaultConfig { applicationId namespace - versionName "4.0.6" - versionCode 65 + versionName "4.0.7" + versionCode 66 minSdk min_sdk targetSdk target_sdk diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ecdfc44e2..2d0499edd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,9 @@ + + + diff --git a/app/src/main/java/org/oxycblt/auxio/IntegerTable.kt b/app/src/main/java/org/oxycblt/auxio/IntegerTable.kt index 6ea713010..e4b075a96 100644 --- a/app/src/main/java/org/oxycblt/auxio/IntegerTable.kt +++ b/app/src/main/java/org/oxycblt/auxio/IntegerTable.kt @@ -145,4 +145,12 @@ object IntegerTable { const val COVER_MODE_SAVE_SPACE = 0xA125 /** CoverMode.AsIs */ const val COVER_MODE_AS_IS = 0xA126 + /** LocationMode.SAF */ + const val LOCATION_MODE_SAF = 0xA127 + /** LocationMode.MediaStore */ + const val LOCATION_MODE_MEDIA_STORE = 0xA128 + /** LocationMode.FileSystem */ + const val FILTER_MODE_INCLUDE = 0xA129 + /** LocationMode.FileSystem */ + const val FILTER_MODE_EXCLUDE = 0xA12A } diff --git a/app/src/main/java/org/oxycblt/auxio/detail/ArtistDetailFragment.kt b/app/src/main/java/org/oxycblt/auxio/detail/ArtistDetailFragment.kt index f2db3bab5..8f672344f 100644 --- a/app/src/main/java/org/oxycblt/auxio/detail/ArtistDetailFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/detail/ArtistDetailFragment.kt @@ -149,8 +149,10 @@ class ArtistDetailFragment : DetailFragment() { // In the case that this header used to he configured to have no songs, // we want to reset the visibility of all information that was hidden. - binding.detailPlayButton?.isVisible = true - binding.detailShuffleButton?.isVisible = true + binding.detailPlayButton?.isEnabled = true + binding.detailShuffleButton?.isEnabled = true + binding.detailToolbarPlay.isEnabled = true + binding.detailToolbarShuffle.isEnabled = true } else { // The artist does not have any songs, so hide functionality that makes no sense. // ex. Play and Shuffle, Song Counts, and Genre Information. @@ -159,6 +161,8 @@ class ArtistDetailFragment : DetailFragment() { binding.detailSubhead.isVisible = false binding.detailPlayButton?.isEnabled = false binding.detailShuffleButton?.isEnabled = false + binding.detailToolbarPlay.isEnabled = false + binding.detailToolbarShuffle.isEnabled = false } binding.detailPlayButton?.setOnClickListener { diff --git a/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt b/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt index eb8a00786..4bdb7d3f3 100644 --- a/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt +++ b/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt @@ -471,7 +471,7 @@ constructor( fun applyPlaylistSongSort(sort: Sort) { val playlist = _currentPlaylist.value ?: return _editedPlaylist.value = sort.songs(_editedPlaylist.value ?: return) - refreshPlaylist(playlist.uid, UpdateInstructions.Replace(2)) + refreshPlaylist(playlist.uid, UpdateInstructions.Replace(1)) } /** diff --git a/app/src/main/java/org/oxycblt/auxio/home/list/PlaylistListFragment.kt b/app/src/main/java/org/oxycblt/auxio/home/list/PlaylistListFragment.kt index 11bb9d236..eb8de750c 100644 --- a/app/src/main/java/org/oxycblt/auxio/home/list/PlaylistListFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/home/list/PlaylistListFragment.kt @@ -149,7 +149,7 @@ class PlaylistListFragment : } else { binding.homeNoMusicAction.isVisible = indexingState == null || (empty && indexingState is IndexingState.Completed) - binding.homeNoMusicAction.text = getString(R.string.lbl_music_sources) + binding.homeNoMusicAction.text = getString(R.string.set_locations) binding.homeNoMusicAction.setOnClickListener { homeModel.startChooseMusicLocations() } } } diff --git a/app/src/main/java/org/oxycblt/auxio/image/covers/NullCovers.kt b/app/src/main/java/org/oxycblt/auxio/image/covers/NullCovers.kt index df39b5981..0eaa655b3 100644 --- a/app/src/main/java/org/oxycblt/auxio/image/covers/NullCovers.kt +++ b/app/src/main/java/org/oxycblt/auxio/image/covers/NullCovers.kt @@ -22,13 +22,13 @@ import org.oxycblt.musikr.covers.Cover import org.oxycblt.musikr.covers.CoverResult import org.oxycblt.musikr.covers.MutableCovers import org.oxycblt.musikr.covers.stored.CoverStorage -import org.oxycblt.musikr.fs.device.DeviceFile +import org.oxycblt.musikr.fs.File import org.oxycblt.musikr.metadata.Metadata class NullCovers(private val storage: CoverStorage) : MutableCovers { override suspend fun obtain(id: String) = CoverResult.Hit(NullCover) - override suspend fun create(file: DeviceFile, metadata: Metadata) = CoverResult.Hit(NullCover) + override suspend fun create(file: File, metadata: Metadata) = CoverResult.Hit(NullCover) override suspend fun cleanup(excluding: Collection) { storage.ls(setOf()).map { storage.rm(it) } diff --git a/app/src/main/java/org/oxycblt/auxio/music/MusicRepository.kt b/app/src/main/java/org/oxycblt/auxio/music/MusicRepository.kt index 8574205b2..ecc8cec63 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/MusicRepository.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/MusicRepository.kt @@ -29,9 +29,9 @@ import kotlinx.coroutines.withContext import kotlinx.coroutines.yield import org.oxycblt.auxio.image.covers.SettingCovers import org.oxycblt.auxio.music.MusicRepository.IndexingWorker -import org.oxycblt.auxio.music.shim.NoOpFileTreeCache -import org.oxycblt.auxio.music.shim.WriteOnlyFileTreeCache +import org.oxycblt.auxio.music.locations.LocationMode import org.oxycblt.auxio.music.shim.WriteOnlyMutableCache +import org.oxycblt.musikr.Config import org.oxycblt.musikr.IndexingProgress import org.oxycblt.musikr.Interpretation import org.oxycblt.musikr.Library @@ -39,11 +39,11 @@ import org.oxycblt.musikr.Music import org.oxycblt.musikr.Musikr import org.oxycblt.musikr.MutableLibrary import org.oxycblt.musikr.Playlist -import org.oxycblt.musikr.Query import org.oxycblt.musikr.Song import org.oxycblt.musikr.Storage import org.oxycblt.musikr.cache.MutableCache -import org.oxycblt.musikr.fs.device.FileTreeCache +import org.oxycblt.musikr.fs.mediastore.MediaStore +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 @@ -388,25 +388,20 @@ constructor( } else { Naming.simple() } - val locations = musicSettings.musicLocations - val excludedLocations = musicSettings.excludedLocations - val withHidden = musicSettings.withHidden val currentRevision = musicSettings.revision val newRevision = currentRevision?.takeIf { withCache } ?: UUID.randomUUID() val cache = if (withCache) cache else WriteOnlyMutableCache(cache) val covers = settingCovers.mutate(context, newRevision) - val fileTreeCache = - if (musicSettings.useFileTreeCache) { - if (withCache) FileTreeCache.from(context) - else WriteOnlyFileTreeCache(FileTreeCache.from(context)) - } else { - NoOpFileTreeCache() + val fs = + when (musicSettings.locationMode) { + LocationMode.SAF -> SAF.from(context, musicSettings.safQuery) + LocationMode.MEDIA_STORE -> MediaStore.from(context, musicSettings.mediaStoreQuery) } - val query = Query(source = locations, exclude = excludedLocations) - val storage = Storage(cache, covers, storedPlaylists, fileTreeCache) - val interpretation = Interpretation(nameFactory, separators, withHidden) - val result = Musikr.new(context, storage, interpretation).run(query, ::emitIndexingProgress) + val storage = Storage(cache, covers, storedPlaylists) + val interpretation = Interpretation(nameFactory, separators) + val config = Config(fs, storage, interpretation) + val result = Musikr.new(context, config).run(::emitIndexingProgress) // Music loading completed, update the revision right now so we re-use this work // later. musicSettings.revision = newRevision diff --git a/app/src/main/java/org/oxycblt/auxio/music/MusicSettings.kt b/app/src/main/java/org/oxycblt/auxio/music/MusicSettings.kt index 01f6e15e9..3e5b98512 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/MusicSettings.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/MusicSettings.kt @@ -24,9 +24,14 @@ import androidx.core.net.toUri import dagger.hilt.android.qualifiers.ApplicationContext import java.util.UUID import javax.inject.Inject +import org.oxycblt.auxio.IntegerTable import org.oxycblt.auxio.R +import org.oxycblt.auxio.music.locations.LocationMode import org.oxycblt.auxio.settings.Settings +import org.oxycblt.auxio.util.unlikelyToBeNull import org.oxycblt.musikr.fs.Location +import org.oxycblt.musikr.fs.mediastore.MediaStore +import org.oxycblt.musikr.fs.saf.SAF import timber.log.Timber as L /** @@ -37,28 +42,37 @@ import timber.log.Timber as L interface MusicSettings : Settings { /** The current library revision. */ var revision: UUID? - /** The locations of music to load. */ - var musicLocations: List - /** The locations to exclude from music loading. */ - var excludedLocations: List - /** Whether to exclude non-music audio files from the music library. */ - val excludeNonMusic: Boolean - /** Whether to ignore hidden files and directories during music loading. */ - val withHidden: Boolean + + /** The mode for loading music locations (SAF or System database). */ + var locationMode: LocationMode + + /** The currently configured SAF query (if any) * */ + var safQuery: SAF.Query + + /** The currently configured MediaStore query (if any) * */ + var mediaStoreQuery: MediaStore.Query + /** Whether to be actively watching for changes in the music library. */ val shouldBeObserving: Boolean + /** A [String] of characters representing the desired characters to denote multi-value tags. */ 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 + fun forceLocationUpdate() + interface Listener { /** Called when the current music locations changed. */ fun onMusicLocationsChanged() {} + /** Called when a setting controlling how music is loaded has changed. */ fun onIndexingSettingChanged() {} + /** Called when the [shouldBeObserving] configuration has changed. */ fun onObservingChanged() {} } @@ -79,45 +93,6 @@ class MusicSettingsImpl @Inject constructor(@ApplicationContext private val cont } } - override var musicLocations: List - get() { - val locations = - sharedPreferences.getString(getString(R.string.set_key_music_locations), null) - ?: return emptyList() - return locations.toOpenedLocations() - } - set(value) { - sharedPreferences.edit { - putString(getString(R.string.set_key_music_locations), value.stringify()) - commit() - // Sometimes changing this setting just won't actually trigger the listener. - // Only this one. No idea why. - listener?.onMusicLocationsChanged() - } - } - - override var excludedLocations: List - get() { - val locations = - sharedPreferences.getString(getString(R.string.set_key_excluded_locations), null) - ?: return emptyList() - return locations.toUnopenedLocations() - } - set(value) { - sharedPreferences.edit { - putString( - getString(R.string.set_key_excluded_locations), value.stringifyLocations()) - commit() - listener?.onMusicLocationsChanged() - } - } - - override val excludeNonMusic: Boolean - get() = sharedPreferences.getBoolean(getString(R.string.set_key_exclude_non_music), true) - - override val withHidden: Boolean - get() = sharedPreferences.getBoolean(getString(R.string.set_key_with_hidden), false) - override val shouldBeObserving: Boolean get() = sharedPreferences.getBoolean(getString(R.string.set_key_observing), false) @@ -138,20 +113,109 @@ class MusicSettingsImpl @Inject constructor(@ApplicationContext private val cont override val useFileTreeCache: Boolean get() = sharedPreferences.getBoolean(getString(R.string.set_key_fs_cache), false) + override var locationMode: LocationMode + get() { + val mode = + sharedPreferences.getInt( + getString(R.string.set_key_locations_mode), IntegerTable.LOCATION_MODE_SAF) + return LocationMode.fromInt(mode) ?: LocationMode.SAF + } + set(value) { + sharedPreferences.edit { + putInt(getString(R.string.set_key_locations_mode), value.intCode) + apply() + } + } + + override var safQuery: SAF.Query + get() { + val locations = + unlikelyToBeNull( + sharedPreferences.getString( + getString(R.string.set_key_music_locations), "")) + .toOpenedLocations() + val excludedLocations = + unlikelyToBeNull( + sharedPreferences.getString( + getString(R.string.set_key_excluded_locations), "")) + .toUnopenedLocations() + val withHidden = + sharedPreferences.getBoolean(getString(R.string.set_key_with_hidden), false) + return SAF.Query( + source = locations, exclude = excludedLocations, withHidden = withHidden) + } + set(value) { + sharedPreferences.edit { + putString(getString(R.string.set_key_music_locations), value.source.stringify()) + putString(getString(R.string.set_key_excluded_locations), value.exclude.stringify()) + putBoolean(getString(R.string.set_key_with_hidden), value.withHidden) + apply() + } + } + + override var mediaStoreQuery: MediaStore.Query + get() { + val filterMode = + sharedPreferences.getInt( + getString(R.string.set_key_filter_mode), IntegerTable.FILTER_MODE_EXCLUDE) + val filteredLocations = + unlikelyToBeNull( + sharedPreferences.getString( + getString(R.string.set_key_filtered_locations), "")) + .toUnopenedLocations() + val excludeNonMusic = + sharedPreferences.getBoolean(getString(R.string.set_key_exclude_non_music), true) + return MediaStore.Query( + mode = + when (filterMode) { + IntegerTable.FILTER_MODE_INCLUDE -> MediaStore.FilterMode.INCLUDE + IntegerTable.FILTER_MODE_EXCLUDE -> MediaStore.FilterMode.EXCLUDE + else -> MediaStore.FilterMode.EXCLUDE + }, + filtered = filteredLocations, + excludeNonMusic = excludeNonMusic) + } + set(value) { + sharedPreferences.edit { + val filterMode = + when (value.mode) { + MediaStore.FilterMode.INCLUDE -> IntegerTable.FILTER_MODE_INCLUDE + MediaStore.FilterMode.EXCLUDE -> IntegerTable.FILTER_MODE_EXCLUDE + } + putInt(getString(R.string.set_key_filter_mode), filterMode) + putString( + getString(R.string.set_key_filtered_locations), value.filtered.stringify()) + putBoolean(getString(R.string.set_key_exclude_non_music), value.excludeNonMusic) + apply() + } + } + + override fun forceLocationUpdate() { + // TODO: Temporary!!! This is really dumb, just need to ship a workaround for this rn + val cur = sharedPreferences.getInt(getString(R.string.set_key_locations_mode), 0) + sharedPreferences.edit { + putInt(getString(R.string.set_key_force_reload_workaround), cur + 1) + apply() + } + } + override fun onSettingChanged(key: String, listener: MusicSettings.Listener) { // TODO: Differentiate "hard reloads" (Need the cache) and "Soft reloads" // (just need to manipulate data) when (key) { + getString(R.string.set_key_locations_mode), getString(R.string.set_key_music_locations), - getString(R.string.set_key_excluded_locations) -> { + getString(R.string.set_key_force_reload_workaround) -> { L.d("Dispatching music locations change") listener.onMusicLocationsChanged() } - getString(R.string.set_key_separators), - getString(R.string.set_key_auto_sort_names), + getString(R.string.set_key_excluded_locations), getString(R.string.set_key_with_hidden), + getString(R.string.set_key_filter_mode), + getString(R.string.set_key_filtered_locations), getString(R.string.set_key_exclude_non_music), - getString(R.string.set_key_fs_cache) -> { + getString(R.string.set_key_separators), + getString(R.string.set_key_auto_sort_names), -> { L.d("Dispatching indexing setting change for $key") listener.onIndexingSettingChanged() } @@ -162,16 +226,13 @@ class MusicSettingsImpl @Inject constructor(@ApplicationContext private val cont } } - private fun List.stringify(): String = + private fun List.stringify(): String = joinToString(separator = ";") { it.uri.toString().replace(";", "\\;") } private fun String.toOpenedLocations(): List = splitEscaped { it == ';' } .mapNotNull { Location.Unopened.from(context, it.toUri())?.open(context) } - private fun List.stringifyLocations(): String = - joinToString(separator = ";") { it.uri.toString().replace(";", "\\;") } - private fun String.toUnopenedLocations(): List = splitEscaped { it == ';' }.mapNotNull { Location.Unopened.from(context, it.toUri()) } diff --git a/app/src/main/java/org/oxycblt/auxio/music/locations/ExcludedLocationAdapter.kt b/app/src/main/java/org/oxycblt/auxio/music/locations/ExcludedLocationAdapter.kt deleted file mode 100644 index 20e4a4be2..000000000 --- a/app/src/main/java/org/oxycblt/auxio/music/locations/ExcludedLocationAdapter.kt +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2021 Auxio Project - * ExcludedLocationAdapter.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.music.locations - -import android.view.ViewGroup -import org.oxycblt.auxio.databinding.ItemMusicLocationBinding -import org.oxycblt.auxio.util.inflater -import org.oxycblt.musikr.fs.Location - -/** - * [LocationAdapter] that manages a list of [Location.Unopened] excluded directory instances. - * - * @param listener A [LocationAdapter.Listener] to bind interactions to. - * @author Alexander Capehart (OxygenCobalt) - */ -class ExcludedLocationAdapter(listener: LocationAdapter.Listener) : - LocationAdapter(listener) { - override fun createViewHolder(parent: ViewGroup): LocationViewHolder = - ExcludedLocationViewHolder.from(parent) -} - -/** - * A [LocationViewHolder] that displays a [Location.Unopened]. Use [from] to create an instance. - * - * @author Alexander Capehart (OxygenCobalt) - */ -class ExcludedLocationViewHolder private constructor(binding: ItemMusicLocationBinding) : - LocationViewHolder(binding) { - - companion object { - /** - * Create a new instance. - * - * @param parent The parent to inflate this instance from. - * @return A new instance. - */ - fun from(parent: ViewGroup) = - ExcludedLocationViewHolder( - ItemMusicLocationBinding.inflate(parent.context.inflater, parent, false)) - } -} diff --git a/app/src/main/java/org/oxycblt/auxio/music/locations/ExcludedLocationsDialog.kt b/app/src/main/java/org/oxycblt/auxio/music/locations/ExcludedLocationsDialog.kt deleted file mode 100644 index be70285d0..000000000 --- a/app/src/main/java/org/oxycblt/auxio/music/locations/ExcludedLocationsDialog.kt +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2021 Auxio Project - * ExcludedLocationsDialog.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.music.locations - -import android.content.Context -import android.net.Uri -import dagger.hilt.android.AndroidEntryPoint -import javax.inject.Inject -import org.oxycblt.auxio.BuildConfig -import org.oxycblt.auxio.R -import org.oxycblt.auxio.music.MusicSettings -import org.oxycblt.musikr.fs.Location - -/** - * Dialog that manages the excluded locations setting. - * - * @author Alexander Capehart (OxygenCobalt) - */ -@AndroidEntryPoint -class ExcludedLocationsDialog : LocationsDialog() { - override val locationAdapter = ExcludedLocationAdapter(this) - - @Inject override lateinit var musicSettings: MusicSettings - - override fun getDialogTitle(): Int = R.string.set_excluded_locations - - override fun getCurrentLocations(): List = musicSettings.excludedLocations - - override fun saveLocations(locations: List) { - musicSettings.excludedLocations = locations - } - - override fun getPendingLocationsKey(): String = KEY_PENDING_EXCLUDED_LOCATIONS - - override fun convertUriToLocation(uri: Uri): Location.Unopened? { - return Location.Unopened.from(requireContext(), uri) - } - - override fun createLocationFromUri(context: Context, uri: Uri): Location.Unopened? { - return Location.Unopened.from(context, uri) - } - - private companion object { - const val KEY_PENDING_EXCLUDED_LOCATIONS = - BuildConfig.APPLICATION_ID + ".key.PENDING_EXCLUDED_LOCATIONS" - } -} diff --git a/app/src/main/java/org/oxycblt/auxio/music/locations/LocationAdapter.kt b/app/src/main/java/org/oxycblt/auxio/music/locations/LocationAdapter.kt index 12614dcd3..8baaf480d 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/locations/LocationAdapter.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/locations/LocationAdapter.kt @@ -20,57 +20,140 @@ package org.oxycblt.auxio.music.locations import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView +import org.oxycblt.auxio.R import org.oxycblt.auxio.databinding.ItemMusicLocationBinding +import org.oxycblt.auxio.databinding.ItemNoLocationsBinding import org.oxycblt.auxio.list.recycler.DialogRecyclerView import org.oxycblt.auxio.util.context +import org.oxycblt.auxio.util.inflater import org.oxycblt.musikr.fs.Location import timber.log.Timber as L -abstract class LocationAdapter(private val listener: Listener) : - RecyclerView.Adapter>() { +class LocationAdapter(private val listener: Listener) : + RecyclerView.Adapter() { private val _locations = mutableListOf() val locations: List = _locations - override fun getItemCount() = locations.size + override fun getItemCount() = if (locations.isEmpty()) 1 else locations.size - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(parent) + override fun getItemViewType(position: Int): Int { + return if (locations.isEmpty()) VIEW_TYPE_EMPTY else VIEW_TYPE_LOCATION + } - override fun onBindViewHolder(holder: LocationViewHolder, position: Int) = - holder.bind(locations[position], listener) + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { + return when (viewType) { + VIEW_TYPE_EMPTY -> EmptyLocationViewHolder.from(parent) + VIEW_TYPE_LOCATION -> LocationViewHolder.from(parent) + else -> throw IllegalArgumentException("Unknown view type: $viewType") + } + } + + override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { + when (holder) { + is LocationViewHolder<*> -> { + @Suppress("UNCHECKED_CAST") + (holder as LocationViewHolder).bind(locations[position], listener) + } + is EmptyLocationViewHolder -> holder.bind() + } + } fun add(location: T) { if (_locations.contains(location)) return L.d("Adding $location") + val wasEmpty = _locations.isEmpty() _locations.add(location) - notifyItemInserted(_locations.lastIndex) + if (wasEmpty) { + notifyItemChanged(0) + } else { + notifyItemInserted(_locations.lastIndex) + } } fun addAll(locations: List) { L.d("Adding ${locations.size} locations") + val wasEmpty = _locations.isEmpty() val oldSize = _locations.size _locations.addAll(locations) - notifyItemRangeInserted(oldSize, locations.size) + if (wasEmpty && locations.isNotEmpty()) { + notifyItemChanged(0) + } else if (locations.isNotEmpty()) { + notifyItemRangeInserted(oldSize, locations.size) + } } fun remove(location: T) { L.d("Removing $location") val idx = _locations.indexOf(location) _locations.removeAt(idx) - notifyItemRemoved(idx) + if (_locations.isEmpty()) { + notifyItemChanged(0) + } else { + notifyItemRemoved(idx) + } } - protected abstract fun createViewHolder(parent: ViewGroup): LocationViewHolder + fun clear() { + L.d("Clearing all locations") + val wasEmpty = _locations.isEmpty() + val oldSize = _locations.size + _locations.clear() + if (!wasEmpty) { + if (oldSize == 1) { + notifyItemChanged(0) + } else { + notifyDataSetChanged() + } + } + } - interface Listener { - fun onRemoveLocation(location: T) + interface Listener { + fun onRemoveLocation(location: Location) + } + + companion object { + private const val VIEW_TYPE_EMPTY = 0 + private const val VIEW_TYPE_LOCATION = 1 } } -abstract class LocationViewHolder(protected val binding: ItemMusicLocationBinding) : +class LocationViewHolder(private val binding: ItemMusicLocationBinding) : DialogRecyclerView.ViewHolder(binding.root) { - fun bind(location: T, listener: LocationAdapter.Listener) { + fun bind(location: T, listener: LocationAdapter.Listener) { binding.locationPath.text = location.path.resolve(binding.context) binding.locationDelete.setOnClickListener { listener.onRemoveLocation(location) } } + + companion object { + /** + * Create a new instance. + * + * @param parent The parent to inflate this instance from. + * @return A new instance. + */ + fun from(parent: ViewGroup) = + LocationViewHolder( + ItemMusicLocationBinding.inflate(parent.context.inflater, parent, false)) + } +} + +class EmptyLocationViewHolder(private val binding: ItemNoLocationsBinding) : + DialogRecyclerView.ViewHolder(binding.root) { + + fun bind() { + binding.locationPath.text = binding.context.getString(R.string.lbl_no_folders) + } + + companion object { + /** + * Create a new instance. + * + * @param parent The parent to inflate this instance from. + * @return A new instance. + */ + fun from(parent: ViewGroup) = + EmptyLocationViewHolder( + ItemNoLocationsBinding.inflate(parent.context.inflater, parent, false)) + } } diff --git a/app/src/main/java/org/oxycblt/auxio/music/locations/LocationMode.kt b/app/src/main/java/org/oxycblt/auxio/music/locations/LocationMode.kt new file mode 100644 index 000000000..23bb50f81 --- /dev/null +++ b/app/src/main/java/org/oxycblt/auxio/music/locations/LocationMode.kt @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2025 Auxio Project + * LocationMode.kt is part of Auxio. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.oxycblt.auxio.music.locations + +import org.oxycblt.auxio.IntegerTable + +/** Represents the mode for loading music locations. */ +enum class LocationMode { + /** Use Storage Access Framework (file picker) to select specific folders */ + SAF, + /** Use system MediaStore database to load all music */ + MEDIA_STORE; + + val intCode: Int + get() = + when (this) { + SAF -> IntegerTable.LOCATION_MODE_SAF + MEDIA_STORE -> IntegerTable.LOCATION_MODE_MEDIA_STORE + } + + companion object { + fun fromInt(int: Int): LocationMode? { + return when (int) { + IntegerTable.LOCATION_MODE_SAF -> SAF + IntegerTable.LOCATION_MODE_MEDIA_STORE -> MEDIA_STORE + else -> null + } + } + } +} diff --git a/app/src/main/java/org/oxycblt/auxio/music/locations/LocationsDialog.kt b/app/src/main/java/org/oxycblt/auxio/music/locations/LocationsDialog.kt index daeceb95f..88200b940 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/locations/LocationsDialog.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/locations/LocationsDialog.kt @@ -18,43 +18,84 @@ package org.oxycblt.auxio.music.locations +import android.Manifest import android.content.ActivityNotFoundException +import android.content.pm.PackageManager import android.net.Uri +import android.os.Build import android.os.Bundle import android.view.LayoutInflater import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AlertDialog -import androidx.core.net.toUri -import androidx.recyclerview.widget.ConcatAdapter +import androidx.core.content.ContextCompat +import androidx.core.view.isVisible +import com.google.android.material.R as MR +import dagger.hilt.android.AndroidEntryPoint +import javax.inject.Inject import org.oxycblt.auxio.R import org.oxycblt.auxio.databinding.DialogMusicLocationsBinding import org.oxycblt.auxio.music.MusicSettings import org.oxycblt.auxio.ui.ViewBindingMaterialDialogFragment +import org.oxycblt.auxio.util.getAttrColorCompat import org.oxycblt.auxio.util.showToast import org.oxycblt.musikr.fs.Location +import org.oxycblt.musikr.fs.mediastore.MediaStore +import org.oxycblt.musikr.fs.saf.SAF import timber.log.Timber as L -abstract class LocationsDialog : - ViewBindingMaterialDialogFragment(), - LocationAdapter.Listener, - NewLocationFooterAdapter.Listener { - protected abstract val locationAdapter: LocationAdapter - private val locationFooterAdapter = NewLocationFooterAdapter(this) +@AndroidEntryPoint +class LocationsDialog : ViewBindingMaterialDialogFragment() { + + private val includeLocationListener = + object : LocationAdapter.Listener { + override fun onRemoveLocation(location: Location) { + includeLocationAdapter.remove(location as Location.Opened) + updateSaveButtonState() + } + } + + private val excludeLocationListener = + object : LocationAdapter.Listener { + override fun onRemoveLocation(location: Location) { + excludeLocationAdapter.remove(location as Location.Unopened) + updateSaveButtonState() + } + } + + private val filterLocationListener = + object : LocationAdapter.Listener { + override fun onRemoveLocation(location: Location) { + filterLocationAdapter.remove(location as Location.Unopened) + updateSaveButtonState() + } + } + + private val includeLocationAdapter: LocationAdapter = + LocationAdapter(includeLocationListener) + private val excludeLocationAdapter: LocationAdapter = + LocationAdapter(excludeLocationListener) + private val filterLocationAdapter: LocationAdapter = + LocationAdapter(filterLocationListener) private var openDocumentTreeLauncher: ActivityResultLauncher? = null - abstract val musicSettings: MusicSettings + private var storagePermissionLauncher: ActivityResultLauncher? = null + @Inject lateinit var musicSettings: MusicSettings + + private var isFilePickerMode = true + private var isIncludeMode = true + private var hasStoragePermission = false + private var isExtrasExpanded = false + private var pendingLocationCallback: ((Location.Unopened) -> Unit)? = null + private var permissionGrantedInSession = false override fun onCreateBinding(inflater: LayoutInflater) = DialogMusicLocationsBinding.inflate(inflater) override fun onConfigDialog(builder: AlertDialog.Builder) { builder - .setTitle(getDialogTitle()) + .setTitle(R.string.set_locations) .setNegativeButton(R.string.lbl_cancel, null) - .setPositiveButton(R.string.lbl_save) { _, _ -> - val newDirs = locationAdapter.locations - saveLocations(newDirs) - } + .setPositiveButton(R.string.lbl_save) { _, _ -> saveChanges() } } override fun onBindingCreated( @@ -62,36 +103,185 @@ abstract class LocationsDialog : savedInstanceState: Bundle? ) { openDocumentTreeLauncher = - registerForActivityResult( - ActivityResultContracts.OpenDocumentTree(), ::addDocumentTreeUriToDirs) + registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { uri -> + addDocumentTreeUriToDirs(uri) + } - binding.locationsRecycler.apply { - adapter = ConcatAdapter(locationAdapter, locationFooterAdapter) + storagePermissionLauncher = + registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted -> + L.d("Storage permission granted: $isGranted") + hasStoragePermission = isGranted + if (isGranted && !permissionGrantedInSession) { + permissionGrantedInSession = true + } + updateModeUI(binding) + updateSaveButtonState() + } + + binding.locationsIncludeRecycler.apply { + adapter = includeLocationAdapter itemAnimator = null } - val locations = - savedInstanceState?.getStringArrayList(getPendingLocationsKey())?.mapNotNull { - convertUriToLocation(it.toUri()) - } ?: getCurrentLocations() + binding.locationsExcludeRecycler.apply { + adapter = excludeLocationAdapter + itemAnimator = null + } - locationAdapter.addAll(locations) + binding.locationsFilterRecycler.apply { + adapter = filterLocationAdapter + itemAnimator = null + } + + // Load initial state from MusicSettings + loadInitialState(binding) + + // Set up string resources + binding.locationsModeHeader.setText(R.string.set_load_from) + binding.locationsModeExclude.setText(R.string.set_file_picker) + binding.locationsModeInclude.setText(R.string.set_system_database) + binding.locationsExcludeModeHeader.setText(R.string.set_filter_mode) + binding.locationsExcludeModeExclude.setText(R.string.set_include) + binding.locationsExcludeModeInclude.setText(R.string.set_exclude) + binding.locationsIncludeListHeader.setText(R.string.set_folders_to_load) + binding.locationsIncludeAdd.contentDescription = getString(R.string.desc_add_folder) + binding.locationsExcludeAdd.contentDescription = getString(R.string.desc_add_folder) + binding.locationsFilterAdd.contentDescription = getString(R.string.desc_add_folder) + binding.locationsExtrasDropdown.setText(R.string.set_extra_settings) + + // Set up extras dropdown click listener + binding.locationsExtrasDropdown.setOnClickListener { + isExtrasExpanded = !isExtrasExpanded + updateExtrasVisibility(binding) + } + + // Set up mode toggle listener + binding.folderModeGroup.addOnButtonCheckedListener { group, checkedId, isChecked -> + if (!isChecked) return@addOnButtonCheckedListener + + when (checkedId) { + R.id.locations_mode_exclude -> { + isFilePickerMode = true + updateModeUI(binding) + updateSaveButtonState() + } + R.id.locations_mode_include -> { + isFilePickerMode = false + updateModeUI(binding) + updateSaveButtonState() + } + } + } + + // Set up exclude/include mode toggle listener for System Database mode + binding.locationsExcludeModeGroup.addOnButtonCheckedListener { group, checkedId, isChecked + -> + if (!isChecked) return@addOnButtonCheckedListener + + when (checkedId) { + R.id.locations_exclude_mode_exclude -> { + isIncludeMode = true + updateExcludeModeUI(binding) + } + R.id.locations_exclude_mode_include -> { + isIncludeMode = false + updateExcludeModeUI(binding) + } + } + } + + // Set up add folder buttons + binding.locationsIncludeAdd.setOnClickListener { + pendingLocationCallback = { location -> + location.open(requireContext())?.let { opened -> + includeLocationAdapter.add(opened) + updateSaveButtonState() + } + } + onNewLocation() + } + binding.locationsExcludeAdd.setOnClickListener { + pendingLocationCallback = { location -> + excludeLocationAdapter.add(location) + updateSaveButtonState() + } + onNewLocation() + } + binding.locationsFilterAdd.setOnClickListener { + pendingLocationCallback = { location -> + filterLocationAdapter.add(location) + updateSaveButtonState() + } + onNewLocation() + } + + // Set up grant permission card click + binding.locationsPermsCard.setOnClickListener { requestStoragePermission() } + + // Initialize UI state + updateModeUI(binding) + updateExtrasVisibility(binding) + updateSaveButtonState() + } + + private fun loadInitialState(binding: DialogMusicLocationsBinding) { + // Determine mode based on the locationMode setting + isFilePickerMode = musicSettings.locationMode == LocationMode.SAF + + // Load data for the initial mode + loadModeData(binding) + + // Set the initial toggle button selection + if (isFilePickerMode) { + binding.folderModeGroup.check(R.id.locations_mode_exclude) + } else { + binding.folderModeGroup.check(R.id.locations_mode_include) + } + + // Check storage permission status + hasStoragePermission = checkStoragePermission() + } + + private fun loadModeData(binding: DialogMusicLocationsBinding) { + // Load SAF data + musicSettings.safQuery.let { query -> + includeLocationAdapter.addAll(query.source) + excludeLocationAdapter.addAll(query.exclude) + binding.locationsWithHiddenSwitch.isChecked = query.withHidden + } + // Load MediaStore data + musicSettings.mediaStoreQuery.let { query -> + filterLocationAdapter.addAll(query.filtered) + binding.locationsExcludeNonMusicSwitch.isChecked = query.excludeNonMusic + + isIncludeMode = query.mode == MediaStore.FilterMode.INCLUDE + binding.locationsExcludeModeGroup.check( + if (isIncludeMode) R.id.locations_exclude_mode_exclude + else R.id.locations_exclude_mode_include) + } + } + + override fun onStart() { + super.onStart() + // Update save button state after dialog is shown + updateSaveButtonState() } override fun onSaveInstanceState(outState: Bundle) { super.onSaveInstanceState(outState) - outState.putStringArrayList( - getPendingLocationsKey(), - ArrayList(locationAdapter.locations.map { it.uri.toString() })) + // TODO } override fun onDestroyBinding(binding: DialogMusicLocationsBinding) { super.onDestroyBinding(binding) openDocumentTreeLauncher = null - binding.locationsRecycler.adapter = null + storagePermissionLauncher = null + binding.locationsIncludeRecycler.adapter = null + binding.locationsExcludeRecycler.adapter = null + binding.locationsFilterRecycler.adapter = null } - override fun onNewLocation() { + private fun onNewLocation() { L.d("Opening launcher") val launcher = requireNotNull(openDocumentTreeLauncher) { "Document tree launcher was not available" } @@ -106,31 +296,324 @@ abstract class LocationsDialog : private fun addDocumentTreeUriToDirs(uri: Uri?) { if (uri == null) { L.d("No URI given (user closed the dialog)") + pendingLocationCallback = null return } val context = requireContext() - val location = createLocationFromUri(context, uri) + val location = Location.Unopened.from(context, uri) if (location != null) { - locationAdapter.add(location) + pendingLocationCallback?.invoke(location) } else { requireContext().showToast(R.string.err_bad_location) } + pendingLocationCallback = null } - override fun onRemoveLocation(location: T) { - locationAdapter.remove(location) + private fun updateModeUI(binding: DialogMusicLocationsBinding) { + with(binding) { + if (isFilePickerMode) { + // File Picker mode + locationsModeDesc.setText(R.string.lng_file_picker) + + // Update permission section + locationsPermsDesc.setText(R.string.set_grant_storage_anyway) + locationsPermsSubtitle.setText(R.string.lng_grant_storage_anyway) + + // File Picker mode - no need to update switch text as it's set in XML + } else { + // System Database mode + locationsModeDesc.setText(R.string.lng_system_database) + + // Update permission section + locationsPermsDesc.setText(R.string.set_grant_storage) + locationsPermsSubtitle.setText(R.string.lng_grant_storage_required) + + // Update exclude mode description based on selection + updateExcludeModeUI(binding) + + // System Database mode - no need to update switch text as it's set in XML + } + + // Update enabled state based on permission + updatePermissionDependentUI(binding) + // Update card colors based on mode and permission + updatePermissionCardColors(binding) + // Update permission card visibility + updatePermissionCardVisibility(binding) + // Update extras visibility based on current state + updateExtrasVisibility(binding) + } } - protected abstract fun getDialogTitle(): Int + private fun updateExcludeModeUI(binding: DialogMusicLocationsBinding) { + with(binding) { + if (isIncludeMode) { + locationsExcludeModeDesc.setText(R.string.lng_include_folders) + } else { + locationsExcludeModeDesc.setText(R.string.lng_exclude_folders) + } + } + } - protected abstract fun getCurrentLocations(): List + private fun updatePermissionDependentUI(binding: DialogMusicLocationsBinding) { + with(binding) { + // Only disable views in System Database mode when permission not granted + // File Picker mode doesn't require storage permission + val isEnabled = isFilePickerMode || hasStoragePermission - protected abstract fun saveLocations(locations: List) + locationsIncludeListHeader.isEnabled = isEnabled + locationsIncludeAdd.isEnabled = isEnabled + locationsIncludeRecycler.isEnabled = isEnabled - protected abstract fun getPendingLocationsKey(): String + locationsExcludeModeHeader.isEnabled = isEnabled + locationsExcludeModeGroup.isEnabled = isEnabled + locationsExcludeModeDesc.isEnabled = isEnabled + locationsExcludeModeExclude.isEnabled = isEnabled + locationsExcludeModeInclude.isEnabled = isEnabled - protected abstract fun convertUriToLocation(uri: Uri): T? + locationsExcludeListHeader.isEnabled = isEnabled + locationsExcludeAdd.isEnabled = isEnabled + locationsExcludeRecycler.isEnabled = isEnabled - protected abstract fun createLocationFromUri(context: android.content.Context, uri: Uri): T? + locationsFilterListHeader.isEnabled = isEnabled + locationsFilterAdd.isEnabled = isEnabled + locationsFilterRecycler.isEnabled = isEnabled + + locationsWithHiddenTitle.isEnabled = isEnabled + locationsWithHiddenDesc.isEnabled = isEnabled + locationsWithHidden.isEnabled = isEnabled + + locationsExcludeNonMusicTitle.isEnabled = isEnabled + locationsExcludeNonMusicDesc.isEnabled = isEnabled + locationsExcludeNonMusic.isEnabled = isEnabled + } + } + + private fun updatePermissionCardColors(binding: DialogMusicLocationsBinding) { + val context = requireContext() + with(binding.locationsPermsCard) { + if (isFilePickerMode) { + // File Picker mode - use secondary colors + setCardBackgroundColor(context.getAttrColorCompat(MR.attr.colorSecondaryContainer)) + binding.locationsPermsDesc.setTextColor( + context.getAttrColorCompat(MR.attr.colorOnSecondaryContainer)) + binding.locationsPermsSubtitle.setTextColor( + context.getAttrColorCompat(MR.attr.colorSecondary)) + binding.locationsPermsOpen.imageTintList = + context.getAttrColorCompat(MR.attr.colorOnSecondaryContainer) + } else { + // System Database mode - use error colors if no permission, secondary colors if + // granted + if (hasStoragePermission) { + // Has permission - use secondary colors + setCardBackgroundColor( + context.getAttrColorCompat(MR.attr.colorSecondaryContainer)) + binding.locationsPermsDesc.setTextColor( + context.getAttrColorCompat(MR.attr.colorOnSecondaryContainer)) + binding.locationsPermsSubtitle.setTextColor( + context.getAttrColorCompat(MR.attr.colorSecondary)) + binding.locationsPermsOpen.imageTintList = + context.getAttrColorCompat(MR.attr.colorOnSecondaryContainer) + } else { + setCardBackgroundColor(context.getAttrColorCompat(MR.attr.colorErrorContainer)) + binding.locationsPermsDesc.setTextColor( + context.getAttrColorCompat(MR.attr.colorOnErrorContainer)) + binding.locationsPermsSubtitle.setTextColor( + context.getAttrColorCompat(MR.attr.colorError)) + binding.locationsPermsOpen.imageTintList = + context.getAttrColorCompat(MR.attr.colorOnErrorContainer) + } + } + } + } + + private fun updatePermissionCardVisibility(binding: DialogMusicLocationsBinding) { + with(binding) { + // Hide the permission card when permissions are granted + locationsPermsCard.isVisible = !hasStoragePermission + } + } + + private fun updateExtrasVisibility(binding: DialogMusicLocationsBinding) { + with(binding) { + // Update dropdown icon rotation + locationsExtrasDropdownIcon.rotation = if (isExtrasExpanded) 180f else 0f + + if (isFilePickerMode) { + // File Picker mode - show include/exclude lists when expanded + // Include section + locationsIncludeListHeaderDivider.isVisible = true + locationsIncludeListHeader.isVisible = true + locationsIncludeAdd.isVisible = true + locationsIncludeRecycler.isVisible = true + + // Show dividers and exclude section only when expanded + locationsExcludeListHeader.isVisible = isExtrasExpanded + locationsExcludeAdd.isVisible = isExtrasExpanded + locationsExcludeRecycler.isVisible = isExtrasExpanded + + // Hide filter mode section completely + locationsExcludeModeHeader.isVisible = false + locationsExcludeModeGroup.isVisible = false + locationsExcludeModeDesc.isVisible = false + locationsFilterModeDivider.isVisible = false + locationsFilterListHeader.isVisible = false + locationsFilterAdd.isVisible = false + locationsFilterRecycler.isVisible = false + locationsExcludeListDivider.isVisible = false + + // Config section + configDivider.isVisible = isExtrasExpanded + locationsWithHiddenTitle.isVisible = isExtrasExpanded + locationsWithHiddenDesc.isVisible = isExtrasExpanded + locationsWithHidden.isVisible = isExtrasExpanded + + locationsExcludeNonMusicTitle.isVisible = false + locationsExcludeNonMusicDesc.isVisible = false + locationsExcludeNonMusic.isVisible = false + } else { + // System Database mode - show filter mode when expanded + // Hide include section + locationsIncludeListHeaderDivider.isVisible = false + locationsIncludeListHeader.isVisible = false + locationsIncludeAdd.isVisible = false + locationsIncludeRecycler.isVisible = false + + // Hide exclude section (at bottom) + locationsExcludeListDivider.isVisible = false + locationsExcludeListHeader.isVisible = false + locationsExcludeAdd.isVisible = false + locationsExcludeRecycler.isVisible = false + + // Show filter mode section only when expanded + locationsExcludeModeHeader.isVisible = isExtrasExpanded + locationsExcludeModeGroup.isVisible = isExtrasExpanded + locationsExcludeModeDesc.isVisible = isExtrasExpanded + locationsFilterModeDivider.isVisible = isExtrasExpanded + locationsFilterListHeader.isVisible = isExtrasExpanded + locationsFilterAdd.isVisible = isExtrasExpanded + locationsFilterRecycler.isVisible = isExtrasExpanded + + // Config section + configDivider.isVisible = isExtrasExpanded + locationsWithHiddenTitle.isVisible = false + locationsWithHiddenDesc.isVisible = false + locationsWithHidden.isVisible = false + + locationsExcludeNonMusicTitle.isVisible = isExtrasExpanded + locationsExcludeNonMusicDesc.isVisible = isExtrasExpanded + locationsExcludeNonMusic.isVisible = isExtrasExpanded + } + } + } + + private fun saveChanges() { + val binding = requireBinding() + + // Check if configuration has actually changed + val currentMode = musicSettings.locationMode + val modeChanged = + currentMode != (if (isFilePickerMode) LocationMode.SAF else LocationMode.MEDIA_STORE) + + var configChanged = modeChanged + + if (isFilePickerMode) { + // Check if SAF query changed + val currentSafQuery = musicSettings.safQuery + val newSafQuery = + SAF.Query( + source = includeLocationAdapter.locations, + exclude = excludeLocationAdapter.locations, + withHidden = binding.locationsWithHiddenSwitch.isChecked) + + if (!modeChanged && currentMode == LocationMode.SAF) { + configChanged = currentSafQuery != newSafQuery + } + + // Save the new SAF query + musicSettings.safQuery = newSafQuery + } else { + // Check if MediaStore query changed + val currentMediaStoreQuery = musicSettings.mediaStoreQuery + val filterMode = + if (isIncludeMode) { + MediaStore.FilterMode.INCLUDE + } else { + MediaStore.FilterMode.EXCLUDE + } + val newMediaStoreQuery = + MediaStore.Query( + mode = filterMode, + filtered = filterLocationAdapter.locations, + excludeNonMusic = binding.locationsExcludeNonMusicSwitch.isChecked) + + if (!modeChanged && currentMode == LocationMode.MEDIA_STORE) { + configChanged = currentMediaStoreQuery != newMediaStoreQuery + } + + // Save the new MediaStore query + musicSettings.mediaStoreQuery = newMediaStoreQuery + } + + // Save the mode setting + musicSettings.locationMode = + if (isFilePickerMode) LocationMode.SAF else LocationMode.MEDIA_STORE + + // If no configuration changed but permission was granted in this session, + // force a location update + if (!configChanged && permissionGrantedInSession) { + L.d("No config changes detected, but permission was granted - forcing location update") + musicSettings.forceLocationUpdate() + } + } + + private fun checkStoragePermission(): Boolean { + val permission = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + Manifest.permission.READ_MEDIA_AUDIO + } else { + Manifest.permission.READ_EXTERNAL_STORAGE + } + return ContextCompat.checkSelfPermission(requireContext(), permission) == + PackageManager.PERMISSION_GRANTED + } + + private fun requestStoragePermission() { + val permission = + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + Manifest.permission.READ_MEDIA_AUDIO + } else { + Manifest.permission.READ_EXTERNAL_STORAGE + } + + val launcher = + requireNotNull(storagePermissionLauncher) { + "Storage permission launcher was not available" + } + + try { + L.d("Requesting storage permission: $permission") + launcher.launch(permission) + } catch (e: Exception) { + L.e("Failed to request storage permission") + L.e(e.stackTraceToString()) + requireContext().showToast(R.string.err_no_app) + } + } + + private fun updateSaveButtonState() { + val dialog = dialog as? AlertDialog ?: return + + val isEnabled = + if (isFilePickerMode) { + // File Picker mode: Enable save only if there's at least one folder + includeLocationAdapter.locations.isNotEmpty() + } else { + // System mode: Enable save only if permission is granted + hasStoragePermission + } + + dialog.getButton(AlertDialog.BUTTON_POSITIVE)?.isEnabled = isEnabled + } } diff --git a/app/src/main/java/org/oxycblt/auxio/music/locations/MusicLocationAdapter.kt b/app/src/main/java/org/oxycblt/auxio/music/locations/MusicLocationAdapter.kt deleted file mode 100644 index cf950f963..000000000 --- a/app/src/main/java/org/oxycblt/auxio/music/locations/MusicLocationAdapter.kt +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2021 Auxio Project - * MusicLocationAdapter.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.music.locations - -import android.view.ViewGroup -import org.oxycblt.auxio.databinding.ItemMusicLocationBinding -import org.oxycblt.auxio.util.inflater -import org.oxycblt.musikr.fs.Location - -/** - * [LocationAdapter] that manages a list of [Location.Opened] music directory instances. - * - * @param listener A [LocationAdapter.Listener] to bind interactions to. - * @author Alexander Capehart (OxygenCobalt) - */ -class MusicLocationAdapter(listener: LocationAdapter.Listener) : - LocationAdapter(listener) { - override fun createViewHolder(parent: ViewGroup): LocationViewHolder = - MusicLocationViewHolder.from(parent) -} - -/** - * A [LocationViewHolder] that displays a [Location.Opened]. Use [from] to create an instance. - * - * @author Alexander Capehart (OxygenCobalt) - */ -class MusicLocationViewHolder private constructor(binding: ItemMusicLocationBinding) : - LocationViewHolder(binding) { - - companion object { - /** - * Create a new instance. - * - * @param parent The parent to inflate this instance from. - * @return A new instance. - */ - fun from(parent: ViewGroup) = - MusicLocationViewHolder( - ItemMusicLocationBinding.inflate(parent.context.inflater, parent, false)) - } -} diff --git a/app/src/main/java/org/oxycblt/auxio/music/locations/MusicLocationsDialog.kt b/app/src/main/java/org/oxycblt/auxio/music/locations/MusicLocationsDialog.kt deleted file mode 100644 index cca6e1778..000000000 --- a/app/src/main/java/org/oxycblt/auxio/music/locations/MusicLocationsDialog.kt +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2021 Auxio Project - * MusicLocationsDialog.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.music.locations - -import android.content.Context -import android.net.Uri -import dagger.hilt.android.AndroidEntryPoint -import javax.inject.Inject -import org.oxycblt.auxio.BuildConfig -import org.oxycblt.auxio.R -import org.oxycblt.auxio.music.MusicSettings -import org.oxycblt.musikr.fs.Location - -/** - * Dialog that manages the music locations setting. - * - * @author Alexander Capehart (OxygenCobalt) - */ -@AndroidEntryPoint -class MusicLocationsDialog : LocationsDialog() { - override val locationAdapter = MusicLocationAdapter(this) - - @Inject override lateinit var musicSettings: MusicSettings - - override fun getDialogTitle(): Int = R.string.set_locations - - override fun getCurrentLocations(): List = musicSettings.musicLocations - - override fun saveLocations(locations: List) { - musicSettings.musicLocations = locations - } - - override fun getPendingLocationsKey(): String = KEY_PENDING_LOCATIONS - - override fun convertUriToLocation(uri: Uri): Location.Opened? { - val context = requireContext() - return Location.Unopened.from(context, uri)?.open(context) - } - - override fun createLocationFromUri(context: Context, uri: Uri): Location.Opened? { - return Location.Unopened.from(context, uri)?.open(context) - } - - private companion object { - const val KEY_PENDING_LOCATIONS = BuildConfig.APPLICATION_ID + ".key.PENDING_LOCATIONS" - } -} diff --git a/app/src/main/java/org/oxycblt/auxio/music/locations/NewLocationFooterAdapter.kt b/app/src/main/java/org/oxycblt/auxio/music/locations/NewLocationFooterAdapter.kt deleted file mode 100644 index 4623db510..000000000 --- a/app/src/main/java/org/oxycblt/auxio/music/locations/NewLocationFooterAdapter.kt +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2024 Auxio Project - * NewLocationFooterAdapter.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.music.locations - -import android.view.View -import android.view.ViewGroup -import androidx.recyclerview.widget.RecyclerView -import org.oxycblt.auxio.databinding.ItemNewMusicLocationBinding -import org.oxycblt.auxio.list.recycler.DialogRecyclerView -import org.oxycblt.auxio.music.decision.AddToPlaylistDialog -import org.oxycblt.auxio.util.inflater - -/** - * A purely-visual [RecyclerView.Adapter] that acts as a footer providing a "New Playlist" choice in - * [AddToPlaylistDialog]. - * - * @author Alexander Capehart (OxygenCobalt) - */ -class NewLocationFooterAdapter(private val listener: Listener) : - RecyclerView.Adapter() { - override fun getItemCount() = 1 - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = - NewLocationFooterViewHolder.from(parent) - - override fun onBindViewHolder(holder: NewLocationFooterViewHolder, position: Int) { - holder.bind(listener) - } - - /** A listener for [NewLocationFooterAdapter] interactions. */ - interface Listener { - /** Called when the footer has been pressed, requesting to create a new location. */ - fun onNewLocation() - } -} - -/** - * A [RecyclerView.ViewHolder] that displays a "New Playlist" choice in [NewLocationFooterAdapter]. - * Use [from] to create an instance. - * - * @author Alexander Capehart (OxygenCobalt) - */ -class NewLocationFooterViewHolder -private constructor(private val binding: ItemNewMusicLocationBinding) : - DialogRecyclerView.ViewHolder(binding.root) { - /** - * Bind new data to this instance. - * - * @param listener A [NewLocationFooterAdapter.Listener] to bind interactions to. - */ - fun bind(listener: NewLocationFooterAdapter.Listener) { - binding.root.setOnClickListener { listener.onNewLocation() } - } - - companion object { - /** - * Create a new instance. - * - * @param parent The parent to inflate this instance from. - * @return A new instance. - */ - fun from(parent: View) = - NewLocationFooterViewHolder( - ItemNewMusicLocationBinding.inflate(parent.context.inflater)) - } -} diff --git a/app/src/main/java/org/oxycblt/auxio/music/service/IndexingHolder.kt b/app/src/main/java/org/oxycblt/auxio/music/service/IndexingHolder.kt index 7788e10e8..6b1f61970 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/service/IndexingHolder.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/service/IndexingHolder.kt @@ -32,47 +32,38 @@ import org.oxycblt.auxio.ForegroundServiceNotification import org.oxycblt.auxio.music.IndexingState import org.oxycblt.auxio.music.MusicRepository import org.oxycblt.auxio.music.MusicSettings -import org.oxycblt.auxio.music.shim.UpdateTrackerFactory +import org.oxycblt.auxio.music.locations.LocationMode import org.oxycblt.auxio.playback.state.PlaybackStateManager import org.oxycblt.auxio.util.getSystemServiceCompat import org.oxycblt.musikr.MusicParent -import org.oxycblt.musikr.fs.Location -import org.oxycblt.musikr.track.UpdateTracker +import org.oxycblt.musikr.fs.mediastore.MediaStore +import org.oxycblt.musikr.fs.saf.SAF import timber.log.Timber as L class IndexingHolder private constructor( - workerContext: Context, + private val workerContext: Context, private val foregroundListener: ForegroundListener, private val playbackManager: PlaybackStateManager, private val musicRepository: MusicRepository, private val musicSettings: MusicSettings, - private val imageLoader: ImageLoader, - updateTrackerFactory: UpdateTrackerFactory + private val imageLoader: ImageLoader ) : MusicRepository.IndexingWorker, MusicRepository.IndexingListener, MusicRepository.UpdateListener, - MusicSettings.Listener, - UpdateTracker.Callback { + MusicSettings.Listener { class Factory @Inject constructor( private val playbackManager: PlaybackStateManager, private val musicRepository: MusicRepository, private val musicSettings: MusicSettings, - private val imageLoader: ImageLoader, - private val updateTrackerFactory: UpdateTrackerFactory + private val imageLoader: ImageLoader ) { fun create(context: Context, listener: ForegroundListener) = IndexingHolder( - context, - listener, - playbackManager, - musicRepository, - musicSettings, - imageLoader, - updateTrackerFactory) + context, listener, playbackManager, musicRepository, musicSettings, imageLoader) } private val indexJob = Job() @@ -85,18 +76,18 @@ private constructor( .getSystemServiceCompat(PowerManager::class) .newWakeLock( PowerManager.PARTIAL_WAKE_LOCK, BuildConfig.APPLICATION_ID + ":IndexingComponent") - private val updateTracker = updateTrackerFactory.create(this) + private var trackingJob: Job? = null fun attach() { musicSettings.registerListener(this) musicRepository.addUpdateListener(this) musicRepository.addIndexingListener(this) musicRepository.registerWorker(this) - updateTracker.track(musicSettings.musicLocations) + startTracking() } fun release() { - updateTracker.release() + stopTracking() musicRepository.unregisterWorker(this) musicRepository.removeIndexingListener(this) musicRepository.removeUpdateListener(this) @@ -168,15 +159,25 @@ private constructor( } } - override fun onUpdate(location: Location.Opened) { - if (musicSettings.shouldBeObserving) { - musicRepository.requestIndex(true) - } + private fun startTracking() { + stopTracking() + val fs = + when (musicSettings.locationMode) { + LocationMode.MEDIA_STORE -> + MediaStore.from(workerContext, musicSettings.mediaStoreQuery) + LocationMode.SAF -> SAF.from(workerContext, musicSettings.safQuery) + } + trackingJob = indexScope.launch { fs.track().collect { requestIndex(true) } } + } + + private fun stopTracking() { + trackingJob?.cancel() + trackingJob = null } override fun onMusicLocationsChanged() { super.onMusicLocationsChanged() - updateTracker.track(musicSettings.musicLocations) + startTracking() musicRepository.requestIndex(true) } diff --git a/app/src/main/java/org/oxycblt/auxio/music/shim/MusikrShimModule.kt b/app/src/main/java/org/oxycblt/auxio/music/shim/MusikrShimModule.kt index 827ac75c9..cd61618e3 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/shim/MusikrShimModule.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/shim/MusikrShimModule.kt @@ -39,8 +39,4 @@ class MusikrShimModule { @Singleton @Provides fun storedPlaylists(@ApplicationContext context: Context) = StoredPlaylists.from(context) - - @Provides - fun updateTrackerFactory(@ApplicationContext context: Context): UpdateTrackerFactory = - UpdateTrackerFactoryImpl(context) } diff --git a/app/src/main/java/org/oxycblt/auxio/music/shim/NoOpFileTreeCache.kt b/app/src/main/java/org/oxycblt/auxio/music/shim/NoOpFileTreeCache.kt deleted file mode 100644 index a28de5139..000000000 --- a/app/src/main/java/org/oxycblt/auxio/music/shim/NoOpFileTreeCache.kt +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2025 Auxio Project - * NoOpFileTreeCache.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.music.shim - -import android.net.Uri -import org.oxycblt.musikr.fs.device.CachedDirectory -import org.oxycblt.musikr.fs.device.CachedFile -import org.oxycblt.musikr.fs.device.FileTree -import org.oxycblt.musikr.fs.device.FileTreeCache - -/** - * A no-op implementation of [FileTreeCache] that doesn't cache anything. This implementation always - * returns cache misses and discards all updates. - */ -class NoOpFileTreeCache : FileTreeCache { - override fun read(): FileTree = NoOpFileTree() -} - -/** - * A no-op implementation of [FileTree] that doesn't cache anything. All queries return null (cache - * miss) and all updates are discarded. - */ -class NoOpFileTree : FileTree { - override suspend fun queryDirectory(uri: Uri): CachedDirectory? { - // Always return null to simulate a cache miss - return null - } - - override suspend fun updateDirectory(uri: Uri, directory: CachedDirectory) { - // Do nothing - discard the update - } - - override suspend fun queryFile(uri: Uri): CachedFile? { - // Always return null to simulate a cache miss - return null - } - - override suspend fun updateFile(uri: Uri, file: CachedFile) { - // Do nothing - discard the update - } - - override suspend fun write() { - // Do nothing - no cache to write - } -} diff --git a/app/src/main/java/org/oxycblt/auxio/music/shim/UpdateTrackerFactory.kt b/app/src/main/java/org/oxycblt/auxio/music/shim/UpdateTrackerFactory.kt deleted file mode 100644 index fa320f888..000000000 --- a/app/src/main/java/org/oxycblt/auxio/music/shim/UpdateTrackerFactory.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2025 Auxio Project - * UpdateTrackerFactory.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.music.shim - -import android.content.Context -import org.oxycblt.musikr.track.UpdateTracker - -interface UpdateTrackerFactory { - fun create(callback: UpdateTracker.Callback): UpdateTracker -} - -class UpdateTrackerFactoryImpl(private val context: Context) : UpdateTrackerFactory { - override fun create(callback: UpdateTracker.Callback) = UpdateTracker.from(context, callback) -} diff --git a/app/src/main/java/org/oxycblt/auxio/music/shim/WriteOnlyFileTreeCache.kt b/app/src/main/java/org/oxycblt/auxio/music/shim/WriteOnlyFileTreeCache.kt deleted file mode 100644 index f4659cdcb..000000000 --- a/app/src/main/java/org/oxycblt/auxio/music/shim/WriteOnlyFileTreeCache.kt +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 Auxio Project - * WriteOnlyFileTreeCache.kt is part of Auxio. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package org.oxycblt.auxio.music.shim - -import android.net.Uri -import org.oxycblt.musikr.fs.device.CachedDirectory -import org.oxycblt.musikr.fs.device.CachedFile -import org.oxycblt.musikr.fs.device.FileTree -import org.oxycblt.musikr.fs.device.FileTreeCache - -class WriteOnlyFileTreeCache(private val inner: FileTreeCache) : FileTreeCache { - override fun read(): FileTree { - val innerTree = inner.read() - return WriteOnlyFileTree(innerTree) - } -} - -class WriteOnlyFileTree(private val innerTree: FileTree) : FileTree { - override suspend fun queryDirectory(uri: Uri): CachedDirectory? { - // Always return null to simulate a cache miss - return null - } - - override suspend fun updateDirectory(uri: Uri, directory: CachedDirectory) { - // Forward update operations to the inner tree - innerTree.updateDirectory(uri, directory) - } - - override suspend fun queryFile(uri: Uri): CachedFile? { - // Always return null to simulate a cache miss - return null - } - - override suspend fun updateFile(uri: Uri, file: CachedFile) { - // Forward update operations to the inner tree - innerTree.updateFile(uri, file) - } - - override suspend fun write() { - // Forward write operations to the inner tree - innerTree.write() - } -} diff --git a/app/src/main/java/org/oxycblt/auxio/music/shim/WriteOnlyMutableCache.kt b/app/src/main/java/org/oxycblt/auxio/music/shim/WriteOnlyMutableCache.kt index d4076f965..9079f29f0 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/shim/WriteOnlyMutableCache.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/shim/WriteOnlyMutableCache.kt @@ -21,10 +21,10 @@ package org.oxycblt.auxio.music.shim import org.oxycblt.musikr.cache.CacheResult import org.oxycblt.musikr.cache.CachedSong import org.oxycblt.musikr.cache.MutableCache -import org.oxycblt.musikr.fs.device.DeviceFile +import org.oxycblt.musikr.fs.File class WriteOnlyMutableCache(private val inner: MutableCache) : MutableCache { - override suspend fun read(file: DeviceFile): CacheResult { + override suspend fun read(file: File): CacheResult { return when (val result = inner.read(file)) { is CacheResult.Hit -> CacheResult.Stale(file, result.song.addedMs) else -> result diff --git a/app/src/main/java/org/oxycblt/auxio/settings/RootPreferenceFragment.kt b/app/src/main/java/org/oxycblt/auxio/settings/RootPreferenceFragment.kt index 791ba5b53..3ee3e47b9 100644 --- a/app/src/main/java/org/oxycblt/auxio/settings/RootPreferenceFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/settings/RootPreferenceFragment.kt @@ -56,10 +56,6 @@ class RootPreferenceFragment : BasePreferenceFragment(R.xml.preferences_root) { findNavController() .navigateSafe(RootPreferenceFragmentDirections.musicLocationsSettings()) } - getString(R.string.set_key_excluded_dirs) -> { - findNavController() - .navigateSafe(RootPreferenceFragmentDirections.excludedLocationsSettings()) - } } } diff --git a/app/src/main/java/org/oxycblt/auxio/util/LangUtil.kt b/app/src/main/java/org/oxycblt/auxio/util/LangUtil.kt index d5f9465f0..f1273fcc5 100644 --- a/app/src/main/java/org/oxycblt/auxio/util/LangUtil.kt +++ b/app/src/main/java/org/oxycblt/auxio/util/LangUtil.kt @@ -63,3 +63,48 @@ fun lazyReflectedMethod(clazz: KClass<*>, method: String, vararg params: KClass< it.isAccessible = true } } + +/** + * Split a [String] by the given selector, automatically handling escaped characters that satisfy + * the selector. + * + * @param selector A block that determines if the string should be split at a given character. + * @return One or more [String]s split by the selector. + */ +internal fun String.splitEscaped(selector: Char): List { + val split = mutableListOf() + var currentString = "" + var i = 0 + + while (i < length) { + val a = get(i) + val b = getOrNull(i + 1) + + if (a == selector) { + // Non-escaped separator, split the string here, making sure any stray whitespace + // is removed. + split.add(currentString) + currentString = "" + i++ + continue + } + + if (b != null && a == '\\' && a == selector) { + // Is an escaped character, add the non-escaped variant and skip two + // characters to move on to the next one. + currentString += b + i += 2 + } else { + // Non-escaped, increment normally. + currentString += a + i++ + } + } + + if (currentString.isNotEmpty()) { + // Had an in-progress split string that is now terminated, add it. + split.add(currentString) + } + + return split +} diff --git a/app/src/main/res/drawable/drop_down_24.xml b/app/src/main/res/drawable/drop_down_24.xml new file mode 100644 index 000000000..dfea22cd0 --- /dev/null +++ b/app/src/main/res/drawable/drop_down_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/drop_up_24.xml b/app/src/main/res/drawable/drop_up_24.xml new file mode 100644 index 000000000..05735c6a5 --- /dev/null +++ b/app/src/main/res/drawable/drop_up_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_open_20.xml b/app/src/main/res/drawable/ic_open_20.xml new file mode 100644 index 000000000..cc6758d3e --- /dev/null +++ b/app/src/main/res/drawable/ic_open_20.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/layout/dialog_music_locations.xml b/app/src/main/res/layout/dialog_music_locations.xml index 10035eec0..b68271d79 100644 --- a/app/src/main/res/layout/dialog_music_locations.xml +++ b/app/src/main/res/layout/dialog_music_locations.xml @@ -1,20 +1,471 @@ - + android:layout_height="match_parent" + android:orientation="vertical"> - + android:layout_height="match_parent"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home_list.xml b/app/src/main/res/layout/fragment_home_list.xml index 007bc3223..09e832944 100644 --- a/app/src/main/res/layout/fragment_home_list.xml +++ b/app/src/main/res/layout/fragment_home_list.xml @@ -50,7 +50,7 @@ android:id="@+id/home_no_music_action" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/lbl_music_sources" /> + android:text="@string/set_locations" /> diff --git a/app/src/main/res/layout/item_new_music_location.xml b/app/src/main/res/layout/item_new_music_location.xml deleted file mode 100644 index 2fd5338ed..000000000 --- a/app/src/main/res/layout/item_new_music_location.xml +++ /dev/null @@ -1,17 +0,0 @@ - - diff --git a/app/src/main/res/layout/item_no_locations.xml b/app/src/main/res/layout/item_no_locations.xml new file mode 100644 index 000000000..95f5f8409 --- /dev/null +++ b/app/src/main/res/layout/item_no_locations.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/app/src/main/res/navigation/inner.xml b/app/src/main/res/navigation/inner.xml index 61fcfd3a5..8602877b4 100644 --- a/app/src/main/res/navigation/inner.xml +++ b/app/src/main/res/navigation/inner.xml @@ -570,7 +570,7 @@

\ No newline at end of file diff --git a/app/src/main/res/navigation/outer.xml b/app/src/main/res/navigation/outer.xml index 60d81d6b2..0891e4b91 100644 --- a/app/src/main/res/navigation/outer.xml +++ b/app/src/main/res/navigation/outer.xml @@ -36,9 +36,6 @@ - - تم إعادة تسمية قائمة التشغيل إعادة تسمية قائمة التشغيل يظهر على - إختيار المجلد مقاطع تجريبية استيراد تصدير @@ -259,4 +258,47 @@ الفئات الخاصة بك ستضهر هنا. اعادة تحميل مكتبة الموسيقى عند حصول تغيير(يتطلب تنبيه ثابت) تحذير: استخدام هذا الاعداد قد ينتج عنه ان يتم تفسير بعض العلامات بشكل خاطئ مثل ان تحتوي على قيم متعددة. يمكن ان يتم حل هذا بتقديم الفواصل الغير مرغوبةبالشارحة الخلفية(\\). + تذكر الايقاف + تشغيل تلقائي لسماعة الرأس + اجبار استخدام غلاف البوم مربع + تحديد الصوت وسلوك العرض + صور + اظهر فقط الفنانينالذين ذكرو مباشرة في الالبوم(يعمل بشكل افضل على المكتبات التي تم اضافة العلامات لها بشكل جيد) + قص غلاف البوم بنسبة ١:١ + التشغيل + تحذير: تغيير التضخيم المسبق الى ايجابي عالي قد ينتج عنه قمم في بعض الملفات الصوتية + صور قائمة التشغيل %s + اختيار الصور + تحديث الموسيقى + غلاف الالبوم + البوم غير معروف + اطفاء + تعديل مع الاشارات + تسوية الصوت + مجلد مستثنى + تحكم بالمجلدات المستثناة من تحميل الموسيقى + اعادة تحميل المزسيقى باستخدام الاشارات المخزونة عند الامكان + حذف خزن الاشارات و اعادة تحميل مكتقة الموسيقى بشكل كامل(ابطا، ولكن اكثر كمالا) + لا يمكن تصدير قائمة التشغيل الى هذا الملف + اخفاء المتعاونين + اظهار الملفات المخفية + اظهار الملفات المخفية + تحديد ترتيب ذكي تنازلي + على وضعه + دائما ابدا التشغيل بشكل تلقائي عند ربط سماعة الرأس(قد لا يعمل مع كل الاجهزة) + مكتبة + ايقاف + تغيير مع الاشارات + تحكم بالمكان الذي يجب ان تحمل منه الموسيقى + اعادة البحث للموسيقى + لا يمكن استيراد قائمة التشغيل من الملف + لا يوجد قرص + لا يوجد مسار + جودة عالية + توفير مساحه + متوازن + مجلد موسيقى + استمر بالتشغيل/الايقاف عند تخطي او تعديل الطابور + ايقاف التشغيل + فتح الطابور diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 20860c540..c3e106439 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -1,6 +1,6 @@ - مشغّل موسيقى بسيط ومعقول للأندرويد. + مشغّل موسيقى بسيط ومنطقي للأندرويد. مراقبة مكتبة الموسيقى إعادة المحاولة الألبومات @@ -82,8 +82,8 @@ نوع غير معروف لا قرص صوت MPEG-4 - أوغ الصوت - برنامج ترميز الصوت المجاني بدون فقدان البيانات (FLAC) + أوغ (Ogg) الصوت + برنامج ترميز الصوت المجاني دون فقدان البيانات (FLAC) نيلي أزرق أخضر عميق @@ -177,7 +177,7 @@ إعادة التحميل التلقائي ضبط الأحرف التي تشير إلى قيم علامات متعددة البدء التلقائي في التشغيل عند توصيل سماعة الرأس (قد لا يعمل على جميع الأجهزة) - اصوات تصويرية + موسيقى تصويرية التحكم في كيفية تحميل الموسيقى والصور حافظ على خاصية الخلط عند تشغيل أغنية جديدة سماعة الرأس تشغيل تلقائي @@ -185,7 +185,7 @@ إيقاف مؤقت عند التكرار إيقاف مؤقت عند تكرار الأغنية المسار %d - البوم اغاني ريميكس + تجميعة ريميكس لا توجد ألبومات إعادة فحص الموسيقى غلاف الألبوم لـ %s @@ -205,7 +205,7 @@ فواصل القيم المتعددة أعد تحميل مكتبة الموسيقى عندما تتغير (يتطلب إشعار دائم) استثناء غير الموسيقى - امبارساند (&) + اشارة مع (&) الفاصلة (،) شرطة مائلة (/) أغطية الألبومات @@ -268,7 +268,6 @@ تمت إضافته إلى قائمة التشغيل إعدادات الفاصلة المنقوطة (؛) - اختر المجلدات استورد صدّر صدّر قائمة التشغيل @@ -283,7 +282,7 @@ نسبي مطلق غير معروف - قائمة التشغيل استوردت + قائمة تشغيل مستوردة ألبوم غير معروف افرز حسب الاتجاه @@ -307,7 +306,6 @@ المؤلف استورد قائمة التشغيل المسار - مجلد جديد بدء التشغيل معلومات الخطأ نُسخت @@ -324,8 +322,12 @@ %d ألبوم MPEG-4 تحتوي على %s - Apple Lossless Audio Codec (ALAC) + ترميز Apple صوتي دون خسارة (ALAC) كما هي ضمّن ملفات الصوت المخفية (مثال: ذاكرة التخزين المؤقت) ضمّن الملفات المخفية + تحديد المجلدات التي لا تُحمّل منها الموسيقى + المجلدات المستثناة + استخدم ذاكرة التخزين المؤقت لنظام الملفات + يحسن أوقات التحميل، ولكنه قد يمنع إضافة صوت جديد diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index 2910f1354..cb873c0ba 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -121,7 +121,6 @@ Rəy bildir E-poçt göndər GitHub-da problem yarat - Qovluqları seç Pleylist ixrac edildi Pleylistə əlavə edildi Pleylist adı dəyişdirildi diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index 3de57a7e6..152521672 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -306,12 +306,10 @@ \n \nПапярэджанне: будзьце асцярожныя пры кіраванні гэтай службай, калі вы закрыеце яе, а затым паспрабуеце выкарыстоўваць зноў, вы, верагодна, прывядзеце да збою прыкладання. Больш - Абярыце тэчкі MPEG-4, які змяшчае %s Невядомы альбом Вашыя альбомы будуць адлюстроўвацца тут. Тут будуць адлюстроўвацца вашыя жанры. - Новая тэчка Apple Lossless Audio Codec (ALAC) Невядомы Адправіць электронны ліст @@ -321,4 +319,4 @@ Тут будуць адлюстроўвацца вашыя плэйлісты. Эканомія месца Паведаміць аб праблеме на GitHub - \ No newline at end of file + diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index b84e074b9..350168b63 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -1,7 +1,7 @@ - Зареждане на музика - Мониторинг на музикална библиотека + Музиката се зарежда + Наблюдение на музикална библиотека Опитайте отново Песни Песен @@ -24,7 +24,7 @@ Демонстрации DJ миксове На живо - Ремикси + Ремиксове Появява се на Изпълнител Изпълнители @@ -37,10 +37,10 @@ Внасяне Внасяне на плейлист Изнасяне на плейлист - Преименувай - Изтрий - Изтрий плейлист? - Редактирай + Преименуване + Изтриване + Изтриване на плейлист? + Редактиране Търсене Филтър Всички @@ -56,7 +56,7 @@ Добави към плейлист Отиди на изпълнител Отиди на албум - Виж свойства + Преглед на свойства Преглед Сподели Свойства на песента @@ -65,36 +65,36 @@ Размер Битрейт Честота на дискретизация - ReplayGain Регулиране на албума - Разбъркано + ReplayGain Регулиране на албум + Разбъркай Добре Отказ Запази Нулирай Стил на пътя Относително - Използвай съвместими с Windows пътища + Използване на съвместими с Windows пътища Прост, рационален музикален плейър за android. - Зарежда се музика + Зареждане на музика Албуми EP на живо - Сингъл наживо + Сингъл на живо Внесен плейлист - Преименувай плейлист + Преименуване на плейлист Брой песни - Датата е добавена + Дата на добавяне Вид DJ микс - Писта + Песен Сортирай по Еквалайзер Демонстрация Посока Плейлисти - Възходящ - Низходящ + Възходящо + Низходящо Сега се изпълнява - ReplayGain Регулиране на песента + ReplayGain Регулиране на песен Разбъркай всички Относно Абсолютно @@ -104,7 +104,7 @@ Програмен код Уики Лицензи - Библиотечна статистика + Статистика на библиотеката Избор Информация за грешка Копирано @@ -115,7 +115,7 @@ Поддръжници Преглед и контрол на възпроизвеждането на музика Вашата музикална библиотека се зарежда… - Наблюдение на музикалната ви библиотека за промени… + Наблюдение на вашата музикална библиотека за промени… Добави към опашката Създаден плейлист Внесен плейлист @@ -132,11 +132,11 @@ Тъмна Цветова схема Черна тема - Използвай чисто черна тъмна тема + Използване на чисто черна тъмна тема Кръгъл режим - Активирай заоблените ъгли на допълнителните елементи на потребителския интерфейс (изисква обложките на албумите да са заоблени) - Персонализирайте - Персонализирайте контролите и поведението на потребителския интерфейс + Активиране на заоблени ъгли на допълнителни елементи от потребителския интерфейс (изисква се кориците на албумите да са заоблени) + Персонализиране + Персонализиране на контролите и поведението на потребителския интерфейс Дисплей Раздели на библиотеката Промени видимостта и реда на разделите на библиотеката @@ -151,20 +151,20 @@ Изпълни от жанр Изпълни песен сама по себе си Запомни разбъркване - Запази функцията разбъркване при изпълнение на нова песен + Запазване на функцията разбъркване при изпълнение на нова песен Съдържание - Контролирай как да се зареждат музика и изображение + Контролирайте как се зареждат музика и изображения Музика Автоматично презареждане Презаредете музикалната библиотека, когато се промени (изисква постоянно известие) Изключи не-музика Разделители с множество стойности - Конфигурирай знаци, които обозначават множество стойности на тагове + Конфигуриране на символи, които обозначават множество стойности на етикети Запетая (,) Точка и запетая (;) Наклонена черта (/) Плюс (+) - Амперсанд (&) + Ampersand (&) Интелигентно сортиране Обложки на албум Изключено @@ -173,14 +173,14 @@ Функция квадратни обложки на албум Изрежи всички корици на албуми до съотношение 1:1 Аудио - Конфигурирай поведението на звука и възпроизвеждане + Конфигуриране на звука и поведението при възпроизвеждане Възпроизвеждане Автоматично пускане на слушалки - Винаги започва да възпроизвежда, когато са свързани слушалки (може да не работи на всички устройства) + Винаги започвайте да възпроизвеждате, когато са свързани слушалки (може да не работи на всички устройства) Превъртете преди да преминете назад Превъртете преди да преминете към предишната песен Пауза при повторение - Запомни пауза + Запомнете паузата Нормализация на звука ReplayGain стратегия Изключено @@ -189,11 +189,11 @@ Персонализирано действие на лентата за възпроизвеждане Изпълни от показания елемент Изпълни от всички песни - Игнорирай аудио файлове, които не са музика, като подкасти - Предупреждение: Използването на тази настройка може да доведе до неправилно тълкуване на някои тагове като имащи множество стойности. Можете да разрешите това, като поставите пред нежеланите разделителни знаци обратна наклонена черта (\\). + Игнорирайте аудио файлове, които не са музика, като например подкасти + Предупреждение: Използването на тази настройка може да доведе до неправилно тълкуване на някои етикети като имащи множество стойности. Можете да разрешите това, като поставите пред нежеланите разделителни знаци обратна наклонена черта (\\). Правилно сортиране на имена, които започват с цифри или думи като \"the\" (работи най-добре с музика на английски) - Скриване на сътрудниците - Показвай само изпълнители, които са директно посочени в албум (работи най-добре при добре маркирани библиотеки) + Скриване на сътрудници + Показване само на изпълнители, които са директно посочени в албума (работи най-добре в добре етикетирани библиотеки) Изображения Пауза когато песента се повтаря Останете в режим на изпълнение/пауза, когато прескачате или редактирате опашка @@ -201,15 +201,15 @@ Предпочитам албум Предпочитам албум, ако се пуска такъв ReplayGain предусилвател - Предварителният усилвател се прилага към съществуващата настройка по време на възпроизвеждане + Предусилвателят се прилага към съществуващата настройка по време на възпроизвеждане Регулиране с етикети - Корекция без етикети + Регулиране без етикети Библиотека Музикални папки - Управлявайте откъде да се зарежда музиката + Управление откъде да се зарежда музиката Обновяване на музика Неуспешно зареждане на музика - Плейлиста не може да се изнесе в този файл + Не може да се изнесе плейлист в този файл Няма намерено приложение, което да може да се справи с тази задача Изпълни или пауза Премини към следваща песен @@ -220,9 +220,9 @@ Премахни тази песен Премести тази песен Отвори опашката - Избери изображение + Избор на изображение Премести този раздел - Предупреждение: Промяната на пред усилвателя на висока положителна стойност може да доведе до пикове на някои аудио записи. + Предупреждение: Промяната на предусилвателя на висока положителна стойност може да доведе до пикове на звука в някои аудио записи. Изчисти заявката за търсене Премахни папка Не може да се внесе плейлист от този файл @@ -231,12 +231,12 @@ Обложка на албум Обложка на албум за %s Изображение на изпълнител за %s - Презареди музикалната библиотека, като използвате кеширани етикети, когато е възможно - Жанрово изображение за %s + Презаредете музикалната библиотека, като използвате кеширани етикети, когато е възможно + Изображение на жанр за %s Повторно сканиране на музика Песен %d Изображение на плейлист за %s - Изчисти кеша на етикета и пълно презареждане на музикалната библиотека (по-бавно, но по-пълно) + Изчистете кеша на етикетите и презаредете напълно музикалната библиотека (по-бавно, но по-пълно) Неизвестен изпълнител Няма дата Няма диск @@ -277,7 +277,7 @@ Кафяво %d Избрано Вашата музикална библиотека се зарежда… (%1$d/%2$d) - Изтрий %s? Това не може да бъде отменено. + Изтриване %s? Това не може да бъде отменено. %d песен %d песени @@ -301,19 +301,21 @@ Обратна връзка Създайте проблем в GitHub Изпратете имейл - Изберете папки MPEG-4, съдържащ %s Вашите песни ще се показват тук. Вашите албуми ще се показват тук. Вашите плейлисти ще се показват тук. - Вашите артисти ще се показват тук. + Вашите изпълнители ще се появят тук. Вашите жанрове ще се показват тук. Apple Lossless Audio Codec (ALAC) Неизвестен албум Неизвестен - Включете скрити файлове + Включи скрити файлове Включете аудио файлове, които са скрити (напр. .cache) Спестете място Както е - Нова папка + Изключени папки + Управление на папки, които да се изключат от зареждането на музика + Използване на кеш на файловата система + Подобрява времето за зареждане, но може да попречи на добавянето на нова музика diff --git a/app/src/main/res/values-bqi/strings.xml b/app/src/main/res/values-bqi/strings.xml index dd742de5d..60584e914 100644 --- a/app/src/main/res/values-bqi/strings.xml +++ b/app/src/main/res/values-bqi/strings.xml @@ -2,7 +2,6 @@ واجۊری کۊلیکسیون آرنگ قپ ریت دوواره - دوبلگه یل ن پسند کۊنین آرنگا آرنگ پوی آرنگا diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 048660ceb..61a3d808d 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -320,12 +320,10 @@ Zpětná vazba Vytvořit problém na GitHubu Poslat e-mail - Vybrat složky Neznámé album MPEG-4 obsahující %s Apple Lossless Audio Codec (ALAC) Neznámý - Nová složka Úspora místa Vaše skladby se zobrazí zde. Vaše alba se zobrazí zde. @@ -337,4 +335,6 @@ Původní Spravovat složky, ze kterých ze hudba nemá načítat Vyloučené složky + Použít mezipaměť v souborovém systému + Zlepší dobu načítání, ale může zabránit přidání nové hudby diff --git a/app/src/main/res/values-cy/strings.xml b/app/src/main/res/values-cy/strings.xml index 5afb2eda0..41451ceb7 100644 --- a/app/src/main/res/values-cy/strings.xml +++ b/app/src/main/res/values-cy/strings.xml @@ -132,11 +132,11 @@ Chwilio Hidlo Disgynnol - Yn chwarae nawr + Yn chwarae rŵan Gosodiadau sain Chwarae Chwarae ar hap - Ciwio + Ciw Esgynnol Chwarae nesaf Ychwanegu i\'r ciw @@ -311,7 +311,6 @@ Ffurfweddu llythrennau sydd yn dynodi mwy nag un gwerth tag Ampersand (&) Ffurfweddu sain ac ymarweddiad chwarae - Dewis ffolderi Adborth Creu issue ar GitHub Anfon ebost @@ -320,4 +319,17 @@ Anhysbys MPEG-4 gan gynnwys %s Apple Lossless Audio Codec (ALAC) - \ No newline at end of file + Bydd eich artistiaid yn ymddangos yma. + Bydd eich caneuon yn ymddangos yma. + Bydd eich albymau yn ymddangos yma. + Bydd eich rhestri chwarae yn ymddangos yma. + Cynnwys ffeiliau cudd + Ffolderi wedi\'u eithrio + Rheoli ffolderi i\'w heithrio rhag llwytho cerddoriaeth + Bydd eich genres yn ymddangos yma. + Paid â newid + Cynnwys ffeiliau sain cudd (e.e. .cache) + Cadw lle storfa + Defnyddio cof dros dro y system + Yn gwella amseroedd llwytho, ond gall atal cerddoriaeth newydd rhag cael ei hychwanegu + diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 9dcfa5cc5..fe011448b 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -311,12 +311,10 @@ Ein Issue auf GitHub erstellen Rückmeldung Eine E-Mail senden - Ordner auswählen MPEG-4, enthält %s Apple Lossless Audio Codec (ALAC) Unbekannt Unbekanntes Album - Neuer Ordner Speicherplatz sparen Deine Alben werden hier angezeigt. Deine Wiedergabelisten werden hier angezeigt. @@ -328,4 +326,6 @@ Versteckte Dateien einbeziehen Ausgeschlossene Ordner Ordner verwalten, aus denen keine Musik geladen wird + Dateisystem-Cache benutzen + Verbessert Ladezeiten, kann aber verhindern, dass neue Musik hinzugefügt wird diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index e93bbb83f..02e33c576 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -315,7 +315,6 @@ Crear una incidencia en GitHub Enviar un correo electrónico Retroalimentación - Seleccionar carpetas Álbum desconocido Desconocido El MPEG-4 contiene %s @@ -323,7 +322,6 @@ Sus álbumes aparecerán aquí. Sus artistas aparecerán aquí. Sus géneros aparecerán aquí. - Nueva carpeta Sus listas de reproducción aparecerán aquí. Sus canciones aparecerán aquí. Ahorra espacio @@ -332,4 +330,6 @@ Incluir ficheros ocultos Directorios excluidos Administrar exclusión de directorios + Mejora los tiempos de carga, pero puede impedir que se agregue nueva música + Usar la caché del sistema de archivos diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index 3c3b17816..fd07076d2 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -303,12 +303,10 @@ Tagasiside Koosta GitHubis veateade või ettepanek Saada e-kiri - Vali kaustad Tundmatu album MPEG-4 %s koodekiga Apple Lossless Audio Codec (ALAC) Teadmata - Uus kaust Säästa ruumi Sinu muusikapalad saavad olema nähtavad siin. Sinu esitajad saavad olema nähtavad siin. @@ -318,4 +316,8 @@ Kaasa peidetud failid Kaasa peidetud helifailid (nt. .cache) Sellisena, nagu ta on + Välistatud kaustad + Halda kaustu, kust muusikat ei otsita + Kasuta failisüsteemipõhist puhverdamist + Kiirendab meedia laadimise aega, kuid võib takistada uue muusika lisamist diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 2ca7996e0..f246e8e19 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -293,7 +293,6 @@ Pysy toisto/keskeytystilassa ohittaessa kappaleita tai muokatessa jonoa Valitse merkit, jotka erottavat tagiarvot toisistaan Varoitus: Esivahvistuksen asettaminen korkeaan positiiviseen arvoon saattaa johtaa säröilyyn joissain kappaleissa. - Valitse kansiot Ilmoita viasta GitHubissa Lähetä sähköpostia Lisää @@ -303,7 +302,6 @@ Esivahvistinta käytetään olemassa olevaan säätöön toiston aikana Säätö tunnisteilla Tuntematon albumi - Uusi kansio MPEG-4 sisältäen %s Tuntematon Kappaleesi tulevat näkymään tässä. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 1d452678b..4b505ddcf 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -311,7 +311,6 @@ Avis Faire un ticket sur GitHub Envoyer un courriel - Choisir des dossiers Inconnu MPEG-4 contenant %s Vos chansons s\'afficheront ici. @@ -321,9 +320,10 @@ Vos albums vont s\'afficher ici. Vos artistes vont s\'afficher ici. Inclure les fichiers cachés - Nouveau dossier Économiser de l\'espace Album inconnu Codec audio sans perte Apple (ALAC) Telle quelle + Dossiers exclus + Gérer les dossiers pour exclure du chargement de musique diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 0601971ad..d6baf50ae 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -306,13 +306,11 @@ Povratne informacije Prijavi problem na GitHubu Pošalji e-mail - Odaberi mape Appleov kodek zvuka bez gubitaka (ALAC) Nepoznat album Nepoznato MPEG-4 sadrži %s Niža kvaliteta - Nova mapa Tvoje pjesme će se ovdje prikazati. Tvoji albumi će se ovdje prikazati. Tvoji izvođači će se ovdje prikazati. diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 09eabacee..b28b85802 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -302,8 +302,6 @@ Lejátszási lista importálva Nem sikerült importálni a lejátszási listát ebből a fájlból Nem sikerült exportálni a lejátszási listát ebbe a fájlba - Válassz mappákat - Új mappa Ismeretlen album Itt fognak megjelenni a számaid. Rejtett fájlok megjelenítése @@ -323,4 +321,6 @@ Ismeretlen Visszajelzés Hozz létre egy hibajegyet a GitHubon + Kizárt mappák + Mappák kihagyása a zenevizsgálatból diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 7838f51cf..d2c2a5021 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -298,7 +298,6 @@ Relatif Informasi kesalahan Sortir nama yang dimulai dengan nomor atau kata seperti \"the\" dengan benar (bekerja paling baik dengan lagu berbahasa Inggris) - Pilih folder Lebih banyak Lagu-lagu Anda akan muncul di sini. Mulai pemutaran diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 46fc76520..a5d69bcd9 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -309,9 +309,8 @@ Mantiene riproduzione/pausa durante il cambio di brano e la modifica della coda di riproduzione Avvia la riproduzione Avvia Auxio utilizzando le ultime impostazioni di riproduzione salvate. Se non è disponibile alcuna impostazione di riproduzione, i brani verranno riprodotti in ordine casuale. La riproduzione inizierà immediatamente.\n\nAttenzione: fai attenzione a controllare questa impostazione; se lo chiudi e poi provi a usarlo di nuovo, è probabile che l\'app si blocchi. - Scegli le cartelle Feedback - Invia un\'email + Invia un\'e-mail Apri un\'issue su GitHub Album sconosciuto I tuoi generi appariranno qui. @@ -320,7 +319,6 @@ I tuoi album appariranno qui. Le tue playlist appariranno qui. Espandi - Nuova cartella Bassa qualità MPEG-4 contenente %s Apple Lossless Audio Codec (ALAC) diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index fddc6a372..2e9b21ce2 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -289,7 +289,6 @@ רשימת השמעה יוצאה יצא רשימת השמעה אין יכולת לייצא רשימת השמעה מהקובץ הנ”ל - בחר תיקיות התחל השמעה זכור השהיה כבוי @@ -301,7 +300,6 @@ תיקון רצועות ReplayGain תיקון אלבומים ReplayGain יוצר - תיקיה חדשה תרמו לפרויקט כדי להוסיף את שמכם כאן! מפעיל Auxio במצב שנשמר קודם לכן. אם אין מצב שמור זמין, כל השירים יתערבבו. השמעה תתחיל מידית.\n\nאזהרה: היזהר בשליטה בשירות זה, אם תסגרו אותו ואחר כך תנסו להשתמש בו שוב, ייתכן שתקרסו את האפליקציה. הישאר בניגון/בהשהיה בעת דילוג או עריכה של התור diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 05b04f63c..afbc8ccbe 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -279,9 +279,7 @@ オフ このファイルからプレイリストをインポートできません このファイルにプレイリストをエクスポートできません - フォルダを選択 そのまま - 新しいフォルダー 不明なアルバム %sを含むMPEG-4 曲を単独で再生 diff --git a/app/src/main/res/values-ka/strings.xml b/app/src/main/res/values-ka/strings.xml index b0db011df..5bced8d07 100644 --- a/app/src/main/res/values-ka/strings.xml +++ b/app/src/main/res/values-ka/strings.xml @@ -12,7 +12,6 @@ EP-ები ყველა სიმღერა ალბომი - შეარჩიე საქაღალდეები მუსიკის ჩატვირთვა პირდაპირი EP სინგლები @@ -99,7 +98,6 @@ ავტომატური ჩატვირთვა სურათები მუსიკის საქაღალდე - ახალი საქაღალდე ბოლო სიმღერაზე გადასვლა სტატისტიკა ლიცენზიები diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 0554e1575..b544d67dd 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -308,8 +308,7 @@ \n \n경고: 이 서비스는 주의하여 사용하세요. 서비스를 닫은 뒤 다시 사용하려고 할 경우 앱이 충돌할 수 있습니다. 더 보기 - 폴더 선택 전자우편을 전송합니다 깃허브에 문제를 제기합니다 응답 - \ No newline at end of file + diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index a87719701..50cb047ae 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -124,7 +124,7 @@ Praleisti į sekančią dainą Praleisti į paskutinę dainą Mikso juosta - Misko juostos + Mikso juostos Bibliotekos skirtukai Keisk bibliotekos skirtukų matomumą ir tvarką. Pageidauti albumą @@ -315,13 +315,13 @@ Čia bus rodomi jūsų atlikėjai. Čia bus rodomi jūsų grojaraščiai. Čia bus rodomi jūsų žanrai. - Pasirinkti aplankus Siųsti el. laišką - Naujas aplankas „Apple“ nenuostolingas garso kodekas (ALAC) Nežinomas Išsaugoti vietos Kaip yra Įtraukti paslėptus failus Įtraukite garso failus, kurie paslėpti (pvz., .cache) + Neįtraukti aplankai + Tvarkykite aplankus, kuriuos norite neįtraukti iš muzikos įkėlimo. diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index 81ef9a412..4f3ec22c4 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -301,5 +301,4 @@ Opprett en sak på GitHub Gi tilbakemelding Send en e-post - Velg mapper - \ No newline at end of file + diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index 663089e98..366d19cb2 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -19,7 +19,6 @@ एल्बम गीतहरु लोड गर्दै सङ्गीत लाइब्रेरी निगरानी गर्दै - फोल्डर छान्नुहोस् गीतहरु गीत सबै गीत diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 516284fd1..f1a85658c 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -304,7 +304,6 @@ Gebruik Windows-compatibele paden Rapporteer Afspeellijst geëxporteerd - Kies mappen Zoals Meer Begint Auxio met de vorige redde staat. Als er geen gerede staat beschikbaar is, worden alle liedjes geschud. Playback zal onmiddellijk beginnen.\n\nWees voorzichtig met het controleren van deze dienst, als je het sluit en het weer probeert te gebruiken, zal je waarschijnlijk de app crashen. @@ -321,7 +320,6 @@ Onbekend album MPEG-4 bevat %s Ruimte besparen - Nieuwe map Feedback Afspelen Inclusief audiobestanden die verborgen zijn (excl. .cache) diff --git a/app/src/main/res/values-nn/strings.xml b/app/src/main/res/values-nn/strings.xml index 3ed6dbfae..337512485 100644 --- a/app/src/main/res/values-nn/strings.xml +++ b/app/src/main/res/values-nn/strings.xml @@ -301,5 +301,4 @@ %d Hz Innlasta album: %d Total lengd: %s - Vel mapper diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 876851fd9..dc45976fa 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -314,11 +314,9 @@ Wyślij e-maila Informacja zwrotna Zgłoś problem na GitHubie - Wybierz foldery MPEG-4 zawierający %s Nieznany Nieznany album - Nowy folder Apple Lossless Audio Codec (ALAC) Oszczędzanie miejsca Tutaj pojawią się dodane utwory. diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index a63c687db..d93a7ba06 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -211,7 +211,7 @@ Define caracteres que indiquem mais de um valor nos metadados Ignora arquivos de áudio que não sejam música, como podcasts Aviso: Usar essa configuração pode resultar em alguns metadados serem interpretadas incorretamente como tendo múltiplos valores. Você pode resolver isso pré-definindo caracteres de separador indesejados com uma barra invertida (\\). - Ignorar arquivos que não sejam músicas + Ignorar os arquivos que não sejam músicas Qualidade das capas de álbuns Desativado Equilibrado @@ -312,7 +312,6 @@ Mais Envie um e-mail Crie uma issue no GitHub - Escolher pastas MPEG-4 contendo %s Apple Lossless Audio Codec (ALAC) Desconhecido @@ -324,10 +323,13 @@ As suas playlists aparecerão aqui. Os seus gêneros aparecerão aqui. Economizar espaço - Nova pasta Qualidade original Ignorar arquivos e pastas que estão ocultos (por exemplo, .cache) Ignorar arquivos ocultos Gerencie as pastas a serem ignoradas no carregamento de músicas Pastas ignoradas + Usar o cache do sistema de arquivos + Melhora o tempo de carregamento, mas pode impedir que novas músicas sejam adicionadas + Adicionar pasta + Sem pastas diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 72392e852..5415a116e 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -307,9 +307,7 @@ Usar caminhos compatíveis com Windows Inicia o Auxio usando o estado gravado anteriormente. Se nenhum estado gravado estiver disponível, todas as músicas serão baralhadas. A reprodução começará imediatamente.\n\nAVISO: Tenha cuidado ao controlar este serviço, se fechá-lo e tentar usá-lo novamente, provavelmente irá travar a app. Iniciar reprodução - Escolha pastas Álbum desconhecido - Nova pasta Opinião Ignorar ficheiros ocultos Apple Lossless Audio Codec (ALAC) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index c411e4686..47c57a010 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -304,18 +304,18 @@ Opinião Crie um problema no GitHub Envie um e-mail - Escolha pastas Os seus artistas aparecerão aqui. Álbum desconhecido As suas músicas aparecerão aqui. Os seus álbuns aparecerão aqui. As suas listas de reprodução aparecerão aqui. Os seus gêneros aparecerão aqui. - Nova pasta Salvar espaco MPEG-4 contendo %s Apple Lossless Audio Codec (ALAC) Desconhecido Ignorar ficheiros e pastas que estão ocultos (por exemplo, .cache) Ignorar ficheiros ocultos + Pastas excluídas + Gerir pastas para excluir do carregamento de música diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 66bc5b43c..c3586d3aa 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -317,11 +317,9 @@ Больше Отзывы Отправить электронное письмо - Выберите папки MPEG-4, содержащий %s Неизвестный альбом Здесь появятся ваши исполнители. - Новая папка Apple Lossless Audio Codec (ALAC) Неизвестный Здесь будут отображаться ваши плейлисты. diff --git a/app/src/main/res/values-sq/strings.xml b/app/src/main/res/values-sq/strings.xml index f19ff2835..5de826542 100644 --- a/app/src/main/res/values-sq/strings.xml +++ b/app/src/main/res/values-sq/strings.xml @@ -301,14 +301,12 @@ Kohëzgjatja totale: %s A dëshironi të fshini %s? Kjo nuk mund të anulohet. Lejla - Zgjidh dosjet Album i panjohur Këngët e tua do të shfaqen këtu. Albumet tuaja do të shfaqen këtu. Artistët e tu do të shfaqen këtu. Listat tuaja për luajtje do të shfaqen këtu. Zhanret tuaja do të shfaqen këtu. - Dosje e re Apple Lossless Audio Codec (ALAC) E panjohur Kurseni hapësirë diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 2e810c9db..f79067b37 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -295,11 +295,9 @@ Använd Windowskompatibla sökvägar Inga album Av - Välj mappar Skapa ett ärende på GitHub Mer Okänt album - Ny mapp Okänt Skicka ett mejl Feedback diff --git a/app/src/main/res/values-ta/strings.xml b/app/src/main/res/values-ta/strings.xml index 38e9d15f5..4083a330a 100644 --- a/app/src/main/res/values-ta/strings.xml +++ b/app/src/main/res/values-ta/strings.xml @@ -18,7 +18,7 @@ மீண்டும் பயன்முறை பல மதிப்பு பிரிப்பான்கள் பிளச் (+) - ஆம்பர்சண்ட் (&) + உம்மைக் குறி (&) ஒத்துழைப்பாளர்களை மறைக்கவும் படங்கள் ஆடியோ @@ -51,7 +51,6 @@ இசையை ஏற்றுகிறது கண்காணிப்பு இசை நூலகம் மீண்டும் முயற்சிக்கவும் - கோப்புறைகளைத் தேர்ந்தெடுங்கள் பாடல்கள் பாடல் அனைத்து பாடல்களும் @@ -302,4 +301,18 @@ நிகழ்நிலை ஈபி -%.1f டெசிபெல் - \ No newline at end of file + மாறாமல் + %s கொண்ட MPEG-4 + தெரியாத ஆல்பம் + உங்களுடைய ஆல்பங்கள் இங்கே காணப்படும். + உங்களுடைய இசைப் பட்டியல்கள் இங்கே காணப்படும். + மறுக்கப்பட்ட கோப்புறைகள் + இசை ஏற்றத்தில் இருந்து விலக்க வேண்டிய கோப்புறைகளை நிர்வகிக்கவும் + தெரியாதவை + மறைக்கப்பட்ட கோப்புகளை உட்படுத்து + மறைக்கப்பட்ட ஒலி கோப்புகளை உட்படுத்தவும் (உதா. .cache) + இடத்தை சேமிக்கவும் + உங்களுடைய பாடல்கள் இங்கே காணப்படும். + உங்களுடைய இசை வகைகள் இங்கே காணப்படும். + உங்களுடைய கலைஞர்கள் இங்கே காணப்படும். + diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index e471b33a8..ae3b35de2 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -66,7 +66,7 @@ Bit hızı Örnek hızı Müzik çalmayı görüntüle ve kontrol et - Android için basit, rasyonel bir müzik çalar. + Android için basit, akıllı bir müzik çalar. Müzik yükleniyor Müzik kitaplığınız yükleniyor… Ad @@ -275,7 +275,6 @@ %s silinsin mi\? Geri alınamaz. Üzerinde görünür Albüm yok - Klasör şeç Oynatma listesini dışa aktar Denemeler ReplayGain albüm ayarlaması @@ -303,7 +302,6 @@ Oynatma listesi aktar Boş oynatma listesi Dosya yolu - Yeni klasör Dışa aktar İçe aktar Daha fazla @@ -322,4 +320,6 @@ Gizli dosyaları içer Gizli olan ses dosyalarını içer (örn. .cache) Olduğu gibi + Müzik yüklemesinde sayılmayacak klasörleri yönet + Sayılmayan klasörler diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 14aa79712..9fc4b8ffc 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -312,7 +312,6 @@ \n \nПопередження: будьте обережні при керуванні цією службою, якщо ви закриєте її, а потім спробуєте використовувати знову, ви, ймовірно, призведе до збою застосунка. Більше - Виберіть папки Зворотній зв\'язок Зробіть випуск на GitHub Надіслати електронний лист @@ -320,7 +319,6 @@ MPEG-4, що містить %s Невідомий Аудіокодек Apple без втрат (ALAC) - Нова папка Економія місця Ваші пісні відображатимуться тут. Ваші альбоми відображатимуться тут. @@ -332,4 +330,8 @@ Включати приховані аудіофайли (наприклад, .cache) Виключені папки Керування папками, які потрібно виключити із завантаження музики + Використовуйте кеш-систему файлів + Покращує час завантаження, але може запобігти додаванню нової музики + Додати папку + Немає папок diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 92c1650ee..b7d0131d7 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -309,12 +309,10 @@ 在 GithHub 上开 issue 发送电子邮件 反馈 - 选择文件夹 未知专辑 含 %s 的 MPEG-4 Apple 无损音频编解码器(ALAC) 未知 - 新文件夹 节省空间 歌曲会出现在此处。 艺术家会出现在此处。 @@ -326,4 +324,6 @@ 包括隐藏的音频文件(排除 .cache) 管理要排除在音乐加载以外的文件夹 排除的文件夹 + 使用文件系统缓存 + 改进加载时间,但可能阻止添加新音乐 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 632e42f3a..36b01ca7f 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -41,7 +41,7 @@ 音軌 %d 播放 / 暫停 - 正在搜尋媒體… + 搜尋您的媒體… %d 首歌曲 @@ -69,7 +69,7 @@ 專輯 單曲 單曲 - 更多介面元素套用圓角(專輯封面需另外啟用) + 更多介面元素套用圓角(專輯封面需另外啟用) 演出者 新的播放清單 匯入播放清單 @@ -95,7 +95,7 @@ 播放清單 播放清單 刪除 - 歌曲計數 + 歌曲數量 DJ 混音 刪除播放清單? 降序 @@ -160,7 +160,6 @@ 記憶暫停 管理分頁 變更主題與色彩 - 選擇資料夾 循環模式 移至下一首 播放所有曲目 @@ -199,20 +198,20 @@ 播放新曲目時保留隨機播放 內容 配置符號時表示多個標籤數值 - 隨時掃描媒體資料變化(需要啟用持續性通知) + 隨時掃描媒體資料變化(需要啟用持續性通知) 分號 (;) 逗號 (,) 斜線號 (/) - 專輯封面僅顯示單一演出者(對標籤完善的媒體庫效果最佳) + 專輯封面僅顯示單一演出者(對標籤完善的媒體庫效果最佳) 將所有專輯封面裁剪為 1:1 - 連接耳機時立即播放音樂 (可能不適用所有裝置) + 連接耳機時立即播放音樂(可能不適用所有裝置) 編輯或略過清單時保留播放狀態 重播增益模式 偏好專輯 重播增益前級擴大 播放期間為現有調整套用前級擴大 調整標籤 - 清除所有標籤快取並重新載入媒體 (完整但速度較慢) + 清除所有標籤快取並重新載入媒體(完整但速度較慢) 找不到可處理這項操作的應用程式 刪除歌曲 Auxio 圖示 @@ -257,16 +256,15 @@ MPEG-4 紫色 變更循環播放模式 - 準確排序以單字或數字為首的名稱(例如 The,對英文效果最佳) + 準確排序以單字或數字為首的名稱(例如 The,對英文效果最佳) 登場 播放專輯 與號 (&) 播放單曲 - 新資料夾 刪除資料夾 合輯 確定 - 維基百科 + 線上百科 選取項目 在 GitHub 張貼問題 贊助 @@ -278,7 +276,7 @@ 平衡 高畫質 啟用 / 停用隨機播放 - 沒有日期 + 無日期 選取影像 警告:啟用可能會誤判某些符號具有多重數值。您可在不需要的分隔符號前插入後斜線 (\\)。 混音合輯 @@ -291,7 +289,7 @@ 由 Alexander Capehart 開發 播放演出者 播放類型 - 讀取隱藏音訊檔案 (例如 .cache) + 讀取隱藏音訊檔案(例如 .cache) 原始 重播單曲時暫停 不調整標籤 @@ -319,4 +317,8 @@ -%.1f dB 自由無損音訊編碼 (FLAC) Apple 無損音訊編碼 (ALAC) + 排除資料夾 + 管理不需讀取音樂的資料夾 + 使用檔案系統快取 + 改善讀取時間,但會阻擋音樂新增 diff --git a/app/src/main/res/values/settings.xml b/app/src/main/res/values/settings.xml index fd5d1857b..08ab26609 100644 --- a/app/src/main/res/values/settings.xml +++ b/app/src/main/res/values/settings.xml @@ -22,8 +22,11 @@ auxio_with_hidden auxio_music_locations2 auxio_excluded_locations + auxio_filter_mode + auxio_filtered_locations auxio_separators auxio_auto_sort_names + auxio_locations_mode auxio_headset_autoplay auxio_replay_gain @@ -58,6 +61,8 @@ auxio_library_revision + auxio_force_reload + @string/set_theme_auto @string/set_theme_day diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9111f1465..d1e92d165 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -16,9 +16,6 @@ Monitoring music library Retry - Pick folders - - Songs Song @@ -217,6 +214,12 @@ Your artists will show up here. Your genres will show up here. Your playlists will show up here. + Load music from the folders that you select. Slower, but more reliable. Requires the vanilla file manager app to be installed. + Load music that the Android OS automatically detects. Faster, but less reliable. No support for filesystem-dependent features like cover.jpg. + Granting external storage permissions can fix issues on some devices. + Grant external storage permissions to enable this option. + Music outside of the selected folders will be ignored. + Music inside the selected folders will be ignored. @@ -312,9 +315,20 @@ Warning: Changing the pre-amp to a high positive value may result in peaking on some audio tracks. Library - Music folders + Music sources Manage where music should be loaded from - New folder + Load From + File picker + System + Storage access recommended + Storage access required + Folders to Load + Folders to Ignore + Filtered Folders + Filter Mode + Include + Exclude + More settings Use file-system cache Improves loading times, but can prevent new music from being added Excluded folders @@ -332,6 +346,7 @@ No app found that can handle this task This folder is not supported + No Folders @@ -349,6 +364,7 @@ Open the queue Move this tab Clear search query + Add Folder Remove folder Auxio icon @@ -359,6 +375,7 @@ Playlist image for %s Selection image + diff --git a/app/src/main/res/values/typography.xml b/app/src/main/res/values/typography.xml index af958330b..fabc21d6b 100644 --- a/app/src/main/res/values/typography.xml +++ b/app/src/main/res/values/typography.xml @@ -78,6 +78,13 @@ -0.01125 + +