Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
010d86f34e | ||
|
|
27d915c027 | ||
|
|
e864a6d351 | ||
|
|
93d660e978 | ||
|
|
51fa4c0540 |
No files matched your search
@@ -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/),
|
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).
|
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
|
## [0.34.0] - 2024-12-22
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ openapi: 3.0.0
|
|||||||
|
|
||||||
info:
|
info:
|
||||||
title: Playlet Web API
|
title: Playlet Web API
|
||||||
version: 0.34.0
|
version: 0.34.1
|
||||||
description:
|
description:
|
||||||
Playlet Web API is a RESTful API for controlling the Playlet app on
|
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
|
Roku devices. The API is intended to be used by the Playlet web app, but can
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.27",
|
"@rokucommunity/bslint": "^0.8.27",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.27",
|
"@rokucommunity/bslint": "^0.8.27",
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.34.0"
|
"version": "0.34.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rm -rf ../build/playlet-app",
|
"prebuild": "rm -rf ../build/playlet-app",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title=Playlet
|
|||||||
# Do not update version manually, it is auto updated from package.json
|
# Do not update version manually, it is auto updated from package.json
|
||||||
major_version=0
|
major_version=0
|
||||||
minor_version=34
|
minor_version=34
|
||||||
build_version=00000
|
build_version=00001
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.34.0"
|
"version": "0.34.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rm -rf ../build/playlet-lib",
|
"prebuild": "rm -rf ../build/playlet-lib",
|
||||||
|
|||||||
@@ -35,6 +35,14 @@ function PlaylistContentTask(input as object) as object
|
|||||||
}
|
}
|
||||||
end if
|
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
|
' TODO:P2 To remove after https://github.com/iv-org/invidious/pull/5116
|
||||||
if IsString(metadata["mixId"]) and IsArray(metadata["videos"])
|
if IsString(metadata["mixId"]) and IsArray(metadata["videos"])
|
||||||
videos = 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>
|
||||||
@@ -38,7 +38,13 @@
|
|||||||
height="42"
|
height="42"
|
||||||
translation="[20, 48]"
|
translation="[20, 48]"
|
||||||
opacity="0"
|
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
|
<MarkupList
|
||||||
id="ItemsList"
|
id="ItemsList"
|
||||||
@@ -51,7 +57,7 @@
|
|||||||
numRows="7"
|
numRows="7"
|
||||||
scrollSpeed="99999"
|
scrollSpeed="99999"
|
||||||
itemSpacing="[0, 16]"
|
itemSpacing="[0, 16]"
|
||||||
translation="[15, 120]">
|
translation="[15, 150]">
|
||||||
</MarkupList>
|
</MarkupList>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
|
|
||||||
|
|||||||
@@ -553,6 +553,12 @@ namespace Invidious
|
|||||||
videos.push({
|
videos.push({
|
||||||
"type": "video"
|
"type": "video"
|
||||||
"videoId": item
|
"videoId": item
|
||||||
|
"videoThumbnails": [{
|
||||||
|
"quality": "medium"
|
||||||
|
"url": `https://i.ytimg.com/vi/${item}/mqdefault.jpg`
|
||||||
|
"width": 320
|
||||||
|
"height": 180
|
||||||
|
}]
|
||||||
})
|
})
|
||||||
end for
|
end for
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title=PlayletLib
|
|||||||
# Do not update version manually, it is auto updated from package.json
|
# Do not update version manually, it is auto updated from package.json
|
||||||
major_version=0
|
major_version=0
|
||||||
minor_version=34
|
minor_version=34
|
||||||
build_version=00000
|
build_version=00001
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-web",
|
"name": "playlet-web",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-web",
|
"name": "playlet-web",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"youtubei.js": "^12.2.0"
|
"youtubei.js": "^12.2.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-web",
|
"name": "playlet-web",
|
||||||
"version": "0.34.0",
|
"version": "0.34.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
|
|
||||||
|
const DISABLE_CACHE = true;
|
||||||
|
|
||||||
export class InvidiousApi {
|
export class InvidiousApi {
|
||||||
public instance: string;
|
public instance: string;
|
||||||
public endpoints: any;
|
public endpoints: any;
|
||||||
@@ -290,6 +292,9 @@ export class InvidiousApi {
|
|||||||
|
|
||||||
// TODO:P2 use more appropriate cache storage
|
// TODO:P2 use more appropriate cache storage
|
||||||
private getCache(url: string, cacheSeconds: number) {
|
private getCache(url: string, cacheSeconds: number) {
|
||||||
|
if (DISABLE_CACHE) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const cacheKey = this.getCacheKey(url);
|
const cacheKey = this.getCacheKey(url);
|
||||||
const cache = localStorage.getItem(cacheKey);
|
const cache = localStorage.getItem(cacheKey);
|
||||||
if (!cache) {
|
if (!cache) {
|
||||||
|
|||||||
@@ -112,7 +112,12 @@ export class YoutubeJs {
|
|||||||
type: "video",
|
type: "video",
|
||||||
title: info.basic_info.title,
|
title: info.basic_info.title,
|
||||||
videoId: info.basic_info.id,
|
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: [],
|
storyboards: [],
|
||||||
description: "",
|
description: "",
|
||||||
published: 0,
|
published: 0,
|
||||||
|
|||||||
@@ -258,6 +258,7 @@
|
|||||||
videoThumbnails={videoMetadata?.videoThumbnails}
|
videoThumbnails={videoMetadata?.videoThumbnails}
|
||||||
author={videoMetadata?.author}
|
author={videoMetadata?.author}
|
||||||
lengthSeconds={videoMetadata?.lengthSeconds}
|
lengthSeconds={videoMetadata?.lengthSeconds}
|
||||||
|
lengthText={videoMetadata?.lengthText}
|
||||||
liveNow={videoMetadata?.liveNow}
|
liveNow={videoMetadata?.liveNow}
|
||||||
isUpcoming={videoMetadata?.isUpcoming}
|
isUpcoming={videoMetadata?.isUpcoming}
|
||||||
premiereTimestamp={videoMetadata?.premiereTimestamp}
|
premiereTimestamp={videoMetadata?.premiereTimestamp}
|
||||||
|
|||||||
@@ -43,6 +43,11 @@
|
|||||||
) {
|
) {
|
||||||
version += "-canary";
|
version += "-canary";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version) {
|
||||||
|
version = `v${version}`;
|
||||||
|
}
|
||||||
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
export let title: string | undefined = undefined;
|
export let title: string | undefined = undefined;
|
||||||
export let playlistId: string | undefined = undefined;
|
export let playlistId: string | undefined = undefined;
|
||||||
export let videoCount: number | undefined = undefined;
|
export let videoCount: number | undefined = undefined;
|
||||||
|
export let videoCountText: string | undefined = undefined;
|
||||||
export let playlistThumbnail: string | undefined = undefined;
|
export let playlistThumbnail: string | undefined = undefined;
|
||||||
export let videos: any[] | undefined = undefined;
|
export let videos: any[] | undefined = undefined;
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@
|
|||||||
title,
|
title,
|
||||||
playlistThumbnail: getPlaylistThumbnail(),
|
playlistThumbnail: getPlaylistThumbnail(),
|
||||||
videoCount,
|
videoCount,
|
||||||
|
videoCountText,
|
||||||
videos,
|
videos,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -89,6 +91,7 @@
|
|||||||
bind:title
|
bind:title
|
||||||
bind:playlistThumbnail
|
bind:playlistThumbnail
|
||||||
bind:videoCount
|
bind:videoCount
|
||||||
|
bind:videoCountText
|
||||||
bind:videos
|
bind:videos
|
||||||
bind:invidiousInstance
|
bind:invidiousInstance
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
export let playlistId: string | undefined = undefined;
|
export let playlistId: string | undefined = undefined;
|
||||||
export let playlistThumbnail: string | undefined = undefined;
|
export let playlistThumbnail: string | undefined = undefined;
|
||||||
export let videoCount: number | undefined = undefined;
|
export let videoCount: number | undefined = undefined;
|
||||||
|
export let videoCountText: string | undefined = undefined;
|
||||||
export let videos: any[] | undefined = undefined;
|
export let videos: any[] | undefined = undefined;
|
||||||
export let updated: number | undefined = undefined;
|
export let updated: number | undefined = undefined;
|
||||||
|
|
||||||
@@ -84,6 +85,7 @@
|
|||||||
bind:title
|
bind:title
|
||||||
bind:playlistThumbnail
|
bind:playlistThumbnail
|
||||||
bind:videoCount
|
bind:videoCount
|
||||||
|
bind:videoCountText
|
||||||
bind:videos
|
bind:videos
|
||||||
bind:invidiousInstance
|
bind:invidiousInstance
|
||||||
/>
|
/>
|
||||||
@@ -100,5 +102,6 @@
|
|||||||
bind:playlistId
|
bind:playlistId
|
||||||
bind:playlistThumbnail
|
bind:playlistThumbnail
|
||||||
bind:videoCount
|
bind:videoCount
|
||||||
|
bind:videoCountText
|
||||||
bind:videos
|
bind:videos
|
||||||
/>
|
/>
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
export let title: string | undefined = undefined;
|
export let title: string | undefined = undefined;
|
||||||
export let videoCount: number | undefined = undefined;
|
export let videoCount: number | undefined = undefined;
|
||||||
|
export let videoCountText: string | undefined = undefined;
|
||||||
export let playlistThumbnail: string | undefined = undefined;
|
export let playlistThumbnail: string | undefined = undefined;
|
||||||
export let videos: any[] | undefined = undefined;
|
export let videos: any[] | undefined = undefined;
|
||||||
|
|
||||||
@@ -37,6 +38,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getVideoCountText() {
|
function getVideoCountText() {
|
||||||
|
if (videoCountText) {
|
||||||
|
return videoCountText;
|
||||||
|
}
|
||||||
if (isNaN(videoCount) || videoCount < 0) {
|
if (isNaN(videoCount) || videoCount < 0) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
export let videoThumbnails: any[] | undefined = undefined;
|
export let videoThumbnails: any[] | undefined = undefined;
|
||||||
export let author: string | undefined = undefined;
|
export let author: string | undefined = undefined;
|
||||||
export let lengthSeconds: number = undefined;
|
export let lengthSeconds: number = undefined;
|
||||||
|
export let lengthText: string | undefined = undefined;
|
||||||
export let liveNow: boolean = undefined;
|
export let liveNow: boolean = undefined;
|
||||||
export let viewCount: number | undefined = undefined;
|
export let viewCount: number | undefined = undefined;
|
||||||
export let isUpcoming: boolean = undefined;
|
export let isUpcoming: boolean = undefined;
|
||||||
@@ -64,6 +65,7 @@
|
|||||||
videoThumbnails: getVideoThumbnails(),
|
videoThumbnails: getVideoThumbnails(),
|
||||||
author,
|
author,
|
||||||
lengthSeconds,
|
lengthSeconds,
|
||||||
|
lengthText,
|
||||||
liveNow,
|
liveNow,
|
||||||
viewCount,
|
viewCount,
|
||||||
timestamp,
|
timestamp,
|
||||||
@@ -96,6 +98,7 @@
|
|||||||
bind:videoThumbnails
|
bind:videoThumbnails
|
||||||
bind:liveNow
|
bind:liveNow
|
||||||
bind:lengthSeconds
|
bind:lengthSeconds
|
||||||
|
bind:lengthText
|
||||||
bind:viewCount
|
bind:viewCount
|
||||||
bind:isUpcoming
|
bind:isUpcoming
|
||||||
bind:premiereTimestamp
|
bind:premiereTimestamp
|
||||||
@@ -109,6 +112,7 @@
|
|||||||
bind:checked={videoStartAtChecked}
|
bind:checked={videoStartAtChecked}
|
||||||
bind:timestamp={videoStartAtTimestamp}
|
bind:timestamp={videoStartAtTimestamp}
|
||||||
{lengthSeconds}
|
{lengthSeconds}
|
||||||
|
{lengthText}
|
||||||
/>
|
/>
|
||||||
<div class="join join-vertical m-2">
|
<div class="join join-vertical m-2">
|
||||||
<button class="btn join-item hover:btn-accent" on:click={playOnTv}>
|
<button class="btn join-item hover:btn-accent" on:click={playOnTv}>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
export let isUpcoming: boolean = undefined;
|
export let isUpcoming: boolean = undefined;
|
||||||
export let premiereTimestamp: number | undefined = undefined;
|
export let premiereTimestamp: number | undefined = undefined;
|
||||||
export let lengthSeconds: number = undefined;
|
export let lengthSeconds: number = undefined;
|
||||||
|
export let lengthText: string | undefined = undefined;
|
||||||
export let liveNow: boolean = undefined;
|
export let liveNow: boolean = undefined;
|
||||||
|
|
||||||
// svelte-ignore unused-export-let
|
// svelte-ignore unused-export-let
|
||||||
@@ -190,6 +191,7 @@
|
|||||||
bind:isUpcoming
|
bind:isUpcoming
|
||||||
bind:premiereTimestamp
|
bind:premiereTimestamp
|
||||||
bind:lengthSeconds
|
bind:lengthSeconds
|
||||||
|
bind:lengthText
|
||||||
bind:viewCount
|
bind:viewCount
|
||||||
bind:invidiousInstance
|
bind:invidiousInstance
|
||||||
/>
|
/>
|
||||||
@@ -214,6 +216,7 @@
|
|||||||
bind:title
|
bind:title
|
||||||
bind:author
|
bind:author
|
||||||
bind:lengthSeconds
|
bind:lengthSeconds
|
||||||
|
bind:lengthText
|
||||||
bind:videoThumbnails
|
bind:videoThumbnails
|
||||||
bind:liveNow
|
bind:liveNow
|
||||||
bind:isUpcoming
|
bind:isUpcoming
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
export let checked = false;
|
export let checked = false;
|
||||||
export let lengthSeconds = undefined;
|
export let lengthSeconds = undefined;
|
||||||
|
export let lengthText = undefined;
|
||||||
export let timestamp = 0;
|
export let timestamp = 0;
|
||||||
|
|
||||||
let textInputElemet;
|
let textInputElemet;
|
||||||
@@ -15,6 +16,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if (lengthSeconds === undefined && lengthText) {
|
||||||
|
lengthSeconds = getTimeStamp(lengthText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$: timestampRange = timestamp !== undefined ? timestamp : 0;
|
$: timestampRange = timestamp !== undefined ? timestamp : 0;
|
||||||
|
|
||||||
function getTimeStamp(timestampText) {
|
function getTimeStamp(timestampText) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
export let videoThumbnails: any[] | undefined = undefined;
|
export let videoThumbnails: any[] | undefined = undefined;
|
||||||
export let liveNow: boolean = undefined;
|
export let liveNow: boolean = undefined;
|
||||||
export let lengthSeconds: number = undefined;
|
export let lengthSeconds: number = undefined;
|
||||||
|
export let lengthText: string | undefined = undefined;
|
||||||
export let viewCount: number | undefined = undefined;
|
export let viewCount: number | undefined = undefined;
|
||||||
export let isUpcoming: boolean | undefined = undefined;
|
export let isUpcoming: boolean | undefined = undefined;
|
||||||
export let premiereTimestamp: number | 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 hours = Math.floor(length / 3600);
|
||||||
const minutes = Math.floor((length / 60) % 60);
|
const minutes = Math.floor((length / 60) % 60);
|
||||||
const seconds = length % 60;
|
const seconds = length % 60;
|
||||||
@@ -80,11 +85,11 @@
|
|||||||
>
|
>
|
||||||
{$tr("LIVE")}
|
{$tr("LIVE")}
|
||||||
</div>
|
</div>
|
||||||
{:else if lengthSeconds}
|
{:else if lengthSeconds || lengthText}
|
||||||
<div
|
<div
|
||||||
class="absolute bottom-2 right-0 bg-black/70 text-white text-sm rounded-sm pt-1 pb-1 pr-2 pl-2"
|
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>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</figure>
|
</figure>
|
||||||
Reference in new issue
Block a user