@@ -38,6 +38,7 @@ import androidx.compose.ui.focus.focusRequester
3838import androidx.compose.ui.res.stringResource
3939import androidx.compose.ui.unit.dp
4040import video.typetype.tv.resources.R
41+ import video.typetype.tv.data.TwitchUrls
4142import video.typetype.tv.data.Video
4243import video.typetype.tv.data.VideoActivity
4344import video.typetype.tv.theme.Dimens
@@ -122,37 +123,40 @@ fun DetailHeader(
122123 modifier = Modifier .focusRequester(playRequester),
123124 onFocused = onFocusButtons,
124125 )
125- PillButton (
126- label = stringResource(if (saved) R .string.detail_saved else R .string.detail_watch_later),
127- icon = if (saved) Icons .Rounded .BookmarkAdded else Icons .Rounded .BookmarkAdd ,
128- onClick = { actions.onWatchLater(! saved) },
129- onFocused = onFocusButtons,
130- )
131- PillButton (
132- label = stringResource(if (favorite) R .string.detail_favorited else R .string.detail_favorite),
133- icon = if (favorite) Icons .Rounded .Favorite else Icons .Rounded .FavoriteBorder ,
134- onClick = { actions.onFavorite(! favorite) },
135- onFocused = onFocusButtons,
136- )
137- PillButton (
138- label = stringResource(if (subscribed) R .string.detail_subscribed else R .string.detail_subscribe),
139- icon = if (subscribed) Icons .Rounded .Check else Icons .Rounded .NotificationsNone ,
140- onClick = { actions.onSubscribe(! subscribed) },
141- onFocused = onFocusButtons,
142- )
143- PillButton (
144- label = stringResource(R .string.detail_playlists),
145- icon = Icons .Rounded .PlaylistAdd ,
146- onClick = actions.onOpenPlaylists,
147- onFocused = onFocusButtons,
148- )
149- if (video.channel.url.isNotBlank()) {
126+ // Twitch videos live outside the server library and channel pages; only playback applies to them.
127+ if (TwitchUrls .parse(video.id) == null ) {
128+ PillButton (
129+ label = stringResource(if (saved) R .string.detail_saved else R .string.detail_watch_later),
130+ icon = if (saved) Icons .Rounded .BookmarkAdded else Icons .Rounded .BookmarkAdd ,
131+ onClick = { actions.onWatchLater(! saved) },
132+ onFocused = onFocusButtons,
133+ )
134+ PillButton (
135+ label = stringResource(if (favorite) R .string.detail_favorited else R .string.detail_favorite),
136+ icon = if (favorite) Icons .Rounded .Favorite else Icons .Rounded .FavoriteBorder ,
137+ onClick = { actions.onFavorite(! favorite) },
138+ onFocused = onFocusButtons,
139+ )
140+ PillButton (
141+ label = stringResource(if (subscribed) R .string.detail_subscribed else R .string.detail_subscribe),
142+ icon = if (subscribed) Icons .Rounded .Check else Icons .Rounded .NotificationsNone ,
143+ onClick = { actions.onSubscribe(! subscribed) },
144+ onFocused = onFocusButtons,
145+ )
150146 PillButton (
151- label = stringResource(R .string.detail_channel ),
152- icon = Icons .Rounded .AccountCircle ,
153- onClick = actions.onOpenChannel ,
147+ label = stringResource(R .string.detail_playlists ),
148+ icon = Icons .Rounded .PlaylistAdd ,
149+ onClick = actions.onOpenPlaylists ,
154150 onFocused = onFocusButtons,
155151 )
152+ if (video.channel.url.isNotBlank()) {
153+ PillButton (
154+ label = stringResource(R .string.detail_channel),
155+ icon = Icons .Rounded .AccountCircle ,
156+ onClick = actions.onOpenChannel,
157+ onFocused = onFocusButtons,
158+ )
159+ }
156160 }
157161 }
158162 if (actions.failed) {
0 commit comments