music: move cover impl to image

This commit is contained in:
Alexander Capehart 2024-12-28 09:53:16 -05:00
parent c6e83d1e18
commit ff6d2fe228
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
8 changed files with 12 additions and 12 deletions

View file

@ -124,7 +124,7 @@ object IntegerTable {
/** CoverMode.Off */
const val COVER_MODE_OFF = 0xA11C
/** CoverMode.MediaStore */
const val COVER_MODE_MEDIA_STORE = 0xA11D
const val COVER_MODE_FAST = 0xA11D
/** CoverMode.Quality */
const val COVER_MODE_QUALITY = 0xA11E
/** PlaySong.FromAll */

View file

@ -29,7 +29,7 @@ enum class CoverMode {
/** Do not load album covers ("Off"). */
OFF,
/** Load covers from the fast, but lower-quality media store database ("Fast"). */
MEDIA_STORE,
FAST,
/** Load high-quality covers directly from music files ("Quality"). */
QUALITY;
@ -42,7 +42,7 @@ enum class CoverMode {
get() =
when (this) {
OFF -> IntegerTable.COVER_MODE_OFF
MEDIA_STORE -> IntegerTable.COVER_MODE_MEDIA_STORE
FAST -> IntegerTable.COVER_MODE_FAST
QUALITY -> IntegerTable.COVER_MODE_QUALITY
}
@ -57,7 +57,7 @@ enum class CoverMode {
fun fromIntCode(intCode: Int) =
when (intCode) {
IntegerTable.COVER_MODE_OFF -> OFF
IntegerTable.COVER_MODE_MEDIA_STORE -> MEDIA_STORE
IntegerTable.COVER_MODE_FAST -> FAST
IntegerTable.COVER_MODE_QUALITY -> QUALITY
else -> null
}

View file

@ -49,7 +49,7 @@ class ImageSettingsImpl @Inject constructor(@ApplicationContext context: Context
get() =
CoverMode.fromIntCode(
sharedPreferences.getInt(getString(R.string.set_key_cover_mode), Int.MIN_VALUE))
?: CoverMode.MEDIA_STORE
?: CoverMode.FAST
override val forceSquareCovers: Boolean
get() = sharedPreferences.getBoolean(getString(R.string.set_key_square_covers), false)
@ -64,7 +64,7 @@ class ImageSettingsImpl @Inject constructor(@ApplicationContext context: Context
when {
!sharedPreferences.getBoolean(OLD_KEY_SHOW_COVERS, true) -> CoverMode.OFF
!sharedPreferences.getBoolean(OLD_KEY_QUALITY_COVERS, true) ->
CoverMode.MEDIA_STORE
CoverMode.FAST
else -> CoverMode.QUALITY
}

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.oxycblt.auxio.music.covers
package org.oxycblt.auxio.image.covers
import java.util.UUID
import org.oxycblt.musikr.cover.CoverParams

View file

@ -1,4 +1,4 @@
package org.oxycblt.auxio.music.covers
package org.oxycblt.auxio.image.covers
import android.content.Context
import kotlinx.coroutines.Dispatchers

View file

@ -1,4 +1,4 @@
package org.oxycblt.auxio.music.covers
package org.oxycblt.auxio.image.covers
import android.content.Context
import org.oxycblt.musikr.cover.Cover

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.oxycblt.auxio.music.covers
package org.oxycblt.auxio.image.covers
import android.content.Context
import java.io.File

View file

@ -28,8 +28,8 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.withContext
import kotlinx.coroutines.yield
import org.oxycblt.auxio.music.MusicRepository.IndexingWorker
import org.oxycblt.auxio.music.covers.CoverSilo
import org.oxycblt.auxio.music.covers.SiloedCovers
import org.oxycblt.auxio.image.covers.CoverSilo
import org.oxycblt.auxio.image.covers.SiloedCovers
import org.oxycblt.musikr.IndexingProgress
import org.oxycblt.musikr.Interpretation
import org.oxycblt.musikr.Library