Skip to content

Commit

Permalink
Убрал кринж из Routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Spliterash committed Nov 9, 2023
1 parent 6a1d003 commit c47b14b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class DownloadUrlSupplier(
@Value("\${vk-unlocker.domain}") private val domain: String,
) {
fun downloadUrl(attachmentId: String): URL {
return URL(domain + Routes.DOWNLOAD.replace("{attachmentId}", attachmentId))
return URL(domain + Routes.DOWNLOAD.replace("{attachmentId}", attachmentId) + ".mp4")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package ru.spliterash.vkVideoUnlocker.video

object Routes {
const val UNLOCK = "/videos/unlock/{attachmentId}"
const val DOWNLOAD = "/videos/download/{attachmentId}.mp4"
const val DOWNLOAD = "/videos/download/{attachmentId}"
const val INFO = "/videos/info/{attachmentId}"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ru.spliterash.vkVideoUnlocker.video.controller

import com.github.benmanes.caffeine.cache.Caffeine
import io.micronaut.context.annotation.Value
import io.micronaut.http.HttpResponse
import io.micronaut.http.HttpStatus
import io.micronaut.http.MediaType
Expand Down Expand Up @@ -64,7 +63,7 @@ class VideoController(
suspend fun info(
@PathVariable("attachmentId") attachmentId: String,
): VideoResponse {
val accessor = cache.get(attachmentId).await()
val accessor = cache.get(attachmentId.removeSuffix(".mp4")).await()
val url = downloadUrlSupplier.downloadUrl(attachmentId)

return VideoResponse(
Expand Down

0 comments on commit c47b14b

Please sign in to comment.