Remove some unused constants

This commit is contained in:
Bnyro 2023-01-17 19:33:27 +01:00
parent 187086d2d8
commit c107bb1109
2 changed files with 4 additions and 6 deletions

View File

@ -41,10 +41,7 @@ const val FALLBACK_INSTANCES_URL = "https://instances.tokhmi.xyz"
* Notification IDs
*/
const val PLAYER_NOTIFICATION_ID = 1
const val DOWNLOAD_PENDING_NOTIFICATION_ID = 2
const val DOWNLOAD_FAILURE_NOTIFICATION_ID = 3
const val DOWNLOAD_SUCCESS_NOTIFICATION_ID = 4
const val DOWNLOAD_PROGRESS_NOTIFICATION_ID = 5
const val DOWNLOAD_PROGRESS_NOTIFICATION_ID = 2
/**
* Notification Channel IDs

View File

@ -12,6 +12,7 @@ import androidx.work.Worker
import androidx.work.WorkerParameters
import com.github.libretube.R
import com.github.libretube.api.SubscriptionHelper
import com.github.libretube.constants.DOWNLOAD_PROGRESS_NOTIFICATION_ID
import com.github.libretube.constants.IntentData
import com.github.libretube.constants.PUSH_CHANNEL_ID
import com.github.libretube.constants.PreferenceKeys
@ -35,9 +36,9 @@ class NotificationWorker(appContext: Context, parameters: WorkerParameters) :
// the id where notification channels start
private var notificationId = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val nManager = appContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
nManager.activeNotifications.size + 5
nManager.activeNotifications.size + DOWNLOAD_PROGRESS_NOTIFICATION_ID
} else {
5
DOWNLOAD_PROGRESS_NOTIFICATION_ID
}
override fun doWork(): Result {