all: cleanup
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
|
||||
package org.oxycblt.musikr
|
||||
|
||||
import android.net.Uri
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
@@ -35,7 +34,7 @@ import org.oxycblt.musikr.tag.Interpretation
|
||||
|
||||
interface Indexer {
|
||||
suspend fun run(
|
||||
locations: MusicLocation,
|
||||
locations: List<MusicLocation>,
|
||||
interpretation: Interpretation,
|
||||
onProgress: suspend (IndexingProgress) -> Unit = {}
|
||||
): MutableLibrary
|
||||
@@ -60,14 +59,14 @@ constructor(
|
||||
private val evaluateStep: EvaluateStep
|
||||
) : Indexer {
|
||||
override suspend fun run(
|
||||
locations: MusicLocation,
|
||||
locations: List<MusicLocation>,
|
||||
interpretation: Interpretation,
|
||||
onProgress: suspend (IndexingProgress) -> Unit
|
||||
) = coroutineScope {
|
||||
var exploredCount = 0
|
||||
val explored =
|
||||
exploreStep
|
||||
.explore(uris)
|
||||
.explore(locations)
|
||||
.buffer(Channel.UNLIMITED)
|
||||
.onStart { onProgress(IndexingProgress.Songs(0, 0)) }
|
||||
.onEach { onProgress(IndexingProgress.Songs(0, ++exploredCount)) }
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Auxio Project
|
||||
* MimeType.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.oxycblt.musikr
|
||||
|
||||
import android.content.Context
|
||||
@@ -81,4 +99,4 @@ data class MimeType(val fromExtension: String, val fromFormat: String?) {
|
||||
MimeTypeMap.getSingleton().getExtensionFromMimeType(fromExtension)?.uppercase()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@ import kotlinx.parcelize.IgnoredOnParcel
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import org.oxycblt.auxio.list.Item
|
||||
import org.oxycblt.auxio.music.MusicType
|
||||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||
import org.oxycblt.auxio.util.concatLocalized
|
||||
import org.oxycblt.auxio.util.toUuidOrNull
|
||||
import org.oxycblt.musikr.cover.Cover
|
||||
import org.oxycblt.musikr.fs.Path
|
||||
import org.oxycblt.musikr.tag.Date
|
||||
import org.oxycblt.musikr.tag.Disc
|
||||
import org.oxycblt.musikr.tag.Name
|
||||
import org.oxycblt.musikr.tag.ReleaseType
|
||||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||
import org.oxycblt.auxio.util.concatLocalized
|
||||
import org.oxycblt.auxio.util.toUuidOrNull
|
||||
|
||||
interface Library {
|
||||
val songs: Collection<Song>
|
||||
|
||||
@@ -44,8 +44,7 @@ constructor(
|
||||
val id = coverIdentifier.identify(data)
|
||||
coverFiles.write(id, data)
|
||||
storedCoversDao.setStoredCover(
|
||||
StoredCover(uid = cover.uid, lastModified = cover.lastModified, coverId = id)
|
||||
)
|
||||
StoredCover(uid = cover.uid, lastModified = cover.lastModified, coverId = id))
|
||||
return coverFiles.read(id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,6 @@ import kotlinx.coroutines.flow.emitAll
|
||||
import kotlinx.coroutines.flow.flatMapMerge
|
||||
import kotlinx.coroutines.flow.flattenMerge
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import org.oxycblt.musikr.fs.path.DocumentPathFactory
|
||||
import timber.log.Timber
|
||||
|
||||
interface DeviceFiles {
|
||||
fun explore(locations: Flow<MusicLocation>): Flow<DeviceFile>
|
||||
@@ -47,11 +45,8 @@ data class DeviceFile(
|
||||
)
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class DeviceFilesImpl
|
||||
@Inject
|
||||
constructor(
|
||||
@ApplicationContext private val context: Context
|
||||
) : DeviceFiles {
|
||||
class DeviceFilesImpl @Inject constructor(@ApplicationContext private val context: Context) :
|
||||
DeviceFiles {
|
||||
private val contentResolver = context.contentResolverSafe
|
||||
|
||||
override fun explore(locations: Flow<MusicLocation>): Flow<DeviceFile> =
|
||||
@@ -71,8 +66,7 @@ constructor(
|
||||
): Flow<DeviceFile> = flow {
|
||||
contentResolver.useQuery(
|
||||
DocumentsContract.buildChildDocumentsUriUsingTree(rootUri, treeDocumentId),
|
||||
PROJECTION
|
||||
) { cursor ->
|
||||
PROJECTION) { cursor ->
|
||||
val childUriIndex =
|
||||
cursor.getColumnIndexOrThrow(DocumentsContract.Document.COLUMN_DOCUMENT_ID)
|
||||
val displayNameIndex =
|
||||
@@ -104,8 +98,7 @@ constructor(
|
||||
mimeType,
|
||||
newPath,
|
||||
size,
|
||||
lastModified)
|
||||
)
|
||||
lastModified))
|
||||
}
|
||||
}
|
||||
emitAll(recursive.asFlow().flattenMerge())
|
||||
|
||||
@@ -20,19 +20,12 @@ package org.oxycblt.musikr.fs
|
||||
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
||||
import android.os.storage.StorageManager
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import org.oxycblt.musikr.fs.path.DocumentPathFactory
|
||||
import org.oxycblt.musikr.fs.path.DocumentPathFactoryImpl
|
||||
import org.oxycblt.musikr.fs.path.MediaStorePathInterpreter
|
||||
import org.oxycblt.auxio.util.getSystemServiceCompat
|
||||
import org.oxycblt.musikr.fs.path.VolumeManager
|
||||
import org.oxycblt.musikr.fs.path.VolumeManagerImpl
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
@@ -47,5 +40,8 @@ class FsProvidesModule {
|
||||
interface FsBindsModule {
|
||||
@Binds fun deviceFiles(deviceFilesImpl: DeviceFilesImpl): DeviceFiles
|
||||
|
||||
@Binds fun musicLocationFactory(musicLocationFactoryImpl: MusicLocationFactoryImpl): MusicLocation.Factory
|
||||
@Binds
|
||||
fun musicLocationFactory(
|
||||
musicLocationFactoryImpl: MusicLocationFactoryImpl
|
||||
): MusicLocation.Factory
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Auxio Project
|
||||
* MusicLocation.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.oxycblt.musikr.fs
|
||||
|
||||
import android.content.Context
|
||||
@@ -5,20 +23,21 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.provider.DocumentsContract
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import org.oxycblt.musikr.fs.path.DocumentPathFactory
|
||||
import org.oxycblt.musikr.fs.path.VolumeManager
|
||||
import javax.inject.Inject
|
||||
import org.oxycblt.musikr.fs.path.DocumentPathFactory
|
||||
|
||||
class MusicLocation internal constructor(val uri: Uri, val path: Path) {
|
||||
override fun equals(other: Any?) =
|
||||
other is MusicLocation && uri == other.uri && path == other.path
|
||||
|
||||
override fun hashCode() = 31 * uri.hashCode() + path.hashCode()
|
||||
|
||||
override fun toString(): String {
|
||||
val volumeId = when (path.volume) {
|
||||
is Volume.Internal -> VOLUME_INTERNAL
|
||||
is Volume.External -> path.volume.id
|
||||
}
|
||||
val volumeId =
|
||||
when (path.volume) {
|
||||
is Volume.Internal -> VOLUME_INTERNAL
|
||||
is Volume.External -> path.volume.id
|
||||
}
|
||||
return "$uri=${volumeId}:${path.components.unixString}"
|
||||
}
|
||||
|
||||
@@ -29,32 +48,37 @@ class MusicLocation internal constructor(val uri: Uri, val path: Path) {
|
||||
}
|
||||
}
|
||||
|
||||
class MusicLocationFactoryImpl @Inject constructor(
|
||||
class MusicLocationFactoryImpl
|
||||
@Inject
|
||||
constructor(
|
||||
@ApplicationContext private val context: Context,
|
||||
private val documentPathFactory: DocumentPathFactory
|
||||
) : MusicLocation.Factory {
|
||||
override fun new(uri: Uri): MusicLocation? {
|
||||
if (!DocumentsContract.isTreeUri(uri)) return null
|
||||
val path = documentPathFactory.unpackDocumentTreeUri(uri) ?: return null
|
||||
val notPersisted = context.contentResolverSafe.persistedUriPermissions
|
||||
.none { it.uri == uri && it.isReadPermission && it.isWritePermission }
|
||||
val notPersisted =
|
||||
context.contentResolverSafe.persistedUriPermissions.none {
|
||||
it.uri == uri && it.isReadPermission && it.isWritePermission
|
||||
}
|
||||
if (notPersisted) {
|
||||
context.contentResolverSafe.takePersistableUriPermission(
|
||||
uri,
|
||||
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION
|
||||
)
|
||||
Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
|
||||
}
|
||||
return MusicLocation(uri, path)
|
||||
}
|
||||
|
||||
override fun existing(uri: Uri): MusicLocation? {
|
||||
if (!DocumentsContract.isTreeUri(uri)) return null
|
||||
val notPersisted = context.contentResolverSafe.persistedUriPermissions
|
||||
.none { it.uri == uri && it.isReadPermission && it.isWritePermission }
|
||||
val notPersisted =
|
||||
context.contentResolverSafe.persistedUriPermissions.none {
|
||||
it.uri == uri && it.isReadPermission && it.isWritePermission
|
||||
}
|
||||
if (notPersisted) return null
|
||||
val path = documentPathFactory.unpackDocumentTreeUri(uri) ?: return null
|
||||
return MusicLocation(uri, path)
|
||||
}
|
||||
}
|
||||
|
||||
private const val VOLUME_INTERNAL = "internal"
|
||||
private const val VOLUME_INTERNAL = "internal"
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Auxio Project
|
||||
* Path.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.oxycblt.musikr.fs
|
||||
|
||||
import android.content.Context
|
||||
@@ -159,4 +177,4 @@ value class Components private constructor(val components: List<String>) {
|
||||
|
||||
private fun String.trimSlashes() = trimStart(File.separatorChar).trimEnd(File.separatorChar)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Auxio Project
|
||||
* FsModule.kt is part of Auxio.
|
||||
* PathModule.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
|
||||
@@ -15,10 +15,9 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
package org.oxycblt.musikr.fs.path
|
||||
|
||||
import android.content.ContentResolver
|
||||
import android.content.Context
|
||||
import android.os.storage.StorageManager
|
||||
import dagger.Binds
|
||||
@@ -27,12 +26,7 @@ import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import org.oxycblt.musikr.fs.path.DocumentPathFactory
|
||||
import org.oxycblt.musikr.fs.path.DocumentPathFactoryImpl
|
||||
import org.oxycblt.musikr.fs.path.MediaStorePathInterpreter
|
||||
import org.oxycblt.auxio.util.getSystemServiceCompat
|
||||
import org.oxycblt.musikr.fs.path.VolumeManager
|
||||
import org.oxycblt.musikr.fs.path.VolumeManagerImpl
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
|
||||
@@ -1,8 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Auxio Project
|
||||
* VolumeManager.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.oxycblt.musikr.fs.path
|
||||
|
||||
import android.content.Context
|
||||
import android.os.storage.StorageManager
|
||||
import android.os.storage.StorageVolume
|
||||
import javax.inject.Inject
|
||||
import org.oxycblt.musikr.fs.Components
|
||||
import org.oxycblt.musikr.fs.Volume
|
||||
import org.oxycblt.musikr.fs.directoryCompat
|
||||
@@ -11,7 +30,6 @@ import org.oxycblt.musikr.fs.isInternalCompat
|
||||
import org.oxycblt.musikr.fs.mediaStoreVolumeNameCompat
|
||||
import org.oxycblt.musikr.fs.storageVolumesCompat
|
||||
import org.oxycblt.musikr.fs.uuidCompat
|
||||
import javax.inject.Inject
|
||||
|
||||
/** A wrapper around [StorageManager] that provides instances of the [Volume] interface. */
|
||||
interface VolumeManager {
|
||||
@@ -66,4 +84,4 @@ class VolumeManagerImpl @Inject constructor(private val storageManager: StorageM
|
||||
|
||||
override fun resolveName(context: Context) = storageVolume.getDescriptionCompat(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
package org.oxycblt.musikr.graph
|
||||
|
||||
import javax.inject.Inject
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
import org.oxycblt.musikr.Music
|
||||
import org.oxycblt.musikr.tag.interpret.PreAlbum
|
||||
import org.oxycblt.musikr.tag.interpret.PreArtist
|
||||
import org.oxycblt.musikr.tag.interpret.PreGenre
|
||||
import org.oxycblt.musikr.tag.interpret.PreSong
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
import timber.log.Timber as L
|
||||
|
||||
data class MusicGraph(
|
||||
|
||||
@@ -23,8 +23,8 @@ import android.media.MediaExtractor
|
||||
import android.media.MediaFormat
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import javax.inject.Inject
|
||||
import org.oxycblt.musikr.Song
|
||||
import org.oxycblt.musikr.MimeType
|
||||
import org.oxycblt.musikr.Song
|
||||
import timber.log.Timber as L
|
||||
|
||||
/**
|
||||
@@ -119,7 +119,6 @@ constructor(@ApplicationContext private val context: Context) : AudioProperties.
|
||||
return AudioProperties(
|
||||
bitrate,
|
||||
sampleRate,
|
||||
MimeType(fromExtension = song.mimeType.fromExtension, fromFormat = formatMimeType)
|
||||
)
|
||||
MimeType(fromExtension = song.mimeType.fromExtension, fromFormat = formatMimeType))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,8 +110,7 @@ constructor(private val mediaSourceFactory: MediaSource.Factory) :
|
||||
job = MetadataJob(data, mediaSourceCaller)
|
||||
|
||||
mediaSourceHandler.sendEmptyMessageDelayed(
|
||||
MESSAGE_CHECK_FAILURE, /* delayMs= */ CHECK_INTERVAL_MS
|
||||
)
|
||||
MESSAGE_CHECK_FAILURE, /* delayMs= */ CHECK_INTERVAL_MS)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
|
||||
package org.oxycblt.musikr.model
|
||||
|
||||
import org.oxycblt.auxio.music.MusicType
|
||||
import org.oxycblt.auxio.util.update
|
||||
import org.oxycblt.musikr.Album
|
||||
import org.oxycblt.musikr.Artist
|
||||
import org.oxycblt.musikr.Genre
|
||||
import org.oxycblt.musikr.Music
|
||||
import org.oxycblt.auxio.music.MusicType
|
||||
import org.oxycblt.musikr.Song
|
||||
import org.oxycblt.musikr.cover.Cover
|
||||
import org.oxycblt.musikr.tag.Date
|
||||
@@ -30,7 +31,6 @@ import org.oxycblt.musikr.tag.interpret.PreAlbum
|
||||
import org.oxycblt.musikr.tag.interpret.PreArtist
|
||||
import org.oxycblt.musikr.tag.interpret.PreGenre
|
||||
import org.oxycblt.musikr.tag.interpret.PreSong
|
||||
import org.oxycblt.auxio.util.update
|
||||
|
||||
interface SongHandle {
|
||||
val preSong: PreSong
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package org.oxycblt.musikr.pipeline
|
||||
|
||||
import android.net.Uri
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@@ -27,16 +26,17 @@ import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.flow.mapNotNull
|
||||
import org.oxycblt.musikr.fs.DeviceFile
|
||||
import org.oxycblt.musikr.fs.DeviceFiles
|
||||
import org.oxycblt.musikr.fs.MusicLocation
|
||||
import org.oxycblt.musikr.playlist.m3u.M3U
|
||||
|
||||
interface ExploreStep {
|
||||
fun explore(uris: List<Uri>): Flow<ExploreNode>
|
||||
fun explore(locations: List<MusicLocation>): Flow<ExploreNode>
|
||||
}
|
||||
|
||||
class ExploreStepImpl @Inject constructor(private val deviceFiles: DeviceFiles) : ExploreStep {
|
||||
override fun explore(uris: List<Uri>) =
|
||||
override fun explore(locations: List<MusicLocation>) =
|
||||
deviceFiles
|
||||
.explore(uris.asFlow())
|
||||
.explore(locations.asFlow())
|
||||
.mapNotNull {
|
||||
when {
|
||||
it.mimeType == M3U.MIME_TYPE -> null
|
||||
|
||||
@@ -26,8 +26,8 @@ import java.io.InputStream
|
||||
import java.io.InputStreamReader
|
||||
import java.io.OutputStream
|
||||
import javax.inject.Inject
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
import org.oxycblt.musikr.Playlist
|
||||
import org.oxycblt.musikr.resolveNames
|
||||
import org.oxycblt.musikr.fs.Components
|
||||
import org.oxycblt.musikr.fs.Path
|
||||
import org.oxycblt.musikr.fs.Volume
|
||||
@@ -35,8 +35,8 @@ import org.oxycblt.musikr.fs.path.VolumeManager
|
||||
import org.oxycblt.musikr.playlist.ExportConfig
|
||||
import org.oxycblt.musikr.playlist.ImportedPlaylist
|
||||
import org.oxycblt.musikr.playlist.PossiblePaths
|
||||
import org.oxycblt.musikr.resolveNames
|
||||
import org.oxycblt.musikr.tag.util.correctWhitespace
|
||||
import org.oxycblt.auxio.util.unlikelyToBeNull
|
||||
import timber.log.Timber as L
|
||||
|
||||
/**
|
||||
@@ -154,8 +154,7 @@ constructor(
|
||||
else ->
|
||||
listOf(
|
||||
InterpretedPath(Components.parseUnix(path), false),
|
||||
InterpretedPath(Components.parseWindows(path), true)
|
||||
)
|
||||
InterpretedPath(Components.parseWindows(path), true))
|
||||
}
|
||||
|
||||
private fun expandInterpretation(
|
||||
|
||||
@@ -20,17 +20,17 @@ package org.oxycblt.musikr.tag.interpret
|
||||
|
||||
import android.net.Uri
|
||||
import java.util.UUID
|
||||
import org.oxycblt.musikr.Music
|
||||
import org.oxycblt.auxio.music.MusicType
|
||||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||
import org.oxycblt.auxio.util.update
|
||||
import org.oxycblt.musikr.MimeType
|
||||
import org.oxycblt.musikr.Music
|
||||
import org.oxycblt.musikr.fs.Path
|
||||
import org.oxycblt.musikr.playlist.PlaylistHandle
|
||||
import org.oxycblt.musikr.tag.Date
|
||||
import org.oxycblt.musikr.tag.Disc
|
||||
import org.oxycblt.musikr.tag.Name
|
||||
import org.oxycblt.musikr.tag.ReleaseType
|
||||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||
import org.oxycblt.auxio.util.update
|
||||
|
||||
data class PreSong(
|
||||
val musicBrainzId: UUID?,
|
||||
|
||||
@@ -20,16 +20,16 @@ package org.oxycblt.musikr.tag.interpret
|
||||
|
||||
import javax.inject.Inject
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.musikr.fs.DeviceFile
|
||||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||
import org.oxycblt.auxio.util.toUuidOrNull
|
||||
import org.oxycblt.musikr.MimeType
|
||||
import org.oxycblt.musikr.fs.DeviceFile
|
||||
import org.oxycblt.musikr.tag.Disc
|
||||
import org.oxycblt.musikr.tag.Interpretation
|
||||
import org.oxycblt.musikr.tag.Name
|
||||
import org.oxycblt.musikr.tag.ReleaseType
|
||||
import org.oxycblt.musikr.tag.parse.ParsedTags
|
||||
import org.oxycblt.musikr.tag.util.parseId3GenreNames
|
||||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||
import org.oxycblt.auxio.util.toUuidOrNull
|
||||
|
||||
interface TagInterpreter {
|
||||
fun interpret(file: DeviceFile, parsedTags: ParsedTags, interpretation: Interpretation): PreSong
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package org.oxycblt.musikr.tag.parse
|
||||
|
||||
import androidx.core.text.isDigitsOnly
|
||||
import org.oxycblt.auxio.util.nonZeroOrNull
|
||||
import org.oxycblt.musikr.tag.Date
|
||||
import org.oxycblt.musikr.tag.util.parseId3v2PositionField
|
||||
import org.oxycblt.musikr.tag.util.parseVorbisPositionField
|
||||
import org.oxycblt.auxio.util.nonZeroOrNull
|
||||
|
||||
// Song
|
||||
fun ExoPlayerTags.musicBrainzId() =
|
||||
|
||||
Reference in New Issue
Block a user