image: add proper constructor to settings
Add proper @Inject constructors to ImageSettings.
This commit is contained in:
parent
62bf532e21
commit
9f74fe8a20
3 changed files with 6 additions and 7 deletions
|
@ -17,12 +17,9 @@
|
|||
|
||||
package org.oxycblt.auxio.image
|
||||
|
||||
import android.content.Context
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
|
||||
@Module
|
||||
|
|
|
@ -19,6 +19,8 @@ package org.oxycblt.auxio.image
|
|||
|
||||
import android.content.Context
|
||||
import androidx.core.content.edit
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import javax.inject.Inject
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.settings.Settings
|
||||
import org.oxycblt.auxio.util.logD
|
||||
|
@ -45,7 +47,7 @@ interface ImageSettings : Settings<ImageSettings.Listener> {
|
|||
}
|
||||
}
|
||||
|
||||
class ImageSettingsImpl(context: Context) :
|
||||
class ImageSettingsImpl @Inject constructor(@ApplicationContext context: Context) :
|
||||
Settings.Impl<ImageSettings.Listener>(context), ImageSettings {
|
||||
override val coverMode: CoverMode
|
||||
get() =
|
||||
|
|
|
@ -192,9 +192,9 @@ private class Task(context: Context, private val rawSong: RawSong) {
|
|||
textFrames["TXXX:musicbrainz album id"]?.let { rawSong.albumMusicBrainzId = it.first() }
|
||||
textFrames["TALB"]?.let { rawSong.albumName = it.first() }
|
||||
textFrames["TSOA"]?.let { rawSong.albumSortName = it.first() }
|
||||
(textFrames["TXXX:musicbrainz album type"] ?: textFrames["TXXX:releasetype"] ?: textFrames["GRP1"])?.let {
|
||||
rawSong.releaseTypes = it
|
||||
}
|
||||
(textFrames["TXXX:musicbrainz album type"]
|
||||
?: textFrames["TXXX:releasetype"] ?: textFrames["GRP1"])
|
||||
?.let { rawSong.releaseTypes = it }
|
||||
|
||||
// Artist
|
||||
textFrames["TXXX:musicbrainz artist id"]?.let { rawSong.artistMusicBrainzIds = it }
|
||||
|
|
Loading…
Reference in a new issue