Loading app/src/main/java/foundation/e/apps/manager/database/DatabaseRepository.kt +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ class DatabaseRepository @Inject constructor( suspend fun addDownload(fusedDownload: FusedDownload) { mutex.withLock { return fusedDownloadDAO.addDownload(fusedDownload) fusedDownloadDAO.addDownload(fusedDownload) } } Loading @@ -35,7 +35,7 @@ class DatabaseRepository @Inject constructor( return fusedDownloadDAO.getDownloadLiveList() } suspend fun updateDownload(fusedDownload: FusedDownload): Long { suspend fun updateDownload(fusedDownload: FusedDownload): Int { mutex.withLock { return fusedDownloadDAO.updateDownload(fusedDownload) } Loading app/src/main/java/foundation/e/apps/manager/database/fusedDownload/FusedDownloadDAO.kt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ interface FusedDownloadDAO { fun getDownloadFlowById(id: String): LiveData<FusedDownload> @Update suspend fun updateDownload(fusedDownload: FusedDownload): Long suspend fun updateDownload(fusedDownload: FusedDownload): Int @Delete suspend fun deleteDownload(fusedDownload: FusedDownload) Loading app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ class FusedManagerImpl @Inject constructor( suspend fun addDownload(fusedDownload: FusedDownload) { fusedDownload.status = Status.QUEUED databaseRepository.addDownload(fusedDownload) return databaseRepository.addDownload(fusedDownload) } suspend fun getDownloadById(fusedDownload: FusedDownload): FusedDownload? { Loading app/src/main/java/foundation/e/apps/manager/fused/FusedManagerRepository.kt +5 −4 Original line number Diff line number Diff line Loading @@ -34,18 +34,19 @@ class FusedManagerRepository @Inject constructor( return fusedManagerImpl.moveOBBFilesToOBBDirectory(fusedDownload) } suspend fun addDownload(fusedDownload: FusedDownload) { suspend fun addDownload(fusedDownload: FusedDownload): Int { if (InstallWorkManager.checkWorkIsAlreadyAvailable(fusedDownload.id)) { return return -1 } val existingFusedDownload = fusedManagerImpl.getDownloadById(fusedDownload) // We don't want to add any thing, if it already exists without INSTALLATION_ISSUE if (existingFusedDownload != null && existingFusedDownload.status != Status.INSTALLATION_ISSUE) { return return -1 } return fusedManagerImpl.addDownload(fusedDownload) fusedManagerImpl.addDownload(fusedDownload) return 0 } suspend fun addFusedDownloadPurchaseNeeded(fusedDownload: FusedDownload) { Loading app/src/main/java/foundation/e/apps/receiver/PWAPlayerStatusReceiver.kt +2 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ class PWAPlayerStatusReceiver : BroadcastReceiver() { ACTION_PWA_REMOVED -> { databaseRepository.deleteDownload(fusedDownload) } else -> {} } } } Loading Loading
app/src/main/java/foundation/e/apps/manager/database/DatabaseRepository.kt +2 −2 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ class DatabaseRepository @Inject constructor( suspend fun addDownload(fusedDownload: FusedDownload) { mutex.withLock { return fusedDownloadDAO.addDownload(fusedDownload) fusedDownloadDAO.addDownload(fusedDownload) } } Loading @@ -35,7 +35,7 @@ class DatabaseRepository @Inject constructor( return fusedDownloadDAO.getDownloadLiveList() } suspend fun updateDownload(fusedDownload: FusedDownload): Long { suspend fun updateDownload(fusedDownload: FusedDownload): Int { mutex.withLock { return fusedDownloadDAO.updateDownload(fusedDownload) } Loading
app/src/main/java/foundation/e/apps/manager/database/fusedDownload/FusedDownloadDAO.kt +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ interface FusedDownloadDAO { fun getDownloadFlowById(id: String): LiveData<FusedDownload> @Update suspend fun updateDownload(fusedDownload: FusedDownload): Long suspend fun updateDownload(fusedDownload: FusedDownload): Int @Delete suspend fun deleteDownload(fusedDownload: FusedDownload) Loading
app/src/main/java/foundation/e/apps/manager/fused/FusedManagerImpl.kt +1 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ class FusedManagerImpl @Inject constructor( suspend fun addDownload(fusedDownload: FusedDownload) { fusedDownload.status = Status.QUEUED databaseRepository.addDownload(fusedDownload) return databaseRepository.addDownload(fusedDownload) } suspend fun getDownloadById(fusedDownload: FusedDownload): FusedDownload? { Loading
app/src/main/java/foundation/e/apps/manager/fused/FusedManagerRepository.kt +5 −4 Original line number Diff line number Diff line Loading @@ -34,18 +34,19 @@ class FusedManagerRepository @Inject constructor( return fusedManagerImpl.moveOBBFilesToOBBDirectory(fusedDownload) } suspend fun addDownload(fusedDownload: FusedDownload) { suspend fun addDownload(fusedDownload: FusedDownload): Int { if (InstallWorkManager.checkWorkIsAlreadyAvailable(fusedDownload.id)) { return return -1 } val existingFusedDownload = fusedManagerImpl.getDownloadById(fusedDownload) // We don't want to add any thing, if it already exists without INSTALLATION_ISSUE if (existingFusedDownload != null && existingFusedDownload.status != Status.INSTALLATION_ISSUE) { return return -1 } return fusedManagerImpl.addDownload(fusedDownload) fusedManagerImpl.addDownload(fusedDownload) return 0 } suspend fun addFusedDownloadPurchaseNeeded(fusedDownload: FusedDownload) { Loading
app/src/main/java/foundation/e/apps/receiver/PWAPlayerStatusReceiver.kt +2 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,8 @@ class PWAPlayerStatusReceiver : BroadcastReceiver() { ACTION_PWA_REMOVED -> { databaseRepository.deleteDownload(fusedDownload) } else -> {} } } } Loading