Skip to content

Commit

Permalink
Merge branch 'main' into feature/innertube
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha authored Dec 16, 2024
2 parents 1eff630 + 980781c commit 061da0a
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Compression (gzip) to static web app files. Reduces app size significantly
- UI to clarify how to enable `Control by mobile apps` in the web app

### Fixed

- Error when opening a mix

## [0.33.0] - 2024-12-14

Expand Down
15 changes: 14 additions & 1 deletion playlet-lib/src/components/ContentNode/PlaylistContentTask.bs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,23 @@ function PlaylistContentTask(input as object) as object
}
end if

' TODO:P2 To remove after https://github.com/iv-org/invidious/pull/5116
if IsString(metadata["mixId"]) and IsArray(metadata["videos"])
videos = metadata["videos"]
for i = 0 to videos.Count() - 1
thumbnails = videos[i].videoThumbnails
if thumbnails.Count() = 1 and IsArray(thumbnails[0])
videos[i].videoThumbnails = thumbnails[0]
end if
end for
end if

InvidiousContent.ToPlaylistContentNode(contentNode, metadata, instance)
childCount = contentNode.getChildCount()

if metadata.videos.Count() = 0 or childCount >= metadata.videoCount
videoCount = ValidInt(metadata.videoCount)

if metadata.videos.Count() = 0 or childCount >= videoCount
contentNode.loadState = FeedLoadState.Loaded
return {
success: true
Expand Down
9 changes: 7 additions & 2 deletions playlet-lib/src/components/PlaylistView/PlaylistView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ function OnContentSet() as void
end if

m.titleLabel.text = content.title
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.subtitleLabel.text = `${content._author}${content.videoCountText}${content.viewCountText}`
' Starts with RD means a mix, not a playlist
if content.playlistId.StartsWith("RD")
m.subtitleLabel.text = ""
else
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.subtitleLabel.text = `${content._author}${content.videoCountText}${content.viewCountText}`
end if
m.updatedLabel.text = content.updatedText
m.descriptionLabel.text = content.description

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ namespace InvidiousContent
end function

function PlaylistSetThumbnail(node as object, nodeField as string, playlistItem as object, instance as dynamic, quality = "medium" as string) as void
currentThumbnail = node[nodeField]
if currentThumbnail <> "" and currentThumbnail <> "pkg:/images/thumbnail-missing.jpg"
return
end if

thumbnail = ""
if IsString(playlistItem.playlistThumbnail)
thumbnailUrl = playlistItem.playlistThumbnail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ function OnContentSet() as void

m.top.thumbnailUri = content.thumbnail

SetVideoCount(content.videoCountText)
if content.videoCount = -1
m.top.videoCountLabelVisible = false
else
m.top.videoCountLabelVisible = true
SetVideoCount(content.videoCountText)
end if
end function

function SetVideoCount(videoCountText as string) as void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<field id="updated" type="string" alias="updatedLabel.text" />
<field id="thumbnailUri" type="uri" alias="thumbnail.uri" />
<field id="videoCount" type="string" alias="videoCountLabel.text" />
<field id="videoCountLabelVisible" type="boolean" alias="videoCountLabel.visible" />
</interface>
<children>
<LayoutGroup
Expand Down
17 changes: 17 additions & 0 deletions playlet-web/src/lib/Screens/RemoteControlScreen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@
);
}
}
function showRemoteNotWorkingDialog() {
// show dialog with instructions
let content = `If the remote control is not working, please check your device settings. Go to:
- Settings
- System
- Advanced System Settings
- Control by mobile apps
- Network access
And set it to "Enabled".`;
alert(content);
}
</script>

<div bind:this={screen} tabindex="-1" class={visibility ? "" : "hidden"}>
Expand Down Expand Up @@ -144,5 +157,9 @@
<RemoteButton key={BUTTONS.volumeDown} icon={VolumeDownIcon} small />
<RemoteButton key={BUTTONS.volumeUp} icon={VolumeUpIcon} small />
</div>
<button
on:click={showRemoteNotWorkingDialog}
class="btn btn-xs btn-accent m-4">Remote not working?</button
>
</div>
</div>

0 comments on commit 061da0a

Please sign in to comment.