Skip to content

Commit

Permalink
feat(share action): closes z-huang#11
Browse files Browse the repository at this point in the history
  • Loading branch information
Malopieds committed Mar 23, 2024
1 parent 2f829b4 commit 9823915
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/java/com/zionhuang/music/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ import coil.request.ImageRequest
import com.valentinilk.shimmer.LocalShimmerTheme
import com.zionhuang.innertube.YouTube
import com.zionhuang.innertube.models.SongItem
import com.zionhuang.innertube.models.WatchEndpoint
import com.zionhuang.music.constants.*
import com.zionhuang.music.db.MusicDatabase
import com.zionhuang.music.db.entities.SearchHistory
import com.zionhuang.music.extensions.*
import com.zionhuang.music.models.toMediaMetadata
import com.zionhuang.music.playback.DownloadUtil
import com.zionhuang.music.playback.MusicService
import com.zionhuang.music.playback.MusicService.MusicBinder
import com.zionhuang.music.playback.PlayerConnection
import com.zionhuang.music.playback.queues.YouTubeQueue
import com.zionhuang.music.ui.component.*
import com.zionhuang.music.ui.component.shimmer.ShimmerTheme
import com.zionhuang.music.ui.menu.YouTubeSongMenu
Expand Down Expand Up @@ -372,7 +375,7 @@ class MainActivity : ComponentActivity() {
withContext(Dispatchers.IO) {
YouTube.queue(listOf(videoId))
}.onSuccess {
sharedSong = it.firstOrNull()
playerConnection?.playQueue(YouTubeQueue(WatchEndpoint(videoId = it.firstOrNull()?.id), it.firstOrNull()?.toMediaMetadata()))
}.onFailure {
reportException(it)
}
Expand Down

0 comments on commit 9823915

Please # to comment.