feat: M3 weighted shuffle v1 — real /api/radio with scoring #21
@@ -1,7 +1,6 @@
|
||||
package com.fabledsword.minstrel.api
|
||||
|
||||
import com.fabledsword.minstrel.BuildConfig
|
||||
import com.fabledsword.minstrel.api.endpoints.LibraryApi
|
||||
import com.fabledsword.minstrel.auth.AuthStore
|
||||
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
|
||||
import dagger.Module
|
||||
@@ -13,7 +12,6 @@ import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.create
|
||||
import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Singleton
|
||||
|
||||
@@ -72,9 +70,19 @@ object NetworkModule {
|
||||
.addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
|
||||
.build()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideLibraryApi(retrofit: Retrofit): LibraryApi = retrofit.create()
|
||||
// Per-endpoint Retrofit interface @Provides intentionally NOT here.
|
||||
// Feature repositories construct their interface via the shared
|
||||
// Retrofit (Hilt-injected), e.g.:
|
||||
//
|
||||
// class LibraryRepository @Inject constructor(retrofit: Retrofit) {
|
||||
// private val api = retrofit.create<LibraryApi>()
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// Fewer Hilt bindings + no KSP2 type-resolution sharp edges from
|
||||
// Hilt processing a `@Provides` return type that's a hand-written
|
||||
// Kotlin interface (Hilt's ModuleProcessingStep "could not be
|
||||
// resolved" failure mode under KSP2 — google/dagger#4303).
|
||||
|
||||
private const val CONNECT_TIMEOUT_SECONDS = 10L
|
||||
private const val READ_TIMEOUT_SECONDS = 30L
|
||||
|
||||
Reference in New Issue
Block a user