Skip to content
Merged

6.5.1 #291

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 6.5.1
- Fixed lyrics search issues
- Miscellaneous UI fixes

## 6.5.0
- Updated Translations
- Added new Card Style - Brat
Expand Down
4 changes: 2 additions & 2 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ plugins {
}

val appName = "Rush"
val appVersionName = "6.5.0"
val appVersionCode = 6500
val appVersionName = "6.5.1"
val appVersionCode = 6510

val gitHash = execute("git", "rev-parse", "HEAD").take(7)

Expand Down
2 changes: 2 additions & 0 deletions androidApp/src/main/java/com/shub39/rush/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ fun App() {
ChangelogSheet(
currentLog = globalState.currentChangelog!!,
onDismissRequest = { globalVM.onAction(GlobalAction.DismissChangelog) },
showSupportButton = !globalState.isProUser,
onNavigateToPaywall = { backStack.add(Routes.PaywallPage) },
)
}

Expand Down
2 changes: 2 additions & 0 deletions desktopApp/src/commonMain/kotlin/com/shub39/rush/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ fun App() {
ChangelogSheet(
currentLog = globalState.currentChangelog!!,
onDismissRequest = { globalVM.onAction(GlobalAction.DismissChangelog) },
showSupportButton = false,
onNavigateToPaywall = {},
)
}

Expand Down
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
agp = "9.2.1"
agp = "9.3.0"
minSdk = "29"
targetSdk = "37"
compileSdk = "37"
Expand All @@ -8,26 +8,26 @@ colorpicker = "1.2.0"
compose-multiplatform = "1.12.0-beta02"
material3 = "1.12.0-alpha03"
filekit = "0.14.2"
materialkolor = "4.1.1"
materialkolor = "5.0.0"
splashscreen = "1.2.0"
androidx-test-runner = "1.7.0"
datastore = "1.2.1"
koin = "4.2.2"
koin-plugin = "1.0.1"
koin-plugin = "1.0.2"
ksoup = "0.2.6"
ktor = "3.5.1"
kotlin = "2.4.0"
kotlin = "2.4.10"
ksp = "2.3.9"
landscapist = "2.11.0"
activity-compose = "1.13.0"
navigation = "1.1.1"
kmpalette = "3.1.0"
room3 = "3.0.0"
serialization = "1.11.0"
androidx-lifecycle = "2.10.0"
androidx-lifecycle = "2.11.0"
zoomable = "2.13.0"
coroutines = "1.11.0"
purchases = "10.13.0"
purchases = "10.14.0"
junit = "4.13.2"
junit-version = "1.3.0"
spotless = "8.8.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,21 @@ inline fun <reified T : Enum<T>> valueOfOrNull(name: String): T? {
return enumEntries<T>().firstOrNull { it.name == name }
}

private val bracketPatterns =
listOf(Regex("""\s*\(.*?\)"""), Regex("""\s*\[.*?]"""), Regex("""\s*【.*?】"""))

private val titleCleanupPatterns =
listOf(
Regex(
"""\s*\(.*?(official|video|audio|lyrics|lyric|visualizer|hd|hq|4k|remaster|remix|live|acoustic|version|edit|extended|radio|clean|explicit).*?\)""",
RegexOption.IGNORE_CASE,
),
Regex(
"""\s*\[.*?(official|video|audio|lyrics|lyric|visualizer|hd|hq|4k|remaster|remix|live|acoustic|version|edit|extended|radio|clean|explicit).*?]""",
RegexOption.IGNORE_CASE,
),
Regex("""\s*【.*?】"""),
Regex("""\s*\|.*$"""),
Regex(
"""\s*-\s*(official|video|audio|lyrics|lyric|visualizer).*$""",
RegexOption.IGNORE_CASE,
),
Regex("""\s*\(feat\..*?\)""", RegexOption.IGNORE_CASE),
Regex("""\s*\(ft\..*?\)""", RegexOption.IGNORE_CASE),
Regex("""\s*feat\..*$""", RegexOption.IGNORE_CASE),
Regex("""\s*ft\..*$""", RegexOption.IGNORE_CASE),
)
bracketPatterns +
listOf(
Regex("""\s*\|.*$"""),
Regex(
"""\s*-\s*(official|video|audio|lyrics|lyric|visualizer).*$""",
RegexOption.IGNORE_CASE,
),
Regex("""\s*feat\..*$""", RegexOption.IGNORE_CASE),
Regex("""\s*ft\..*$""", RegexOption.IGNORE_CASE),
)

private val artistSeparators =
listOf(
" & ",
Expand All @@ -60,6 +54,9 @@ private val artistSeparators =

fun getMainArtist(artists: String): String {
var cleaned = artists.trim()
for (pattern in bracketPatterns) {
cleaned = cleaned.replace(pattern, "")
}
for (separator in artistSeparators) {
if (cleaned.contains(separator, ignoreCase = true)) {
cleaned = cleaned.split(separator, ignoreCase = true, limit = 2)[0]
Expand Down
3 changes: 1 addition & 2 deletions shared/core/src/commonTest/kotlin/TTMLParserTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.shub39.rush.shared.core.util

import com.shub39.rush.shared.core.util.TTMLParser
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
Expand Down
50 changes: 50 additions & 0 deletions shared/core/src/commonTest/kotlin/UtilTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2026 Shubham Gorai
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import com.shub39.rush.shared.core.getMainArtist
import com.shub39.rush.shared.core.getMainTitle
import kotlin.test.Test
import kotlin.test.assertEquals

class UtilTest {

@Test
fun testGetMainTitle() {
assertEquals("Song Title", getMainTitle("Song Title"))
assertEquals("Song Title", getMainTitle("Song Title (Official Video)"))
assertEquals("Song Title", getMainTitle("Song Title [Remix]"))
assertEquals("Song Title", getMainTitle("Song Title 【MV】"))
assertEquals("Song", getMainTitle("Song (Ver) [Live]"))
assertEquals("Song", getMainTitle("Song | something"))
assertEquals("Song", getMainTitle("Song - Official Video"))
assertEquals("Song", getMainTitle("Song feat. Someone"))
assertEquals("Song", getMainTitle("Song ft. Someone"))
}

@Test
fun testGetMainArtist() {
assertEquals("Artist Name", getMainArtist("Artist Name"))
assertEquals("Artist Name", getMainArtist("Artist Name (Producer)"))
assertEquals("Artist A", getMainArtist("Artist A & Artist B"))
assertEquals("Artist A", getMainArtist("Artist A and Artist B"))
assertEquals("Artist A", getMainArtist("Artist A, Artist B"))
assertEquals("Artist A", getMainArtist("Artist A x Artist B"))
assertEquals("Artist A", getMainArtist("Artist A X Artist B"))
assertEquals("Artist A", getMainArtist("Artist A feat. Artist B"))
assertEquals("Artist A", getMainArtist("Artist A [Info] & Artist B"))
assertEquals("Artist A", getMainArtist("Artist A (Info) & Artist B"))
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[
{
"version": "6.5.1",
"changes": [
"Fixed lyrics search issues",
"Miscellaneous UI fixes"
]
},
{
"version": "6.5.0",
"changes": [
Expand Down Expand Up @@ -68,11 +75,5 @@
"Added Refresh button to regenerate Messy Card",
"Miscellaneous UI fixes"
]
},
{
"version": "6.2.01",
"changes": [
"Fixed UI bug in share cards"
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialShapes
Expand Down Expand Up @@ -57,6 +58,8 @@ fun ChangelogSheet(
modifier: Modifier = Modifier,
currentLog: VersionEntry,
onDismissRequest: () -> Unit,
showSupportButton: Boolean,
onNavigateToPaywall: () -> Unit,
) {
RushBottomSheet(onDismissRequest = onDismissRequest, modifier = modifier, padding = 0.dp) {
Column(
Expand Down Expand Up @@ -115,8 +118,38 @@ fun ChangelogSheet(
}
}

Button(onClick = onDismissRequest, modifier = Modifier.fillMaxWidth()) {
Text(text = stringResource(Res.string.done))
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(2.dp),
) {
FilledTonalButton(
onClick = onDismissRequest,
shape = if (showSupportButton) leadingItemShape() else detachedItemShape(),
modifier = Modifier.height(ButtonDefaults.MediumContainerHeight).fillMaxWidth(),
) {
Text(
text = stringResource(Res.string.done),
style = ButtonDefaults.textStyleFor(ButtonDefaults.MediumContainerHeight),
)
}

if (showSupportButton) {
FilledTonalButton(
onClick = {
onDismissRequest()
onNavigateToPaywall()
},
shape = endItemShape(),
modifier =
Modifier.height(ButtonDefaults.MediumContainerHeight).fillMaxWidth(),
) {
Text(
text = "Support Rush",
style =
ButtonDefaults.textStyleFor(ButtonDefaults.MediumContainerHeight),
)
}
}
}

Spacer(modifier = Modifier.height(16.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.shub39.rush.shared.ui.endItemShape
import com.shub39.rush.shared.ui.leadingItemShape
import com.shub39.rush.shared.ui.theme.flexFontRounded
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
Expand Down Expand Up @@ -94,22 +96,51 @@ fun FossPaywall(modifier: Modifier = Modifier) {
)
}

FilledTonalButton(
onClick = { uriHandler.openUri("https://buymeacoffee.com/shub39") },
modifier = Modifier.height(ButtonDefaults.MediumContainerHeight),
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(2.dp),
) {
Icon(
painter = painterResource(Res.drawable.buymeacoffee),
contentDescription = "Buy me a coffee",
modifier = Modifier.size(ButtonDefaults.MediumIconSize),
)
FilledTonalButton(
onClick = { uriHandler.openUri("https://buymeacoffee.com/shub39") },
shape = leadingItemShape(),
modifier =
Modifier.fillMaxWidth().height(ButtonDefaults.MediumContainerHeight),
) {
Icon(
painter = painterResource(Res.drawable.buymeacoffee),
contentDescription = "Buy me a coffee",
modifier = Modifier.size(ButtonDefaults.MediumIconSize),
)

Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing))
Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing))

Text(
text = stringResource(Res.string.bmc),
style = ButtonDefaults.textStyleFor(ButtonDefaults.MediumContainerHeight),
)
Text(
text = stringResource(Res.string.bmc),
style =
ButtonDefaults.textStyleFor(ButtonDefaults.MediumContainerHeight),
)
}

FilledTonalButton(
onClick = { uriHandler.openUri("https://github.com/sponsors/shub39") },
shape = endItemShape(),
modifier =
Modifier.fillMaxWidth().height(ButtonDefaults.MediumContainerHeight),
) {
Icon(
painter = painterResource(Res.drawable.github),
contentDescription = "GitHub Sponsors",
modifier = Modifier.size(ButtonDefaults.MediumIconSize),
)

Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing))

Text(
text = "GitHub Sponsors",
style =
ButtonDefaults.textStyleFor(ButtonDefaults.MediumContainerHeight),
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ fun PlainLyrics(
contentColor = cardContent,
),
) {
Text(text = stringResource(Res.string.source))
Icon(
painter = painterResource(Res.drawable.genius),
contentDescription = "Genius Source",
)
}

IconButton(onClick = { action(LyricsPageAction.OnToggleSearchSheet) }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import com.shub39.rush.shared.ui.detachedItemShape
import com.shub39.rush.shared.ui.endItemShape
import com.shub39.rush.shared.ui.leadingItemShape
import com.shub39.rush.shared.ui.listItemColors
import com.shub39.rush.shared.ui.middleItemShape
import com.shub39.rush.shared.ui.setting.component.LicenseBottomSheet
import com.shub39.rush.shared.ui.theme.flexFontEmphasis
import com.shub39.rush.shared.ui.theme.flexFontRounded
Expand Down Expand Up @@ -169,6 +170,28 @@ private fun LazyListScope.engagementLinks(uriHandler: UriHandler) {
uriHandler.openUri("https://buymeacoffee.com/shub39")
},
)
ListItem(
colors = listItemColors(),
leadingContent = {
Icon(
painter = painterResource(Res.drawable.github),
contentDescription = null,
modifier = Modifier.size(24.dp),
)
},
trailingContent = {
Icon(
painter = painterResource(Res.drawable.open_link),
contentDescription = null,
)
},
headlineContent = { Text(text = "GitHub Sponsors") },
supportingContent = { Text(text = "Support me through GitHub") },
modifier =
Modifier.clip(middleItemShape()).clickable {
uriHandler.openUri("https://github.com/sponsors/shub39")
},
)
ListItem(
colors = listItemColors(),
leadingContent = {
Expand Down
Loading