Skip to content

Commit

Permalink
```
Browse files Browse the repository at this point in the history
πŸ› fix(MediaServiceModule): Increase stream chunk length

✨ feat(changelog): Add changelog for version 25

πŸ› fix(Settings): Fix bugs in the Settings screen

✨ feat(UI): Add swipe gesture for next/previous track

✨ feat(language): Add Korean language support

πŸ› fix(redirect): Improve redirect logging

⬆️ chore(deps): Upgrade Kotlin and Ktor versions
```
  • Loading branch information
maxrave-dev committed Dec 31, 2024
1 parent 08da315 commit aad061b
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private fun provideResolvingDataSourceFactory(
mainRepository: MainRepository,
coroutineScope: CoroutineScope,
): DataSource.Factory {
val CHUNK_LENGTH = 5 * 512 * 1024L
val CHUNK_LENGTH = 8 * 512 * 1024L
return ResolvingDataSource.Factory(cacheDataSourceFactory) { dataSpec ->
val mediaId = dataSpec.key ?: error("No media id")
Log.w("Stream", mediaId)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@
<string name="no_equalizer">Votre appareil ne dispose pas d\'Γ©galiseur</string>
<string name="open_system_equalizer">Ouvrir l\'égaliseur du système</string>
<string name="use_your_system_equalizer">Utilisez votre égaliseur système</string>
<string name="version_name" translatable="false">v0.2.5</string>
<string name="streaming_data_provider_piped">Fournisseur de donnΓ©es de streaming (Piped)</string>
<string name="itag">Itag</string>
<string name="mime_type">Type MIME</string>
Expand Down
5 changes: 5 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/25.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Fixed "Send back to Google" feature
- Added swipe to next or previous inside now playing screen
- Improve performance and stability
- Fixed some bugs inside Setting screen
- Added new language: Korean
5 changes: 5 additions & 0 deletions fastlane/metadata/android/vi-VN/changelogs/25.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Sα»­a lα»—i tΓ­nh nΔƒng "Gα»­i lαΊ‘i dα»― liệu cho Google"
- ThΓͺm chα»©c nΔƒng vuα»‘t để chuyển bΓ i tiαΊΏp theo hoαΊ·c trΖ°α»›c Δ‘Γ³ trong mΓ n hΓ¬nh Δ‘ang phΓ‘t
- CαΊ£i thiện hiệu suαΊ₯t vΓ  α»•n Δ‘α»‹nh
- Sửa một số lỗi trong màn hình cài đặt
- ThΓͺm ngΓ΄n ngα»― mα»›i: HΓ n Quα»‘c
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]
android = "8.7.3"
kotlin = "2.0.10"
serialization = "2.0.10"
ksp = "2.0.10-1.0.24"
kotlin = "2.1.0"
serialization = "2.1.0"
ksp = "2.1.0-1.0.29"
compose-bom = "2024.12.01"
constraintlayout-compose = "1.1.0"
activity-compose = "1.9.3"
Expand Down Expand Up @@ -48,7 +48,7 @@ aboutlibraries = "10.10.0"
flexbox = "3.0.0"
balloon = "1.6.4"
insetsx = "0.1.0-alpha10"
ktor = "2.3.12"
ktor = "3.0.3"
brotli = "0.1.2"
ksoup = "0.3.1"
desugaring = "2.1.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
package com.maxrave.kotlinytmusicscraper.encoder

import io.ktor.client.plugins.compression.ContentEncoder
import io.ktor.client.plugins.compression.ContentEncoding
import io.ktor.client.plugins.compression.ContentEncodingConfig
import io.ktor.util.ContentEncoder
import io.ktor.utils.io.ByteReadChannel
import io.ktor.utils.io.ByteWriteChannel
import io.ktor.utils.io.jvm.javaio.toByteReadChannel
import io.ktor.utils.io.jvm.javaio.toInputStream
import kotlinx.coroutines.CoroutineScope
import org.brotli.dec.BrotliInputStream
import kotlin.coroutines.CoroutineContext

object BrotliEncoder : ContentEncoder {
override val name: String = "br"
override fun decode(source: ByteReadChannel, coroutineContext: CoroutineContext): ByteReadChannel {
return BrotliInputStream(source.toInputStream()).toByteReadChannel(coroutineContext)
}

override fun CoroutineScope.decode(source: ByteReadChannel): ByteReadChannel = BrotliInputStream(source.toInputStream()).toByteReadChannel()
override fun encode(source: ByteReadChannel, coroutineContext: CoroutineContext): ByteReadChannel {
throw UnsupportedOperationException("Encode not implemented by the library yet.")
}

override fun CoroutineScope.encode(source: ByteReadChannel): ByteReadChannel =
override fun encode(source: ByteWriteChannel, coroutineContext: CoroutineContext): ByteWriteChannel {
throw UnsupportedOperationException("Encode not implemented by the library yet.")
}
}

fun ContentEncoding.Config.brotli(quality: Float? = null) {
fun ContentEncodingConfig.brotli(quality: Float? = null) {
customEncoder(BrotliEncoder, quality)
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import io.ktor.http.authority
import io.ktor.http.isSecure
import io.ktor.http.takeFrom
import io.ktor.util.AttributeKey
import io.ktor.util.InternalAPI
import io.ktor.util.KtorDsl
import io.ktor.util.logging.KtorSimpleLogger
import io.ktor.utils.io.InternalAPI
import io.ktor.utils.io.KtorDsl

private val ALLOWED_FOR_REDIRECT: Set<HttpMethod> = setOf(HttpMethod.Get, HttpMethod.Head)

Expand Down Expand Up @@ -106,7 +106,7 @@ class CustomRedirectConfig private constructor(
client.monitor.raise(HttpResponseRedirect, call.response)

var location = call.response.headers[HttpHeaders.Location]
LOGGER.trace("Received redirect response to $location for request ${context.url}")
LOGGER.trace("Received redirect response to {} for request {}", location, context.url)
println("Location header: $location")

requestBuilder =
Expand Down
19 changes: 13 additions & 6 deletions spotify/src/main/java/com/maxrave/spotify/encoder/BrotliEncoder.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
package com.maxrave.spotify.encoder

import io.ktor.client.plugins.compression.ContentEncoder
import io.ktor.client.plugins.compression.ContentEncoding
import io.ktor.client.plugins.compression.ContentEncodingConfig
import io.ktor.util.ContentEncoder
import io.ktor.utils.io.ByteReadChannel
import io.ktor.utils.io.ByteWriteChannel
import io.ktor.utils.io.jvm.javaio.toByteReadChannel
import io.ktor.utils.io.jvm.javaio.toInputStream
import kotlinx.coroutines.CoroutineScope
import org.brotli.dec.BrotliInputStream
import kotlin.coroutines.CoroutineContext

object BrotliEncoder : ContentEncoder {
override val name: String = "br"
override fun decode(source: ByteReadChannel, coroutineContext: CoroutineContext): ByteReadChannel {
return BrotliInputStream(source.toInputStream()).toByteReadChannel(coroutineContext)
}

override fun CoroutineScope.decode(source: ByteReadChannel): ByteReadChannel = BrotliInputStream(source.toInputStream()).toByteReadChannel()
override fun encode(source: ByteReadChannel, coroutineContext: CoroutineContext): ByteReadChannel {
throw UnsupportedOperationException("Encode not implemented by the library yet.")
}

override fun CoroutineScope.encode(source: ByteReadChannel): ByteReadChannel =
override fun encode(source: ByteWriteChannel, coroutineContext: CoroutineContext): ByteWriteChannel {
throw UnsupportedOperationException("Encode not implemented by the library yet.")
}
}

fun ContentEncoding.Config.brotli(quality: Float? = null) {
fun ContentEncodingConfig.brotli(quality: Float? = null) {
customEncoder(BrotliEncoder, quality)
}

0 comments on commit aad061b

Please sign in to comment.