Coordinate snapshot restoration before indexing
This commit is contained in:
@@ -22,6 +22,7 @@ import android.content.Context
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
import org.oxycblt.musikr.Config
|
||||
import org.oxycblt.musikr.Interpretation
|
||||
import org.oxycblt.musikr.Library
|
||||
import org.oxycblt.musikr.MutableLibrary
|
||||
import org.oxycblt.musikr.model.SongImpl
|
||||
@@ -29,10 +30,28 @@ import org.oxycblt.musikr.playlist.db.StoredPlaylists
|
||||
import org.oxycblt.musikr.playlist.interpret.PlaylistInterpreter
|
||||
import org.oxycblt.musikr.tag.interpret.PreSong
|
||||
|
||||
class LibrarySnapshot(private val context: Context, config: Config) {
|
||||
class LibrarySnapshot
|
||||
private constructor(
|
||||
private val context: Context,
|
||||
private val storedPlaylists: StoredPlaylists,
|
||||
private val playlistInterpreter: PlaylistInterpreter,
|
||||
) {
|
||||
constructor(
|
||||
context: Context,
|
||||
config: Config,
|
||||
) : this(
|
||||
context,
|
||||
config.storage.storedPlaylists,
|
||||
PlaylistInterpreter.new(config.interpretation),
|
||||
)
|
||||
|
||||
constructor(
|
||||
context: Context,
|
||||
storedPlaylists: StoredPlaylists,
|
||||
interpretation: Interpretation,
|
||||
) : this(context, storedPlaylists, PlaylistInterpreter.new(interpretation))
|
||||
|
||||
private val storedCoverDirectory = File(context.filesDir, "covers")
|
||||
private val storedPlaylists: StoredPlaylists = config.storage.storedPlaylists
|
||||
private val playlistInterpreter = PlaylistInterpreter.new(config.interpretation)
|
||||
|
||||
suspend fun capture(
|
||||
library: Library,
|
||||
|
||||
Reference in New Issue
Block a user