Skip to content

Commit

Permalink
Improve findOnYoutube
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Jul 25, 2023
1 parent c4afa31 commit 78e1764
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ suspend fun getVideoById(videoId: String): Video = getVideosById(videoId).items[
suspend fun getFirstChannelById(channelId: String): Channel = getChannelsById(channelId).items[0]

val Track.youtubeId: String?
get() = if (info.uri?.contains("youtu(?:be)?".toRegex()) == true) info.identifier else null
get() = if (info.sourceName == "youtube") info.identifier else null

suspend fun Track.findOnYoutube(): Video? = youtubeId?.let {
getVideoById(it)
Expand Down

0 comments on commit 78e1764

Please sign in to comment.