diff --git a/composeApp/src/androidMain/kotlin/org/company/app/App.android.kt b/composeApp/src/androidMain/kotlin/org/company/app/App.android.kt index 1c14144..e5e9ecb 100644 --- a/composeApp/src/androidMain/kotlin/org/company/app/App.android.kt +++ b/composeApp/src/androidMain/kotlin/org/company/app/App.android.kt @@ -96,7 +96,7 @@ class AppActivity : ComponentActivity() { } private fun proceedWithTask() { - // Proceed with video download logic + } } diff --git a/composeApp/src/iosMain/kotlin/org/company/app/App.ios.kt b/composeApp/src/iosMain/kotlin/org/company/app/App.ios.kt index bab8b90..560ce84 100644 --- a/composeApp/src/iosMain/kotlin/org/company/app/App.ios.kt +++ b/composeApp/src/iosMain/kotlin/org/company/app/App.ios.kt @@ -92,7 +92,7 @@ actual class VideoDownloader { actual fun HttpClientConfig<*>.setupHttpCache() { install(HttpCache) { - val cacheDir = File("cache_directory") // Set your desired cache directory + val cacheDir = File("cache_directory") val cacheStorage = object : HttpCacheStorage() { private val cache = HashMap() @@ -106,10 +106,10 @@ actual fun HttpClientConfig<*>.setupHttpCache() { } override fun store(url: Url, value: HttpCacheEntry) { - if (cache.size < 10 * 1024 * 1024) { // Check if cache size is less than 10MB + if (cache.size < 10 * 1024 * 1024) { cache[url.toString()] = value } else { - // Handle cache size limit, e.g., evict oldest entries or similar + } } } diff --git a/composeApp/src/jsMain/kotlin/org/company/app/App.js.kt b/composeApp/src/jsMain/kotlin/org/company/app/App.js.kt index 604160b..76f9a5e 100644 --- a/composeApp/src/jsMain/kotlin/org/company/app/App.js.kt +++ b/composeApp/src/jsMain/kotlin/org/company/app/App.js.kt @@ -26,14 +26,6 @@ internal actual fun ShareManager(title: String, videoUrl: String) { window.open(url = videoUrl, "_blank") } - -private fun extractVideoId(url: String): String { - val videoIdRegex = - Regex("""(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})""") - val matchResult = videoIdRegex.find(url) - return matchResult?.groupValues?.get(1) ?: "default_video_id" -} - internal actual fun UserRegion(): String { return js("window.navigator.language.slice(-2)") } diff --git a/composeApp/src/jvmMain/kotlin/org/company/app/App.jvm.kt b/composeApp/src/jvmMain/kotlin/org/company/app/App.jvm.kt index 26f73a3..ba14eec 100644 --- a/composeApp/src/jvmMain/kotlin/org/company/app/App.jvm.kt +++ b/composeApp/src/jvmMain/kotlin/org/company/app/App.jvm.kt @@ -29,18 +29,6 @@ internal actual fun provideShortCuts() { return } -fun splitLinkForVideoId( - url: String?, -): String { - return url?.substringAfter("v=").toString() -} - -private fun openYouTubeVideo(videoUrl: String) { - if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { - Desktop.getDesktop().browse(URI(videoUrl)) - } -} - @Composable internal actual fun ShareManager(title: String, videoUrl: String) { if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { @@ -48,9 +36,6 @@ internal actual fun ShareManager(title: String, videoUrl: String) { } } -fun splitLinkForShotsVideoId(url: String?): String { - return url!!.split("v=").get(1) -} internal actual fun UserRegion(): String { val currentLocale: Locale = Locale.getDefault()