Saavn Link Extraction Fix

This commit is contained in:
shabinder 2021-07-11 10:04:48 +05:30
parent 994b20d0a1
commit 37fe18ef16
2 changed files with 6 additions and 5 deletions

View File

@ -88,7 +88,7 @@ actual fun GithubLogo() = rememberVectorPainter(vectorXmlResource("drawable/ic_g
actual fun PaypalLogo() = rememberVectorPainter(vectorXmlResource("drawable/ic_paypal_logo.xml")) as Painter
@Composable
actual fun OpenCollectiveLogo() = rememberVectorPainter(vectorXmlResource("drawable/ic_opencollective_icon")) as Painter
actual fun OpenCollectiveLogo() = rememberVectorPainter(vectorXmlResource("drawable/ic_opencollective_icon.xml")) as Painter
@Composable
actual fun RazorPay() = rememberVectorPainter(vectorXmlResource("drawable/ic_indian_rupee.xml")) as Painter

View File

@ -31,8 +31,9 @@ class SaavnProvider(
trackList = listOf(),
Source.JioSaavn
).apply {
when (fullLink.substringAfter("saavn.com/").substringBefore("/")) {
"song" -> {
val pageLink = fullLink.substringAfter("saavn.com/").substringBefore("?")
when {
pageLink.contains("/song/",true) -> {
getSong(fullLink).value.let {
folderType = "Tracks"
subFolder = ""
@ -41,7 +42,7 @@ class SaavnProvider(
coverUrl = it.image.replace("http:", "https:")
}
}
"album" -> {
pageLink.contains("/album/",true) -> {
getAlbum(fullLink).value.let {
folderType = "Albums"
subFolder = removeIllegalChars(it.title)
@ -50,7 +51,7 @@ class SaavnProvider(
coverUrl = it.image.replace("http:", "https:")
}
}
"featured" -> { // Playlist
pageLink.contains("/featured/",true) -> { // Playlist
getPlaylist(fullLink).value.let {
folderType = "Playlists"
subFolder = removeIllegalChars(it.listname)