[optimize] Architecture is shifting towards Hilt comprehensively

This commit is contained in:
acite
2025-09-14 20:59:51 +08:00
parent f7701cc85b
commit 54c9d326c6
20 changed files with 100 additions and 94 deletions

View File

@@ -14,8 +14,13 @@ import kotlinx.serialization.json.*
import java.io.File
import java.io.FileNotFoundException
import java.io.IOException
import javax.inject.Inject
import javax.inject.Singleton
object RecentManager
@Singleton
class RecentManager @Inject constructor(
private val mediaManager: MediaManager
)
{
private val mutex = Mutex()
@@ -56,7 +61,7 @@ object RecentManager
for(it in gr)
{
val v = MediaManager.queryVideoBulk(it.key, it.value.map { it.id })
val v = mediaManager.queryVideoBulk(it.key, it.value.map { it.id })
if(v != null)
for(j in v)
{
@@ -86,7 +91,7 @@ object RecentManager
recent.removeAt(index)
}
recent.add(0, MediaManager.queryVideoBulk(video.klass, listOf(video.id))!![0])
recent.add(0, mediaManager.queryVideoBulk(video.klass, listOf(video.id))!![0])
if(recent.size >= 21)