UploadWorker.kt: modified property names to camel case to meet ktlint standard

This commit is contained in:
tristan81 2024-09-18 20:40:54 +10:00
parent 88d853e3fa
commit 564906a791

View file

@ -74,9 +74,9 @@ class UploadWorker(
@Inject @Inject
lateinit var fileUtilsWrapper: FileUtilsWrapper lateinit var fileUtilsWrapper: FileUtilsWrapper
private val PROCESSING_UPLOADS_NOTIFICATION_TAG = BuildConfig.APPLICATION_ID + " : upload_tag" private val processingUploadsNotificationTag = BuildConfig.APPLICATION_ID + " : upload_tag"
private val PROCESSING_UPLOADS_NOTIFICATION_ID = 101 private val processingUploadsNotificationId = 101
// Attributes of the current-upload notification // Attributes of the current-upload notification
private var currentNotificationID: Int = -1 // lateinit is not allowed with primitives private var currentNotificationID: Int = -1 // lateinit is not allowed with primitives
@ -85,7 +85,7 @@ class UploadWorker(
private val statesToProcess = ArrayList<Int>() private val statesToProcess = ArrayList<Int>()
private val STASH_ERROR_CODES = private val stashErrorCodes =
listOf( listOf(
"uploadstash-file-not-found", "uploadstash-file-not-found",
"stashfailed", "stashfailed",
@ -132,8 +132,8 @@ class UploadWorker(
) )
} }
notificationManager?.cancel( notificationManager?.cancel(
PROCESSING_UPLOADS_NOTIFICATION_TAG, processingUploadsNotificationTag,
PROCESSING_UPLOADS_NOTIFICATION_ID, processingUploadsNotificationId,
) )
notificationManager?.notify( notificationManager?.notify(
currentNotificationTag, currentNotificationTag,
@ -216,8 +216,8 @@ class UploadWorker(
), ),
) )
notificationManager?.notify( notificationManager?.notify(
PROCESSING_UPLOADS_NOTIFICATION_TAG, processingUploadsNotificationTag,
PROCESSING_UPLOADS_NOTIFICATION_ID, processingUploadsNotificationId,
processingUploads.build(), processingUploads.build(),
) )
@ -237,8 +237,8 @@ class UploadWorker(
} }
// Dismiss the global notification // Dismiss the global notification
notificationManager?.cancel( notificationManager?.cancel(
PROCESSING_UPLOADS_NOTIFICATION_TAG, processingUploadsNotificationTag,
PROCESSING_UPLOADS_NOTIFICATION_ID, processingUploadsNotificationId,
) )
} }
// Trigger WorkManager to process any new contributions that may have been added to the queue // Trigger WorkManager to process any new contributions that may have been added to the queue
@ -397,7 +397,7 @@ class UploadWorker(
showFailedNotification(contribution) showFailedNotification(contribution)
contribution.state = Contribution.STATE_FAILED contribution.state = Contribution.STATE_FAILED
contributionDao.saveSynchronous(contribution) contributionDao.saveSynchronous(contribution)
if (STASH_ERROR_CODES.contains(exception.message)) { if (stashErrorCodes.contains(exception.message)) {
clearChunks(contribution) clearChunks(contribution)
} }
} }