Skip to content

Commit e4ec120

Browse files
feat: support YT music
1 parent 62b9df7 commit e4ec120

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

library/src/commonMain/kotlin/project/pipepipe/app/helper/JobRunner.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ suspend fun executeJobFlow(
3535
val response = executeJobFlow(
3636
SupportedJobType.REFRESH_COOKIE, null, serviceId
3737
)
38-
CookieManager.setCookieInfo(serviceId, response.info as CookieInfo, false)
38+
response.info?.let { CookieManager.setCookieInfo(serviceId, it as CookieInfo, false) }
3939
}
4040
val cookie = if (serviceId != null)CookieManager.getCookie(serviceId) else null
4141
val state = if (url?.contains("cacheId=") == true) {

library/src/commonMain/kotlin/project/pipepipe/app/helper/StringResourceHelper.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ object StringResourceHelper {
1212
// Search Types
1313
"video" -> stringResource(MR.strings.videos_string)
1414
"videos" -> stringResource(MR.strings.videos_string)
15+
"songs" -> stringResource(MR.strings.songs)
16+
"albums" -> stringResource(MR.strings.albums)
17+
"artists" -> stringResource(MR.strings.artists)
1518
"playlist" -> stringResource(MR.strings.playlists)
1619
"playlists" -> stringResource(MR.strings.playlists)
1720
"channel" -> stringResource(MR.strings.channels)

library/src/commonMain/kotlin/project/pipepipe/app/ui/items/CommonItem.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,14 @@ private fun StreamOrPlaylistListItem(
481481
contentDescription = null,
482482
tint = Color.White
483483
)
484-
Text(
485-
text = "$streamCount",
486-
color = Color.White,
487-
fontWeight = FontWeight.Bold,
488-
style = MaterialTheme.typography.bodySmall
489-
)
484+
if (streamCount.toInt() != -1) {
485+
Text(
486+
text = "$streamCount",
487+
color = Color.White,
488+
fontWeight = FontWeight.Bold,
489+
style = MaterialTheme.typography.bodySmall
490+
)
491+
}
490492
}
491493
}
492494
}

0 commit comments

Comments
 (0)