Skip to content

Commit

Permalink
Fix media uploadId to match api validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandarIlic committed Jul 5, 2024
1 parent 1b32d38 commit ec18910
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.withIndex
import kotlinx.coroutines.withContext
import net.primal.android.BuildConfig
import net.primal.android.core.coroutines.CoroutineDispatcherProvider
import net.primal.android.crypto.NostrKeyPair
import net.primal.android.crypto.hexToNsecHrp
Expand All @@ -43,7 +44,11 @@ class PrimalFileUploader @Inject constructor(
companion object {
private const val KB = 1024
private const val MB = 1024 * KB
fun generateRandomUploadId(): String = "${UUID.randomUUID()}-${UserAgentProvider.USER_AGENT}"

fun generateRandomUploadId(): String {
val uploadFriendlyVersionName = BuildConfig.VERSION_NAME.replace(".", "_")
return "${UUID.randomUUID()}-${UserAgentProvider.APP_NAME}-$uploadFriendlyVersionName"
}
}

private val uploadsMap = mutableMapOf<String, UploadStatus>()
Expand Down

0 comments on commit ec18910

Please sign in to comment.