Compare commits

...
5 Commits
28 changed files with 178 additions and 21 deletions

No files matched your search

+7
View File
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.34.1] - 2024-12-23
### Fixed
- Regression caused watch history thumbnails to break
- Web app views when using new backend
## [0.34.0] - 2024-12-22
### Added
+1 -1
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info:
title: Playlet Web API
version: 0.34.0
version: 0.34.1
description:
Playlet Web API is a RESTful API for controlling the Playlet app on
Roku devices. The API is intended to be used by the Playlet web app, but can
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet",
"version": "0.34.0",
"version": "0.34.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet",
"version": "0.34.0",
"version": "0.34.1",
"hasInstallScript": true,
"devDependencies": {
"@rokucommunity/bslint": "^0.8.27",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet",
"version": "0.34.0",
"version": "0.34.1",
"description": "Unofficial YouTube client for Roku",
"devDependencies": {
"@rokucommunity/bslint": "^0.8.27",
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-app",
"version": "0.34.0",
"version": "0.34.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-app",
"version": "0.34.0"
"version": "0.34.1"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-app",
"version": "0.34.0",
"version": "0.34.1",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../build/playlet-app",
+1 -1
View File
@@ -3,7 +3,7 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=34
build_version=00000
build_version=00001
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-lib",
"version": "0.34.0",
"version": "0.34.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "playlet-lib",
"version": "0.34.0"
"version": "0.34.1"
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-lib",
"version": "0.34.0",
"version": "0.34.1",
"description": "Unofficial YouTube client for Roku",
"scripts": {
"prebuild": "rm -rf ../build/playlet-lib",
@@ -35,6 +35,14 @@ function PlaylistContentTask(input as object) as object
}
end if
if metadata.DoesExist("error")
contentNode.loadState = FeedLoadState.Error
return {
success: false
error: metadata.error
}
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"]
@@ -0,0 +1,83 @@
import "pkg:/source/utils/Types.bs"
const LIB_CANARY_ZIP_URL = "https://github.com/iBicha/playlet/releases/download/canary/playlet-lib.zip"
const LIB_CANARY_SQUASHFS_URL = "https://github.com/iBicha/playlet/releases/download/canary/playlet-lib.squashfs.pkg"
function Init()
m.top.text = GetAppVersion()
end function
' TODO:P2: refactor and move to appropriate place, reuse with web app
function GetAppVersion() as string
version = "v" + GetLibVersion()
roAppInfo = CreateObject("roAppInfo")
appId = roAppInfo.GetID()
if appId = "dev"
version += "-dev"
end if
scene = m.top.getScene()
if scene.playletLibLoadedUrl <> invalid
libUrl = scene.playletLibLoadedUrl.link
libUrlType = scene.playletLibLoadedUrl.type
if libUrlType = "custom" and (libUrl = LIB_CANARY_ZIP_URL or libUrl = LIB_CANARY_SQUASHFS_URL)
version += "-canary"
end if
end if
return version
end function
function GetLibVersion() as string
values = GetLibManifestValues()
if values = invalid
return "0.0.0"
end if
major = 0
minor = 0
build = 0
if values.DoesExist("major_version")
value = values["major_version"]
if IsString(value)
major = value.toInt()
end if
end if
if values.DoesExist("minor_version")
value = values["minor_version"]
if IsString(value)
minor = value.toInt()
end if
end if
if values.DoesExist("build_version")
value = values["build_version"]
if IsString(value)
build = value.toInt()
end if
end if
return `${major}.${minor}.${build}`
end function
function GetLibManifestValues() as object
libManifest = ReadAsciiFile("libpkg:/manifest")
lines = libManifest.Tokenize(`\n`)
values = {}
for each line in lines
if line.left(1) = "#"
continue for
end if
keyValuePair = line.Tokenize("=")
if keyValuePair.Count() <> 2
continue for
end if
values[keyValuePair[0]] = keyValuePair[1]
end for
return values
end function
@@ -0,0 +1,2 @@
<component name="AppVersionLabel" extends="SimpleLabel">
</component>
+8 -2
View File
@@ -38,7 +38,13 @@
height="42"
translation="[20, 48]"
opacity="0"
uri="pkg:/images/logo-dark.png" />
uri="pkg:/images/logo-dark.png">
<AppVersionLabel
fontUri="font:BoldSystemFontFile"
fontSize="16"
translation="[0, 48]"
/>
</Poster>
<MarkupList
id="ItemsList"
@@ -51,7 +57,7 @@
numRows="7"
scrollSpeed="99999"
itemSpacing="[0, 16]"
translation="[15, 120]">
translation="[15, 150]">
</MarkupList>
</Rectangle>
@@ -553,6 +553,12 @@ namespace Invidious
videos.push({
"type": "video"
"videoId": item
"videoThumbnails": [{
"quality": "medium"
"url": `https://i.ytimg.com/vi/${item}/mqdefault.jpg`
"width": 320
"height": 180
}]
})
end for
+1 -1
View File
@@ -3,7 +3,7 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json
major_version=0
minor_version=34
build_version=00000
build_version=00001
ui_resolutions=hd
uri_resolution_autosub=$$RES$$,480p,720p,1080p
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "playlet-web",
"version": "0.34.0",
"version": "0.34.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "playlet-web",
"version": "0.34.0",
"version": "0.34.1",
"dependencies": {
"youtubei.js": "^12.2.0"
},
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "playlet-web",
"version": "0.34.0",
"version": "0.34.1",
"type": "module",
"scripts": {
"dev": "vite",
+5
View File
@@ -1,5 +1,7 @@
import { PlayletApi } from "lib/Api/PlayletApi";
const DISABLE_CACHE = true;
export class InvidiousApi {
public instance: string;
public endpoints: any;
@@ -290,6 +292,9 @@ export class InvidiousApi {
// TODO:P2 use more appropriate cache storage
private getCache(url: string, cacheSeconds: number) {
if (DISABLE_CACHE) {
return null;
}
const cacheKey = this.getCacheKey(url);
const cache = localStorage.getItem(cacheKey);
if (!cache) {
+6 -1
View File
@@ -112,7 +112,12 @@ export class YoutubeJs {
type: "video",
title: info.basic_info.title,
videoId: info.basic_info.id,
videoThumbnails: [],
videoThumbnails: [{
quality: "medium",
url: `https://i.ytimg.com/vi/${info.basic_info.id}/mqdefault.jpg`,
width: 320,
height: 180
}],
storyboards: [],
description: "",
published: 0,
+1
View File
@@ -258,6 +258,7 @@
videoThumbnails={videoMetadata?.videoThumbnails}
author={videoMetadata?.author}
lengthSeconds={videoMetadata?.lengthSeconds}
lengthText={videoMetadata?.lengthText}
liveNow={videoMetadata?.liveNow}
isUpcoming={videoMetadata?.isUpcoming}
premiereTimestamp={videoMetadata?.premiereTimestamp}
+5
View File
@@ -43,6 +43,11 @@
) {
version += "-canary";
}
if (version) {
version = `v${version}`;
}
return version;
}
</script>
@@ -6,6 +6,7 @@
export let title: string | undefined = undefined;
export let playlistId: string | undefined = undefined;
export let videoCount: number | undefined = undefined;
export let videoCountText: string | undefined = undefined;
export let playlistThumbnail: string | undefined = undefined;
export let videos: any[] | undefined = undefined;
@@ -50,6 +51,7 @@
title,
playlistThumbnail: getPlaylistThumbnail(),
videoCount,
videoCountText,
videos,
};
}
@@ -89,6 +91,7 @@
bind:title
bind:playlistThumbnail
bind:videoCount
bind:videoCountText
bind:videos
bind:invidiousInstance
/>
@@ -9,6 +9,7 @@
export let playlistId: string | undefined = undefined;
export let playlistThumbnail: string | undefined = undefined;
export let videoCount: number | undefined = undefined;
export let videoCountText: string | undefined = undefined;
export let videos: any[] | undefined = undefined;
export let updated: number | undefined = undefined;
@@ -84,6 +85,7 @@
bind:title
bind:playlistThumbnail
bind:videoCount
bind:videoCountText
bind:videos
bind:invidiousInstance
/>
@@ -100,5 +102,6 @@
bind:playlistId
bind:playlistThumbnail
bind:videoCount
bind:videoCountText
bind:videos
/>
@@ -3,6 +3,7 @@
export let title: string | undefined = undefined;
export let videoCount: number | undefined = undefined;
export let videoCountText: string | undefined = undefined;
export let playlistThumbnail: string | undefined = undefined;
export let videos: any[] | undefined = undefined;
@@ -37,6 +38,9 @@
}
function getVideoCountText() {
if (videoCountText) {
return videoCountText;
}
if (isNaN(videoCount) || videoCount < 0) {
return "";
}
@@ -9,6 +9,7 @@
export let videoThumbnails: any[] | undefined = undefined;
export let author: string | undefined = undefined;
export let lengthSeconds: number = undefined;
export let lengthText: string | undefined = undefined;
export let liveNow: boolean = undefined;
export let viewCount: number | undefined = undefined;
export let isUpcoming: boolean = undefined;
@@ -64,6 +65,7 @@
videoThumbnails: getVideoThumbnails(),
author,
lengthSeconds,
lengthText,
liveNow,
viewCount,
timestamp,
@@ -96,6 +98,7 @@
bind:videoThumbnails
bind:liveNow
bind:lengthSeconds
bind:lengthText
bind:viewCount
bind:isUpcoming
bind:premiereTimestamp
@@ -109,6 +112,7 @@
bind:checked={videoStartAtChecked}
bind:timestamp={videoStartAtTimestamp}
{lengthSeconds}
{lengthText}
/>
<div class="join join-vertical m-2">
<button class="btn join-item hover:btn-accent" on:click={playOnTv}>
@@ -16,6 +16,7 @@
export let isUpcoming: boolean = undefined;
export let premiereTimestamp: number | undefined = undefined;
export let lengthSeconds: number = undefined;
export let lengthText: string | undefined = undefined;
export let liveNow: boolean = undefined;
// svelte-ignore unused-export-let
@@ -190,6 +191,7 @@
bind:isUpcoming
bind:premiereTimestamp
bind:lengthSeconds
bind:lengthText
bind:viewCount
bind:invidiousInstance
/>
@@ -214,6 +216,7 @@
bind:title
bind:author
bind:lengthSeconds
bind:lengthText
bind:videoThumbnails
bind:liveNow
bind:isUpcoming
@@ -3,6 +3,7 @@
export let checked = false;
export let lengthSeconds = undefined;
export let lengthText = undefined;
export let timestamp = 0;
let textInputElemet;
@@ -15,6 +16,12 @@
}
}
$: {
if (lengthSeconds === undefined && lengthText) {
lengthSeconds = getTimeStamp(lengthText);
}
}
$: timestampRange = timestamp !== undefined ? timestamp : 0;
function getTimeStamp(timestampText) {
@@ -6,6 +6,7 @@
export let videoThumbnails: any[] | undefined = undefined;
export let liveNow: boolean = undefined;
export let lengthSeconds: number = undefined;
export let lengthText: string | undefined = undefined;
export let viewCount: number | undefined = undefined;
export let isUpcoming: boolean | undefined = undefined;
export let premiereTimestamp: number | undefined = undefined;
@@ -29,7 +30,11 @@
}
}
function getFormattedTime(length) {
function getFormattedTime(text, length) {
if (text) {
return text;
}
const hours = Math.floor(length / 3600);
const minutes = Math.floor((length / 60) % 60);
const seconds = length % 60;
@@ -80,11 +85,11 @@
>
{$tr("LIVE")}
</div>
{:else if lengthSeconds}
{:else if lengthSeconds || lengthText}
<div
class="absolute bottom-2 right-0 bg-black/70 text-white text-sm rounded-sm pt-1 pb-1 pr-2 pl-2"
>
{getFormattedTime(lengthSeconds)}
{getFormattedTime(lengthText, lengthSeconds)}
</div>
{/if}
</figure>