Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57885a4e8f | ||
|
|
ed5ab70ceb | ||
|
|
2f8679bc1c | ||
|
|
28c10022bd | ||
|
|
57cdb59790 | ||
|
|
f6d8afc2d9 | ||
|
|
31c4d7e2a0 | ||
|
|
4dabd00b2a | ||
|
|
7fab7f7f39 | ||
|
|
d5508587d2 | ||
|
|
af4c28a411 | ||
|
|
26774d5655 | ||
|
|
3daa94dee1 | ||
|
|
c95bb85c6e | ||
|
|
4b3d1340df | ||
|
|
68c8f12f9d | ||
|
|
66990cfd67 | ||
|
|
aab20f2364 | ||
|
|
f987558884 | ||
|
|
fcca018fe8 | ||
|
|
96bbbd0d77 | ||
|
|
a04e853328 | ||
|
|
c534c27ae3 | ||
|
|
9eeb9fcffe | ||
|
|
75769b72e0 | ||
|
|
c14195041e | ||
|
|
ec941d64dc |
No files matched your search
@@ -1,3 +1,4 @@
|
|||||||
|
.DS_Store
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
out/
|
out/
|
||||||
|
|||||||
@@ -5,6 +5,31 @@ 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.36.0] - 2025-01-16
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support for channel "Courses" in Playlet backend
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Web app tech refresh
|
||||||
|
- Web app "Open in Invidious" when built-in backend is selected
|
||||||
|
- Playlist continuation showing invalid items at the end of playlists
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Skip "Creator on the Rise" that show up in trending
|
||||||
|
- They end up hijacking the feed
|
||||||
|
- Might become a setting in the future
|
||||||
|
|
||||||
|
## [0.35.5] - 2025-01-09
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Ability to hide announcement messages
|
||||||
|
- [UX] Clarify that you can't login using Playlet built-in backend (Yet)
|
||||||
|
|
||||||
## [0.35.4] - 2025-01-07
|
## [0.35.4] - 2025-01-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ More under [Screenshots](./docs/screenshots/README.md)
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[Playlet on Roku channel store](https://channelstore.roku.com/details/840aec36f51bfe6d96cf6db9055a372a/playlet)
|
[Playlet on Roku channel store](https://channelstore.roku.com/details/840aec36f51bfe6d96cf6db9055a372a/playlet) or search "Playlet" in the Roku channel store on your device.
|
||||||
|
|
||||||
Can't install from the store? See [How to install Playlet as a sideloaded/dev app](https://github.com/iBicha/playlet/discussions/371)
|
Can't install from the store? See [How to install Playlet as a sideloaded/dev app](https://github.com/iBicha/playlet/discussions/371)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ openapi: 3.0.0
|
|||||||
|
|
||||||
info:
|
info:
|
||||||
title: Playlet Web API
|
title: Playlet Web API
|
||||||
version: 0.35.4
|
version: 0.36.0
|
||||||
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
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
const dotenv = require('dotenv');
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
import { utils } from 'roku-test-automation';
|
||||||
|
|
||||||
|
const envFile = path.join(__dirname, '../.env');
|
||||||
|
const config = getEnvVars(['ROKU_DEV_TARGET', 'ROKU_DEVPASSWORD']);
|
||||||
|
|
||||||
|
export function setupEnvironment() {
|
||||||
|
utils.setupEnvironmentFromConfig({
|
||||||
|
RokuDevice: {
|
||||||
|
devices: [{
|
||||||
|
host: config.ROKU_DEV_TARGET,
|
||||||
|
password: config.ROKU_DEVPASSWORD
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
ECP: {
|
||||||
|
default: {
|
||||||
|
launchChannelId: 'dev'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
OnDeviceComponent: {
|
||||||
|
logLevel: 'info'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEnvVars(requiredVars = undefined) {
|
||||||
|
let envVars = process.env;
|
||||||
|
if (fs.existsSync(envFile)) {
|
||||||
|
const envConfig = dotenv.parse(fs.readFileSync(envFile));
|
||||||
|
envVars = { ...envVars, ...envConfig };
|
||||||
|
}
|
||||||
|
if (requiredVars) {
|
||||||
|
const missingVars = requiredVars.filter((key) => !envVars[key]);
|
||||||
|
if (missingVars.length) {
|
||||||
|
throw new Error(`Missing environment variables: ${missingVars.join(', ')}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return envVars;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// integration test to play a video on the Roku device
|
||||||
|
// 1. Run dev channel on the Roku device (Playlet (dev))
|
||||||
|
// 2. npm run restart-app && npm run test:integration
|
||||||
|
import { ecp, odc } from 'roku-test-automation';
|
||||||
|
import { setupEnvironment } from './common';
|
||||||
|
import { Key } from 'roku-test-automation/client/dist/ECP';
|
||||||
|
|
||||||
|
setupEnvironment();
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
await ecp.sendInput({ params: { contentId: "jNQXAC9IVRw" } });
|
||||||
|
|
||||||
|
await odc.onFieldChangeOnce({
|
||||||
|
base: "scene",
|
||||||
|
keyPath: "#VideoQueue.player.state",
|
||||||
|
match: "playing",
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("Video started playing");
|
||||||
|
|
||||||
|
await ecp.sendKeypress(Key.Back);
|
||||||
|
|
||||||
|
await odc.shutdown();
|
||||||
|
})();
|
||||||
Generated
+2175
-1021
File diff suppressed because it is too large.
Load diff
+11
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet",
|
"name": "playlet",
|
||||||
"version": "0.35.4",
|
"version": "0.36.0",
|
||||||
"description": "Unofficial YouTube client for Roku",
|
"description": "Unofficial YouTube client for Roku",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rokucommunity/bslint": "^0.8.27",
|
"@rokucommunity/bslint": "^0.8.27",
|
||||||
@@ -15,19 +15,20 @@
|
|||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"glob": "^11.0.0",
|
"glob": "^11.0.1",
|
||||||
"imap": "^0.8.19",
|
"imap": "^0.8.19",
|
||||||
"ip": "^2.0.1",
|
"ip": "^2.0.1",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"mailparser": "^3.7.2",
|
"mailparser": "^3.7.2",
|
||||||
"protocol-buffers-schema": "^3.6.0",
|
"protocol-buffers-schema": "^3.6.0",
|
||||||
"roku-deploy": "^3.12.3",
|
"roku-deploy": "^3.12.3",
|
||||||
|
"roku-test-automation": "^2.0.10",
|
||||||
"rooibos-roku": "5.14.0",
|
"rooibos-roku": "5.14.0",
|
||||||
"rounded-rect-9patch": "^1.1.2",
|
"rounded-rect-9patch": "^1.1.2",
|
||||||
"semver": "^7.6.3",
|
"semver": "^7.6.3",
|
||||||
"shelljs": "^0.8.5",
|
"shelljs": "^0.8.5",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "5.7.2",
|
"typescript": "5.7.3",
|
||||||
"xml2js": "^0.6.2",
|
"xml2js": "^0.6.2",
|
||||||
"yaml": "^2.7.0"
|
"yaml": "^2.7.0"
|
||||||
},
|
},
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
"test:build:app": "cd playlet-app && npm run test:build",
|
"test:build:app": "cd playlet-app && npm run test:build",
|
||||||
"test:lib": "cd playlet-lib && npm run test",
|
"test:lib": "cd playlet-lib && npm run test",
|
||||||
"test:build:lib": "cd playlet-lib && npm run test:build",
|
"test:build:lib": "cd playlet-lib && npm run test:build",
|
||||||
|
"test:integration": "npx tsx ./integration-tests/play-video.ts",
|
||||||
"version-sync": "node tools/version-sync.js",
|
"version-sync": "node tools/version-sync.js",
|
||||||
"manifest-git-hash": "node tools/update-manifest-git-hash.js",
|
"manifest-git-hash": "node tools/update-manifest-git-hash.js",
|
||||||
"sign-released-package": "node tools/sign-released-package.js",
|
"sign-released-package": "node tools/sign-released-package.js",
|
||||||
@@ -62,9 +64,13 @@
|
|||||||
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
|
"generate-sponsorblock-config": "node tools/generate-sponsorblock-config.js",
|
||||||
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
|
"update-rale-component": "cd tools/RALE && rm TrackerTask.xml && curl -o TrackerTask.zip https://devtools.web.roku.com/roku-advanced-layout-editor/app/TrackerTask.zip && unzip TrackerTask.zip && rm TrackerTask.zip",
|
||||||
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playlet-web && npm install",
|
"postinstall": "cd playlet-lib && npm install && cd ../playlet-app && npm install && cd ../playlet-web && npm install",
|
||||||
"update-deps": "npx npm-check-updates --deep --upgrade --install always --reject @sveltejs/vite-plugin-svelte,svelte,vite,@vitejs/plugin-legacy",
|
"update-deps": "npx npm-check-updates --deep --upgrade --install always",
|
||||||
"registry:write": "node tools/registry.js --input registry.json",
|
"registry:write": "node tools/registry.js --input registry.json",
|
||||||
"registry:read": "node tools/registry.js --output registry.json",
|
"registry:read": "node tools/registry.js --output registry.json",
|
||||||
"registry:clear": "node tools/registry.js --clear"
|
"registry:clear": "node tools/registry.js --clear",
|
||||||
|
"restart-app": "node tools/restart-app.js"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@rollup/rollup-linux-x64-gnu": "^4.30.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.35.4",
|
"version": "0.36.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.35.4"
|
"version": "0.36.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-app",
|
"name": "playlet-app",
|
||||||
"version": "0.35.4",
|
"version": "0.36.0",
|
||||||
"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",
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ 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=35
|
minor_version=36
|
||||||
build_version=00004
|
build_version=00000
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
function DialogShowError(message as object, bulletText as object, bottomMessage as object)
|
function DialogShowError(message as object, bulletText as object, bottomMessage as object)
|
||||||
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
||||||
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
|
msgDialog = CreateObject("roSGNode", "StandardMessageDialog")
|
||||||
DialogSetPalette(msgDialog)
|
|
||||||
msgDialog.message = message
|
msgDialog.message = message
|
||||||
msgDialog.bulletText = bulletText
|
msgDialog.bulletText = bulletText
|
||||||
msgDialog.bottomMessage = bottomMessage
|
msgDialog.bottomMessage = bottomMessage
|
||||||
@@ -16,19 +15,6 @@ function DialogShowError(message as object, bulletText as object, bottomMessage
|
|||||||
m.top.getScene().dialog = msgDialog
|
m.top.getScene().dialog = msgDialog
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function DialogSetPalette(msgDialog as object)
|
|
||||||
palette = createObject("roSGNode", "RSGPalette")
|
|
||||||
palette.colors = {
|
|
||||||
DialogBackgroundColor: "#242424FF"
|
|
||||||
DialogFocusColor: "#CECECEFF"
|
|
||||||
DialogFocusItemColor: "#202020FF"
|
|
||||||
DialogSecondaryTextColor: "#EBEBEBFF"
|
|
||||||
DialogSecondaryItemColor: "#FF1C30FF"
|
|
||||||
DialogTextColor: "#EBEBEBFF"
|
|
||||||
}
|
|
||||||
msgDialog.palette = palette
|
|
||||||
end function
|
|
||||||
|
|
||||||
function DialogOnButtonSelected()
|
function DialogOnButtonSelected()
|
||||||
m.top.getScene().dialog.close = true
|
m.top.getScene().dialog.close = true
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
' Playlet (App to play videos from an Invidious server on Roku TVs)
|
' Playlet (App to play videos from an Invidious server on Roku TVs)
|
||||||
' Copyright (C) 2024 Brahim Hadriche
|
' Copyright (C) 2025 Brahim Hadriche
|
||||||
|
|
||||||
' This program is free software: you can redistribute it and/or modify
|
' This program is free software: you can redistribute it and/or modify
|
||||||
' it under the terms of the GNU Affero General Public License as published by
|
' it under the terms of the GNU Affero General Public License as published by
|
||||||
@@ -29,6 +29,7 @@ function Main(args as object) as void
|
|||||||
scene = screen.CreateScene("BootstrapScene")
|
scene = screen.CreateScene("BootstrapScene")
|
||||||
screen.show()
|
screen.show()
|
||||||
|
|
||||||
|
SetScenePalette(scene)
|
||||||
scene.ObserveField("exitChannel", port)
|
scene.ObserveField("exitChannel", port)
|
||||||
scene.launchArgs = args
|
scene.launchArgs = args
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
function SetPalette(dialog as object)
|
function SetScenePalette(scene as object)
|
||||||
palette = createObject("roSGNode", "RSGPalette")
|
palette = CreateObject("roSGNode", "RSGPalette")
|
||||||
palette.colors = {
|
palette.colors = {
|
||||||
DialogBackgroundColor: "#242424FF"
|
DialogBackgroundColor: "#242424FF"
|
||||||
DialogFocusColor: "#CECECEFF"
|
DialogFocusColor: "#CECECEFF"
|
||||||
@@ -8,5 +8,5 @@ function SetPalette(dialog as object)
|
|||||||
DialogSecondaryItemColor: "#FF1C30FF"
|
DialogSecondaryItemColor: "#FF1C30FF"
|
||||||
DialogTextColor: "#EBEBEBFF"
|
DialogTextColor: "#EBEBEBFF"
|
||||||
}
|
}
|
||||||
dialog.palette = palette
|
scene.palette = palette
|
||||||
end function
|
end function
|
||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.35.4",
|
"version": "0.36.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.35.4"
|
"version": "0.36.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-lib",
|
"name": "playlet-lib",
|
||||||
"version": "0.35.4",
|
"version": "0.36.0",
|
||||||
"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",
|
||||||
|
|||||||
@@ -215,6 +215,9 @@ function InitializeTabs()
|
|||||||
"playlists": function(authorId as string, author as string, params as string) as object
|
"playlists": function(authorId as string, author as string, params as string) as object
|
||||||
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author, params)
|
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author, params)
|
||||||
end function
|
end function
|
||||||
|
"courses": function(authorId as string, author as string, params as string) as object
|
||||||
|
return CreateChannelFeed("Courses", "channel_courses", authorId, author, params)
|
||||||
|
end function
|
||||||
}
|
}
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import "pkg:/source/utils/Locale.bs"
|
import "pkg:/source/utils/Locale.bs"
|
||||||
|
import "pkg:/source/utils/RegistryUtils.bs"
|
||||||
|
import "pkg:/source/utils/StringUtils.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
namespace DialogUtils
|
namespace DialogUtils
|
||||||
@@ -91,4 +93,58 @@ namespace DialogUtils
|
|||||||
return dialog
|
return dialog
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function ShowDialogOnce(options as object) as object
|
||||||
|
messageId = ValidString(options.messageId)
|
||||||
|
hasMessageId = messageId <> ""
|
||||||
|
|
||||||
|
if hasMessageId
|
||||||
|
messages = RegistryUtils.Read(RegistryUtils.MESSAGES)
|
||||||
|
if not StringUtils.IsNullOrEmpty(messages)
|
||||||
|
messages = ParseJson(messages)
|
||||||
|
if IsAssociativeArray(messages)
|
||||||
|
savedMessageId = ValidString(messages["messageId"])
|
||||||
|
if savedMessageId = messageId
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
|
options.buttons = [
|
||||||
|
Tr(Locale.Buttons.OK)
|
||||||
|
`${Tr(Locale.Buttons.OK)} - ${Tr(Locale.Buttons.DotNotShowAgain)}`
|
||||||
|
]
|
||||||
|
|
||||||
|
dialog = ShowDialogEx(options)
|
||||||
|
if dialog = invalid
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
|
||||||
|
dialog.AddFields({
|
||||||
|
"messageId": messageId
|
||||||
|
})
|
||||||
|
|
||||||
|
dialog.ObserveField("buttonSelected", FuncName(OnShowDialogOnceButtonSelected))
|
||||||
|
return dialog
|
||||||
|
end function
|
||||||
|
|
||||||
|
function OnShowDialogOnceButtonSelected(event as object) as void
|
||||||
|
buttonSelected = event.getData()
|
||||||
|
if buttonSelected <> 1
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
dialog = event.GetRoSGNode()
|
||||||
|
messageId = dialog.messageId
|
||||||
|
if messageId = ""
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
messages = {
|
||||||
|
"messageId": messageId
|
||||||
|
}
|
||||||
|
|
||||||
|
RegistryUtils.Write(RegistryUtils.MESSAGES, FormatJson(messages))
|
||||||
|
end function
|
||||||
|
|
||||||
end namespace
|
end namespace
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
import "DialogPalette.bs"
|
|
||||||
import "pkg:/source/utils/Locale.bs"
|
import "pkg:/source/utils/Locale.bs"
|
||||||
import "pkg:/source/utils/StringUtils.bs"
|
import "pkg:/source/utils/StringUtils.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
SetPalette(m.top)
|
|
||||||
m.urlLabel = m.top.findNode("urlLabel")
|
m.urlLabel = m.top.findNode("urlLabel")
|
||||||
m.qrCode = m.top.findNode("QrCodePoster")
|
m.qrCode = m.top.findNode("QrCodePoster")
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import "DialogPalette.bs"
|
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
SetPalette(m.top)
|
|
||||||
m.top.observeField("buttonSelected", FuncName(CloseDialog))
|
m.top.observeField("buttonSelected", FuncName(CloseDialog))
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import "DialogPalette.bs"
|
|
||||||
import "pkg:/source/utils/FocusManagement.bs"
|
import "pkg:/source/utils/FocusManagement.bs"
|
||||||
import "pkg:/source/utils/Logging.bs"
|
import "pkg:/source/utils/Logging.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
SetPalette(m.top)
|
|
||||||
m.top.observeField("buttonSelected", FuncName(OnButtonSelected))
|
m.top.observeField("buttonSelected", FuncName(OnButtonSelected))
|
||||||
m.top.observeField("wasClosed", FuncName(OnDialogClosed))
|
m.top.observeField("wasClosed", FuncName(OnDialogClosed))
|
||||||
end function
|
end function
|
||||||
|
|||||||
@@ -7,12 +7,32 @@ import "pkg:/source/utils/Locale.bs"
|
|||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
m.scene = m.top.getScene()
|
m.scene = m.top.getScene()
|
||||||
|
SetScenePalette(m.scene)
|
||||||
|
|
||||||
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
|
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
|
||||||
' Let's wait until it has one.
|
' Let's wait until it has one.
|
||||||
m.MainSceneContainer = m.scene.findNode("MainSceneContainer")
|
m.MainSceneContainer = m.scene.findNode("MainSceneContainer")
|
||||||
m.MainSceneContainer.ObserveField("change", FuncName(MainSceneContainerChanged))
|
m.MainSceneContainer.ObserveField("change", FuncName(MainSceneContainerChanged))
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function SetScenePalette(scene as object) as void
|
||||||
|
palette = scene.palette
|
||||||
|
if palette <> invalid
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
palette = CreateObject("roSGNode", "RSGPalette")
|
||||||
|
palette.colors = {
|
||||||
|
DialogBackgroundColor: "#242424FF"
|
||||||
|
DialogFocusColor: "#CECECEFF"
|
||||||
|
DialogFocusItemColor: "#202020FF"
|
||||||
|
DialogSecondaryTextColor: "#EBEBEBFF"
|
||||||
|
DialogSecondaryItemColor: "#FF1C30FF"
|
||||||
|
DialogTextColor: "#EBEBEBFF"
|
||||||
|
}
|
||||||
|
scene.palette = palette
|
||||||
|
end function
|
||||||
|
|
||||||
function MainSceneContainerChanged()
|
function MainSceneContainerChanged()
|
||||||
AutoBindSceneGraph()
|
AutoBindSceneGraph()
|
||||||
StartWebServer()
|
StartWebServer()
|
||||||
@@ -35,7 +55,8 @@ function StartWebServer()
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function ShowAnnouncement()
|
function ShowAnnouncement()
|
||||||
DialogUtils.ShowDialogEx({
|
DialogUtils.ShowDialogOnce({
|
||||||
|
messageId: "1736288537"
|
||||||
title: "Announcement - Playlet backend"
|
title: "Announcement - Playlet backend"
|
||||||
message: [
|
message: [
|
||||||
"An experimental built-in backend has been added to Playlet."
|
"An experimental built-in backend has been added to Playlet."
|
||||||
|
|||||||
@@ -8,12 +8,30 @@
|
|||||||
function Init()
|
function Init()
|
||||||
InitializeBindings() ' auto-generated!
|
InitializeBindings() ' auto-generated!
|
||||||
m.scene = m.top.getScene()
|
m.scene = m.top.getScene()
|
||||||
|
SetScenePalette(m.scene)
|
||||||
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
|
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
|
||||||
' Let's wait until it has one.
|
' Let's wait until it has one.
|
||||||
m.MainSceneContainer = m.scene.findNode("MainSceneContainer")
|
m.MainSceneContainer = m.scene.findNode("MainSceneContainer")
|
||||||
m.MainSceneContainer.ObserveField("change", FuncName(MainSceneContainerChanged))
|
m.MainSceneContainer.ObserveField("change", FuncName(MainSceneContainerChanged))
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function SetScenePalette(scene as object) as void
|
||||||
|
palette = scene.palette
|
||||||
|
if palette <> invalid
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
palette = CreateObject("roSGNode", "RSGPalette")
|
||||||
|
palette.colors = {
|
||||||
|
DialogBackgroundColor: "#242424FF"
|
||||||
|
DialogFocusColor: "#CECECEFF"
|
||||||
|
DialogFocusItemColor: "#202020FF"
|
||||||
|
DialogSecondaryTextColor: "#EBEBEBFF"
|
||||||
|
DialogSecondaryItemColor: "#FF1C30FF"
|
||||||
|
DialogTextColor: "#EBEBEBFF"
|
||||||
|
}
|
||||||
|
scene.palette = palette
|
||||||
|
end function
|
||||||
|
|
||||||
function MainSceneContainerChanged()
|
function MainSceneContainerChanged()
|
||||||
AutoBindSceneGraph()
|
AutoBindSceneGraph()
|
||||||
StartWebServer()
|
StartWebServer()
|
||||||
@@ -34,7 +52,8 @@ function StartWebServer()
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function ShowAnnouncement()
|
function ShowAnnouncement()
|
||||||
DialogUtils_ShowDialogEx({
|
DialogUtils_ShowDialogOnce({
|
||||||
|
messageId: "1736288537"
|
||||||
title: "Announcement - Playlet backend"
|
title: "Announcement - Playlet backend"
|
||||||
message: [
|
message: [
|
||||||
"An experimental built-in backend has been added to Playlet."
|
"An experimental built-in backend has been added to Playlet."
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
|
<script type="text/brightscript" uri="pkg:/source/utils/StringUtils.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
|
<script type="text/brightscript" uri="pkg:/source/utils/Logging.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/components/Dialog/DialogUtils.brs" />
|
<script type="text/brightscript" uri="pkg:/components/Dialog/DialogUtils.brs" />
|
||||||
|
<script type="text/brightscript" uri="pkg:/source/utils/RegistryUtils.brs" />
|
||||||
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
<script type="text/brightscript" uri="pkg:/source/bslib.brs" />
|
||||||
<children>
|
<children>
|
||||||
<Logger id="Logger" />
|
<Logger id="Logger" />
|
||||||
|
|||||||
@@ -38,6 +38,17 @@ function OnRowItemSelected() as void
|
|||||||
row = m.profileRowList.content.GetChild(0)
|
row = m.profileRowList.content.GetChild(0)
|
||||||
selectedProfile = row.GetChild(index)
|
selectedProfile = row.GetChild(index)
|
||||||
if selectedProfile.type = "login"
|
if selectedProfile.type = "login"
|
||||||
|
invidiousInstance = m.preferences["invidious.instance"]
|
||||||
|
if StringUtils.IsNullOrEmpty(invidiousInstance)
|
||||||
|
DialogUtils.ShowDialogEx({
|
||||||
|
title: "No Invidious Instance"
|
||||||
|
message: [
|
||||||
|
"Playlet built-in backend does not support login yet.",
|
||||||
|
"Can only login if an Invidious instance is set in the settings."
|
||||||
|
]
|
||||||
|
})
|
||||||
|
return
|
||||||
|
end if
|
||||||
dialog = CreateObject("roSGNode", "LoginDialog")
|
dialog = CreateObject("roSGNode", "LoginDialog")
|
||||||
dialog@.BindNode()
|
dialog@.BindNode()
|
||||||
m.top.getScene().dialog = dialog
|
m.top.getScene().dialog = dialog
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<field id="navBar" type="node" bind="/NavBar" />
|
<field id="navBar" type="node" bind="/NavBar" />
|
||||||
<field id="profilesService" type="node" bind="/ProfilesService" />
|
<field id="profilesService" type="node" bind="/ProfilesService" />
|
||||||
<field id="appController" type="node" bind="/AppController" />
|
<field id="appController" type="node" bind="/AppController" />
|
||||||
|
<field id="preferences" type="node" bind="/Preferences" />
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
<children>
|
<children>
|
||||||
|
|||||||
-2
@@ -1,4 +1,3 @@
|
|||||||
import "pkg:/components/Dialog/DialogPalette.bs"
|
|
||||||
import "pkg:/components/Navigation/Navigation.bs"
|
import "pkg:/components/Navigation/Navigation.bs"
|
||||||
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
||||||
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||||
@@ -102,7 +101,6 @@ end function
|
|||||||
|
|
||||||
function OnEditButtonSelected()
|
function OnEditButtonSelected()
|
||||||
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
||||||
SetPalette(keyboardDialog)
|
|
||||||
' TODO:P2 localize
|
' TODO:P2 localize
|
||||||
keyboardDialog.title = "Edit Instance"
|
keyboardDialog.title = "Edit Instance"
|
||||||
' TODO:P2 localize
|
' TODO:P2 localize
|
||||||
|
|||||||
+3
-1
@@ -102,7 +102,6 @@ function Refresh()
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function OnInvidiousPublicInstancesTaskResults(output as object) as void
|
function OnInvidiousPublicInstancesTaskResults(output as object) as void
|
||||||
m.top.focusable = true
|
|
||||||
m.busySpinner.visible = false
|
m.busySpinner.visible = false
|
||||||
m.busySpinner.control = "stop"
|
m.busySpinner.control = "stop"
|
||||||
|
|
||||||
@@ -130,6 +129,8 @@ function OnInvidiousPublicInstancesTaskResults(output as object) as void
|
|||||||
|
|
||||||
m.failedLabel.visible = true
|
m.failedLabel.visible = true
|
||||||
m.refreshButton.visible = true
|
m.refreshButton.visible = true
|
||||||
|
m.top.focusable = true
|
||||||
|
|
||||||
if m.top.IsInFocusChain()
|
if m.top.IsInFocusChain()
|
||||||
NodeSetFocus(m.top, true)
|
NodeSetFocus(m.top, true)
|
||||||
end if
|
end if
|
||||||
@@ -138,6 +139,7 @@ function OnInvidiousPublicInstancesTaskResults(output as object) as void
|
|||||||
|
|
||||||
m.instances.visible = true
|
m.instances.visible = true
|
||||||
m.instancesHeader.visible = true
|
m.instancesHeader.visible = true
|
||||||
|
m.top.focusable = m.instances.content.getChildCount() > 0
|
||||||
|
|
||||||
if m.top.IsInFocusChain()
|
if m.top.IsInFocusChain()
|
||||||
NodeSetFocus(m.top, true)
|
NodeSetFocus(m.top, true)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import "pkg:/components/Dialog/DialogPalette.bs"
|
|
||||||
import "pkg:/source/utils/FocusManagement.bs"
|
import "pkg:/source/utils/FocusManagement.bs"
|
||||||
import "pkg:/source/utils/Locale.bs"
|
import "pkg:/source/utils/Locale.bs"
|
||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
@@ -67,7 +66,6 @@ end function
|
|||||||
|
|
||||||
function ShowEditKeyboard()
|
function ShowEditKeyboard()
|
||||||
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
||||||
SetPalette(keyboardDialog)
|
|
||||||
keyboardDialog.title = m.top.displayText
|
keyboardDialog.title = m.top.displayText
|
||||||
keyboardDialog.message = [m.top.description]
|
keyboardDialog.message = [m.top.description]
|
||||||
keyboardDialog.text = m.top.value
|
keyboardDialog.text = m.top.value
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ namespace InnertubeService
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
json = response.Json()
|
json = response.Json()
|
||||||
feeds = Innertube.ParseResponseDataForFeeds(json)
|
feeds = Innertube.ParseResponseDataForFeeds(json, { skipCreatorOnTheRise: true })
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
feeds: feeds
|
feeds: feeds
|
||||||
|
|||||||
@@ -115,7 +115,20 @@ namespace Innertube
|
|||||||
return nodeData["contents"]
|
return nodeData["contents"]
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function ParseShelfRenderer(nodeData as object, _context as object) as object
|
function ParseShelfRenderer(nodeData as object, context as object) as object
|
||||||
|
if context.skipCreatorOnTheRise = true
|
||||||
|
badges = nodeData["badges"]
|
||||||
|
if IsArray(badges)
|
||||||
|
for each badge in badges
|
||||||
|
if ValidString(ObjectUtils.Dig(badge, ["metadataBadgeRenderer", "style"])) = "BADGE_STYLE_TYPE_FEATURED"
|
||||||
|
label = ParseText(ObjectUtils.Dig(badge, ["metadataBadgeRenderer", "label"]))
|
||||||
|
LogInfo(`Skipping 'Create on the Rise' shelf (${label})`)
|
||||||
|
return invalid
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
|
||||||
' TODO: handle shelfRenderer.title
|
' TODO: handle shelfRenderer.title
|
||||||
' TODO: handle shelfRenderer.headerRenderer.shelfHeaderRenderer.avatarLockup.avatarLockupRenderer.title
|
' TODO: handle shelfRenderer.headerRenderer.shelfHeaderRenderer.avatarLockup.avatarLockupRenderer.title
|
||||||
return nodeData["content"]
|
return nodeData["content"]
|
||||||
|
|||||||
@@ -442,6 +442,15 @@ namespace Invidious
|
|||||||
|
|
||||||
if response.StatusCode() = 200
|
if response.StatusCode() = 200
|
||||||
json = response.Json()
|
json = response.Json()
|
||||||
|
' Courses are not yet implemented in Invidious.
|
||||||
|
' In this case, Invidious returns 200, but the response is empty.
|
||||||
|
' https://github.com/iv-org/invidious/issues/5088
|
||||||
|
if json = invalid
|
||||||
|
json = {
|
||||||
|
playlists: []
|
||||||
|
}
|
||||||
|
end if
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items: json.playlists
|
items: json.playlists
|
||||||
continuation: json.continuation
|
continuation: json.continuation
|
||||||
|
|||||||
@@ -82,6 +82,12 @@ namespace InvidiousContent
|
|||||||
childCount = node.getChildCount()
|
childCount = node.getChildCount()
|
||||||
newNodes = []
|
newNodes = []
|
||||||
for each video in item.videos
|
for each video in item.videos
|
||||||
|
' TODO:P1 sometimes we're parsing "recommended playlists" that
|
||||||
|
' show up in the end of the playlist. We should ignore them,
|
||||||
|
' until the parsing is fixed.
|
||||||
|
if ValidString(video.type) = "playlist"
|
||||||
|
continue for
|
||||||
|
end if
|
||||||
video.type = "video"
|
video.type = "video"
|
||||||
videoNode = ToVideoContentNode(invalid, video, instance)
|
videoNode = ToVideoContentNode(invalid, video, instance)
|
||||||
if videoNode <> invalid
|
if videoNode <> invalid
|
||||||
|
|||||||
+59
-8
@@ -180,6 +180,7 @@ namespace Http
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
@get("/playlet-invidious-backend/api/v1/trending")
|
@get("/playlet-invidious-backend/api/v1/trending")
|
||||||
|
@get("/playlet-invidious-backend/api/v1/popular")
|
||||||
function GetTrending(context as object) as boolean
|
function GetTrending(context as object) as boolean
|
||||||
request = context.request
|
request = context.request
|
||||||
response = context.response
|
response = context.response
|
||||||
@@ -207,13 +208,6 @@ namespace Http
|
|||||||
return true
|
return true
|
||||||
end function
|
end function
|
||||||
|
|
||||||
@get("/playlet-invidious-backend/api/v1/popular")
|
|
||||||
function GetPopular(context as object) as boolean
|
|
||||||
response = context.response
|
|
||||||
response.Redirect("/playlet-invidious-backend/api/v1/trending")
|
|
||||||
return true
|
|
||||||
end function
|
|
||||||
|
|
||||||
@get("/playlet-invidious-backend/api/v1/search/suggestions")
|
@get("/playlet-invidious-backend/api/v1/search/suggestions")
|
||||||
function GetSearchSuggestions(context as object) as boolean
|
function GetSearchSuggestions(context as object) as boolean
|
||||||
request = context.request
|
request = context.request
|
||||||
@@ -385,6 +379,8 @@ namespace Http
|
|||||||
return m.GetPlaylist(context)
|
return m.GetPlaylist(context)
|
||||||
else if route.StartsWith("/playlet-invidious-backend/api/v1/channels/")
|
else if route.StartsWith("/playlet-invidious-backend/api/v1/channels/")
|
||||||
return m.GetChannel(context)
|
return m.GetChannel(context)
|
||||||
|
else if route.StartsWith("/playlet-invidious-backend/channel")
|
||||||
|
return m.RedirectChannel(context)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
return false
|
return false
|
||||||
@@ -500,7 +496,7 @@ namespace Http
|
|||||||
return true
|
return true
|
||||||
end if
|
end if
|
||||||
|
|
||||||
if _tab = "playlists" or _tab = "podcasts" or _tab = "releases"
|
if _tab = "playlists" or _tab = "podcasts" or _tab = "releases" or _tab = "courses"
|
||||||
result = {
|
result = {
|
||||||
"playlists": channel.items
|
"playlists": channel.items
|
||||||
}
|
}
|
||||||
@@ -529,6 +525,61 @@ namespace Http
|
|||||||
|
|
||||||
return false
|
return false
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
@get("/playlet-invidious-backend/watch")
|
||||||
|
function RedirectWatch(context as object) as boolean
|
||||||
|
request = context.request
|
||||||
|
response = context.response
|
||||||
|
|
||||||
|
videoId = request.query.v
|
||||||
|
if StringUtils.IsNullOrEmpty(videoId)
|
||||||
|
response.Json({
|
||||||
|
"error": "Missing 'v' query parameter"
|
||||||
|
})
|
||||||
|
response.http_code = 400
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
|
||||||
|
response.Redirect(`https://redirect.invidious.io/watch?v=${videoId}`)
|
||||||
|
return true
|
||||||
|
end function
|
||||||
|
|
||||||
|
@get("/playlet-invidious-backend/playlist")
|
||||||
|
function RedirectPlaylist(context as object) as boolean
|
||||||
|
request = context.request
|
||||||
|
response = context.response
|
||||||
|
|
||||||
|
playlistId = request.query.list
|
||||||
|
if StringUtils.IsNullOrEmpty(playlistId)
|
||||||
|
response.Json({
|
||||||
|
"error": "Missing 'list' query parameter"
|
||||||
|
})
|
||||||
|
response.http_code = 400
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
|
||||||
|
response.Redirect(`https://redirect.invidious.io/playlist?list=${playlistId}`)
|
||||||
|
return true
|
||||||
|
end function
|
||||||
|
|
||||||
|
function RedirectChannel(context as object) as boolean
|
||||||
|
request = context.request
|
||||||
|
response = context.response
|
||||||
|
route = request.route
|
||||||
|
|
||||||
|
channelId = route.Mid("/playlet-invidious-backend/channel/".Len())
|
||||||
|
if StringUtils.IsNullOrEmpty(channelId)
|
||||||
|
response.Json({
|
||||||
|
"error": "Missing 'channelId' path parameter"
|
||||||
|
})
|
||||||
|
response.http_code = 400
|
||||||
|
return true
|
||||||
|
end if
|
||||||
|
|
||||||
|
response.Redirect(`https://redirect.invidious.io/channel/${channelId}`)
|
||||||
|
return true
|
||||||
|
end function
|
||||||
|
|
||||||
end class
|
end class
|
||||||
|
|
||||||
end namespace
|
end namespace
|
||||||
@@ -166,6 +166,14 @@ channel_releases:
|
|||||||
paginationType: Continuation
|
paginationType: Continuation
|
||||||
tryCount: 3
|
tryCount: 3
|
||||||
|
|
||||||
|
# This is implemented only by Playlet backend.
|
||||||
|
channel_courses:
|
||||||
|
title: Channel courses
|
||||||
|
url: /api/v1/channels/{ucid}/courses
|
||||||
|
responseHandler: ChannelPlaylistsHandler
|
||||||
|
paginationType: Continuation
|
||||||
|
tryCount: 3
|
||||||
|
|
||||||
# This is implemented only by Playlet backend.
|
# This is implemented only by Playlet backend.
|
||||||
# Created because auto-generated channels don't have tabs except for "featured"
|
# Created because auto-generated channels don't have tabs except for "featured"
|
||||||
channel_featured:
|
channel_featured:
|
||||||
|
|||||||
@@ -36,6 +36,10 @@
|
|||||||
<source>OK</source>
|
<source>OK</source>
|
||||||
<translation>OK</translation>
|
<translation>OK</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Do not show again</source>
|
||||||
|
<translation>Do not show again</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Activate</source>
|
<source>Activate</source>
|
||||||
<translation>Activate</translation>
|
<translation>Activate</translation>
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ 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=35
|
minor_version=36
|
||||||
build_version=00004
|
build_version=00000
|
||||||
|
|
||||||
ui_resolutions=hd
|
ui_resolutions=hd
|
||||||
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
uri_resolution_autosub=$$RES$$,480p,720p,1080p
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace Locale
|
|||||||
@locale
|
@locale
|
||||||
enum Buttons
|
enum Buttons
|
||||||
OK = "OK"
|
OK = "OK"
|
||||||
|
DotNotShowAgain = "Do not show again"
|
||||||
Activate = "Activate"
|
Activate = "Activate"
|
||||||
InUse = "In Use"
|
InUse = "In Use"
|
||||||
Login = "Login"
|
Login = "Login"
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace RegistryUtils
|
|||||||
const SEARCH_HISTORY = "search_history"
|
const SEARCH_HISTORY = "search_history"
|
||||||
const PLAYLET_LIB_URLS = "playlet_lib_urls"
|
const PLAYLET_LIB_URLS = "playlet_lib_urls"
|
||||||
const BOOKMARKS = "bookmarks"
|
const BOOKMARKS = "bookmarks"
|
||||||
|
const MESSAGES = "messages"
|
||||||
|
|
||||||
const LAST_LOUNGE_DATA = "last_lounge_data"
|
const LAST_LOUNGE_DATA = "last_lounge_data"
|
||||||
|
|
||||||
|
|||||||
Generated
+521
-1099
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "playlet-web",
|
"name": "playlet-web",
|
||||||
"version": "0.35.4",
|
"version": "0.36.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -9,23 +9,23 @@
|
|||||||
"check": "svelte-check --tsconfig ./tsconfig.json"
|
"check": "svelte-check --tsconfig ./tsconfig.json"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "3.1.2",
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||||
"@tailwindcss/typography": "^0.5.15",
|
"@tailwindcss/typography": "^0.5.16",
|
||||||
"@tsconfig/svelte": "^5.0.4",
|
"@tsconfig/svelte": "^5.0.4",
|
||||||
"@vitejs/plugin-legacy": "^5.4.3",
|
"@vitejs/plugin-legacy": "^6.0.0",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"daisyui": "^4.12.23",
|
"daisyui": "^4.12.23",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
"ip": "^2.0.1",
|
"ip": "^2.0.1",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
"svelte": "4.2.19",
|
"svelte": "^5.17.3",
|
||||||
"svelte-check": "^4.1.1",
|
"svelte-check": "^4.1.3",
|
||||||
"svelte-preprocess": "^6.0.3",
|
"svelte-preprocess": "^6.0.3",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"terser": "^5.37.0",
|
"terser": "^5.37.0",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.7.2",
|
"typescript": "^5.7.3",
|
||||||
"vite": "^5.4.11",
|
"vite": "^6.0.7",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-tsconfig-paths": "^5.1.4"
|
"vite-tsconfig-paths": "^5.1.4"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { tr } from "lib/Stores";
|
import { translate } from "lib/Stores";
|
||||||
import { PlayletApi } from "./PlayletApi";
|
import { PlayletApi } from "./PlayletApi";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
|
|
||||||
@@ -31,14 +31,14 @@ export async function fetchLocale(locale: string) {
|
|||||||
}
|
}
|
||||||
translations[source[0].textContent] = translation[0].textContent;
|
translations[source[0].textContent] = translation[0].textContent;
|
||||||
}
|
}
|
||||||
tr.set((s) => translations[s] || s);
|
translate.set((s) => translations[s] || s);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getPluralString(c: number, zeroString: string, oneString: string, pluralString: string) {
|
export function getPluralString(c: number, zeroString: string, oneString: string, pluralString: string) {
|
||||||
const trFn = get(tr);
|
const trFn = get(translate);
|
||||||
|
|
||||||
c = c || 0;
|
c = c || 0;
|
||||||
if (c === 0) {
|
if (c === 0) {
|
||||||
@@ -51,7 +51,7 @@ export function getPluralString(c: number, zeroString: string, oneString: string
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getFormattedPluralString(c: number, zeroString: string, oneString: string, pluralString: string) {
|
export function getFormattedPluralString(c: number, zeroString: string, oneString: string, pluralString: string) {
|
||||||
const trFn = get(tr);
|
const trFn = get(translate);
|
||||||
|
|
||||||
c = c || 0;
|
c = c || 0;
|
||||||
if (c === 0) {
|
if (c === 0) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
import BookmarksIcon from "../assets/star-icon.svg.svelte";
|
import BookmarksIcon from "../assets/star-icon.svg.svelte";
|
||||||
import RemoteIcon from "../assets/remote-control.svg.svelte";
|
import RemoteIcon from "../assets/remote-control.svg.svelte";
|
||||||
|
|
||||||
import { appStateStore, tr } from "lib/Stores";
|
import { appStateStore, translate } from "lib/Stores";
|
||||||
import { ScreenNames, type AppState } from "lib/Types";
|
import { ScreenNames, type AppState } from "lib/Types";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<div class="h-6">
|
<div class="h-6">
|
||||||
<SearchIcon />
|
<SearchIcon />
|
||||||
</div>
|
</div>
|
||||||
<span class="text-xs">{$tr("Search")}</span>
|
<span class="text-xs">{$translate("Search")}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => setScreen("home")}
|
on:click={() => setScreen("home")}
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<div class="h-6">
|
<div class="h-6">
|
||||||
<HomeIcon />
|
<HomeIcon />
|
||||||
</div>
|
</div>
|
||||||
<span class="text-xs">{$tr("Home")}</span>
|
<span class="text-xs">{$translate("Home")}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => setScreen("bookmarks")}
|
on:click={() => setScreen("bookmarks")}
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
<div class="h-6">
|
<div class="h-6">
|
||||||
<BookmarksIcon />
|
<BookmarksIcon />
|
||||||
</div>
|
</div>
|
||||||
<span class="text-xs">{$tr("Bookmarks")}</span>
|
<span class="text-xs">{$translate("Bookmarks")}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => setScreen("settings")}
|
on:click={() => setScreen("settings")}
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
<div class="h-6">
|
<div class="h-6">
|
||||||
<SettingsIcon />
|
<SettingsIcon />
|
||||||
</div>
|
</div>
|
||||||
<span class="text-xs">{$tr("Settings")}</span>
|
<span class="text-xs">{$translate("Settings")}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => setScreen("remote")}
|
on:click={() => setScreen("remote")}
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<div class="h-6">
|
<div class="h-6">
|
||||||
<RemoteIcon />
|
<RemoteIcon />
|
||||||
</div>
|
</div>
|
||||||
<span class="text-xs">{$tr("Remote")}</span>
|
<span class="text-xs">{$translate("Remote")}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
on:click={() => setScreen("info")}
|
on:click={() => setScreen("info")}
|
||||||
@@ -102,6 +102,6 @@
|
|||||||
<div class="h-6">
|
<div class="h-6">
|
||||||
<InfoIcon />
|
<InfoIcon />
|
||||||
</div>
|
</div>
|
||||||
<span class="text-xs">{$tr("Info")}</span>
|
<span class="text-xs">{$translate("Info")}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onDestroy, onMount } from "svelte";
|
import { onDestroy, onMount } from "svelte";
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
||||||
import { PlayletApi } from "./Api/PlayletApi";
|
import { PlayletApi } from "./Api/PlayletApi";
|
||||||
import VideoCastDialog from "./VideoFeed/VideoCastDialog.svelte";
|
import VideoCastDialog from "./VideoFeed/VideoCastDialog.svelte";
|
||||||
@@ -248,9 +248,11 @@
|
|||||||
: 'hidden'} fixed w-full h-full bg-base-100/80 z-50 flex justify-center items-center"
|
: 'hidden'} fixed w-full h-full bg-base-100/80 z-50 flex justify-center items-center"
|
||||||
>
|
>
|
||||||
{#if isDragging}
|
{#if isDragging}
|
||||||
<div class="text-2xl font-bold">{$tr("Drop a YouTube link here")}</div>
|
<div class="text-2xl font-bold">
|
||||||
|
{$translate("Drop a YouTube link here")}
|
||||||
|
</div>
|
||||||
{:else if isLoading}
|
{:else if isLoading}
|
||||||
<span class="loading loading-spinner loading-md" />
|
<span class="loading loading-spinner loading-md"></span>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
import { PlayletApi } from "./Api/PlayletApi";
|
import { PlayletApi } from "./Api/PlayletApi";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
<dialog bind:this={modal} class="modal" on:close={onClose}>
|
<dialog bind:this={modal} class="modal" on:close={onClose}>
|
||||||
<form method="dialog" class="modal-box bg-base-100">
|
<form method="dialog" class="modal-box bg-base-100">
|
||||||
<div class="flex flex-col items-center">
|
<div class="flex flex-col items-center">
|
||||||
<div class="text-xl font-medium m-4">{$tr("Profiles")}</div>
|
<div class="text-xl font-medium m-4">{$translate("Profiles")}</div>
|
||||||
|
|
||||||
{#each profiles as profile}
|
{#each profiles as profile}
|
||||||
<div class="collapse collapse-arrow bg-base-300 m-1">
|
<div class="collapse collapse-arrow bg-base-300 m-1">
|
||||||
@@ -112,12 +112,12 @@
|
|||||||
{#if profile.id !== currentProfile?.id}
|
{#if profile.id !== currentProfile?.id}
|
||||||
<button
|
<button
|
||||||
on:click={() => activate(profile.id)}
|
on:click={() => activate(profile.id)}
|
||||||
class="btn btn-primary m-1">{$tr("Activate")}</button
|
class="btn btn-primary m-1">{$translate("Activate")}</button
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
<button
|
<button
|
||||||
on:click={() => logout(profile.id)}
|
on:click={() => logout(profile.id)}
|
||||||
class="btn btn-primary m-1">{$tr("Logout")}</button
|
class="btn btn-primary m-1">{$translate("Logout")}</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -125,15 +125,15 @@
|
|||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<button class="btn btn-primary" on:click={login}>
|
<button class="btn btn-primary" on:click={login}>
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="text-m">{$tr("Login to Invidious")}</div>
|
<div class="text-m">{$translate("Login to Invidious")}</div>
|
||||||
<div class="text-xs font-light">{currentInstance}</div>
|
<div class="text-xs font-light">{currentInstance}</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn m-6">{$tr("Close")}</button>
|
<button class="btn m-6">{$translate("Close")}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<form method="dialog" class="modal-backdrop">
|
<form method="dialog" class="modal-backdrop">
|
||||||
<button>{$tr("Close")}</button>
|
<button>{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import VideoListRow from "lib/VideoFeed/VideoListRow.svelte";
|
import VideoListRow from "lib/VideoFeed/VideoListRow.svelte";
|
||||||
import { bookmarksStore, tr } from "lib/Stores";
|
import { bookmarksStore, translate } from "lib/Stores";
|
||||||
|
|
||||||
export let visibility: boolean;
|
export let visibility: boolean;
|
||||||
</script>
|
</script>
|
||||||
@@ -10,13 +10,15 @@
|
|||||||
<div
|
<div
|
||||||
class="flex flex-col items-center justify-start h-screen w-2/3 mx-auto"
|
class="flex flex-col items-center justify-start h-screen w-2/3 mx-auto"
|
||||||
>
|
>
|
||||||
<div class="text-2xl font-bold text-gray-500">{$tr("No Bookmarks")}</div>
|
<div class="text-2xl font-bold text-gray-500">
|
||||||
|
{$translate("No Bookmarks")}
|
||||||
|
</div>
|
||||||
<div class="text-gray-500 text-center">
|
<div class="text-gray-500 text-center">
|
||||||
{$tr("You currently have no bookmarks.")}<br />
|
{$translate("You currently have no bookmarks.")}<br />
|
||||||
{$tr(
|
{$translate(
|
||||||
"To add bookmarks, select a video, playlist or channel, and add a bookmark."
|
"To add bookmarks, select a video, playlist or channel, and add a bookmark."
|
||||||
)}<br />
|
)}<br />
|
||||||
{$tr("Please note that Bookmarks is an experimental feature.")}
|
{$translate("Please note that Bookmarks is an experimental feature.")}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { getHost } from "lib/Api/Host";
|
import { getHost } from "lib/Api/Host";
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
|
|
||||||
export let visibility: boolean;
|
export let visibility: boolean;
|
||||||
|
|
||||||
@@ -164,9 +164,9 @@ ${JSON.stringify(profilesInfo, null, 2)}
|
|||||||
|
|
||||||
<div class={visibility ? "" : "hidden"}>
|
<div class={visibility ? "" : "hidden"}>
|
||||||
<div class="text-base text-center m-8">
|
<div class="text-base text-center m-8">
|
||||||
{$tr("Thank you for using Playlet.")}
|
{$translate("Thank you for using Playlet.")}
|
||||||
<br />
|
<br />
|
||||||
{@html $tr(feedbackMessageRaw)
|
{@html $translate(feedbackMessageRaw)
|
||||||
.replace(
|
.replace(
|
||||||
"%IssueStart%",
|
"%IssueStart%",
|
||||||
`<a class="link" href="${githubUrlIssue}" target="_blank" rel="noopener noreferrer">`
|
`<a class="link" href="${githubUrlIssue}" target="_blank" rel="noopener noreferrer">`
|
||||||
@@ -194,11 +194,9 @@ ${JSON.stringify(profilesInfo, null, 2)}
|
|||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
||||||
<thead>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>App internal state</th>
|
<th>App internal state</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
|
||||||
|
|
||||||
{#each internalStateLinks as item}
|
{#each internalStateLinks as item}
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { tr } from "lib/Stores";
|
import { translate } from "lib/Stores";
|
||||||
|
|
||||||
let modal;
|
let modal;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
modal.close();
|
modal.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
export let label = $tr("Filters");
|
export let label = $translate("Filters");
|
||||||
|
|
||||||
export const filters = {
|
export const filters = {
|
||||||
date: "",
|
date: "",
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
count += filters.features.length;
|
count += filters.features.length;
|
||||||
count += filters.sort ? 1 : 0;
|
count += filters.sort ? 1 : 0;
|
||||||
|
|
||||||
label = $tr("Filters") + `${count > 0 ? ` (${count})` : ""}`;
|
label = $translate("Filters") + `${count > 0 ? ` (${count})` : ""}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
@@ -181,37 +181,37 @@
|
|||||||
<h2 class="text-xl font-bold mb-4">{label}</h2>
|
<h2 class="text-xl font-bold mb-4">{label}</h2>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h3 class="text-lg font-bold mb-2">{$tr("Upload date")}</h3>
|
<h3 class="text-lg font-bold mb-2">{$translate("Upload date")}</h3>
|
||||||
<select class="input input-bordered w-full" bind:value={filters.date}>
|
<select class="input input-bordered w-full" bind:value={filters.date}>
|
||||||
{#each options.date as { title, value }}
|
{#each options.date as { title, value }}
|
||||||
<option {value}>{$tr(title)}</option>
|
<option {value}>{$translate(title)}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h3 class="text-lg font-bold mb-2">{$tr("Type")}</h3>
|
<h3 class="text-lg font-bold mb-2">{$translate("Type")}</h3>
|
||||||
<select class="input input-bordered w-full" bind:value={filters.type}>
|
<select class="input input-bordered w-full" bind:value={filters.type}>
|
||||||
{#each options.type as { title, value }}
|
{#each options.type as { title, value }}
|
||||||
<option {value}>{$tr(title)}</option>
|
<option {value}>{$translate(title)}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h3 class="text-lg font-bold mb-2">{$tr("Duration")}</h3>
|
<h3 class="text-lg font-bold mb-2">{$translate("Duration")}</h3>
|
||||||
<select
|
<select
|
||||||
class="input input-bordered w-full"
|
class="input input-bordered w-full"
|
||||||
bind:value={filters.duration}
|
bind:value={filters.duration}
|
||||||
>
|
>
|
||||||
{#each options.duration as { title, value }}
|
{#each options.duration as { title, value }}
|
||||||
<option {value}>{$tr(title)}</option>
|
<option {value}>{$translate(title)}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h3 class="text-lg font-bold mb-2">{$tr("Features")}</h3>
|
<h3 class="text-lg font-bold mb-2">{$translate("Features")}</h3>
|
||||||
{#each options.features as { title, value }}
|
{#each options.features as { title, value }}
|
||||||
<label class="flex items-center">
|
<label class="flex items-center">
|
||||||
<input
|
<input
|
||||||
@@ -220,26 +220,26 @@
|
|||||||
class="form-checkbox"
|
class="form-checkbox"
|
||||||
bind:checked={features_kv[value]}
|
bind:checked={features_kv[value]}
|
||||||
/>
|
/>
|
||||||
<span class="ml-2">{$tr(title)}</span>
|
<span class="ml-2">{$translate(title)}</span>
|
||||||
</label>
|
</label>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h3 class="text-lg font-bold mb-2">{$tr("Sort by")}</h3>
|
<h3 class="text-lg font-bold mb-2">{$translate("Sort by")}</h3>
|
||||||
<select class="input input-bordered w-full" bind:value={filters.sort}>
|
<select class="input input-bordered w-full" bind:value={filters.sort}>
|
||||||
{#each options.sort as { title, value }}
|
{#each options.sort as { title, value }}
|
||||||
<option {value}>{$tr(title)}</option>
|
<option {value}>{$translate(title)}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
<button class="btn btn-outline">{$tr("Close")}</button>
|
<button class="btn btn-outline">{$translate("Close")}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<form method="dialog" class="modal-backdrop">
|
<form method="dialog" class="modal-backdrop">
|
||||||
<button>{$tr("Close")}</button>
|
<button>{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { playletStateStore, searchHistoryStore, tr } from "lib/Stores";
|
import { playletStateStore, searchHistoryStore, translate } from "lib/Stores";
|
||||||
import VideoCell from "lib/VideoFeed/VideoCell.svelte";
|
import VideoCell from "lib/VideoFeed/VideoCell.svelte";
|
||||||
import PlaylistCell from "lib/VideoFeed/PlaylistCell.svelte";
|
import PlaylistCell from "lib/VideoFeed/PlaylistCell.svelte";
|
||||||
import ChannelCell from "lib/VideoFeed/ChannelCell.svelte";
|
import ChannelCell from "lib/VideoFeed/ChannelCell.svelte";
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
<input
|
<input
|
||||||
type="search"
|
type="search"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
placeholder="{$tr('Search')}..."
|
placeholder="{$translate('Search')}..."
|
||||||
class="join-item input w-full border border-neutral rounded-full"
|
class="join-item input w-full border border-neutral rounded-full"
|
||||||
bind:this={searchBox}
|
bind:this={searchBox}
|
||||||
bind:value={searchBoxText}
|
bind:value={searchBoxText}
|
||||||
@@ -213,14 +213,14 @@
|
|||||||
await searchVideos(searchContinuation);
|
await searchVideos(searchContinuation);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{$tr("Load more")}
|
{$translate("Load more")}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if isLoading}
|
{#if isLoading}
|
||||||
<div class="w-full h-1/2 z-50 flex justify-center items-center">
|
<div class="w-full h-1/2 z-50 flex justify-center items-center">
|
||||||
<span class="loading loading-spinner loading-md" />
|
<span class="loading loading-spinner loading-md"></span>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { tr, userPreferencesStore } from "lib/Stores";
|
import { translate, userPreferencesStore } from "lib/Stores";
|
||||||
|
|
||||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<div class="form-control m-5">
|
<div class="form-control m-5">
|
||||||
<label class="label p-0 cursor-pointer">
|
<label class="label p-0 cursor-pointer">
|
||||||
<div class="label-text {textSizes[level]}">{$tr(displayText)}</div>
|
<div class="label-text {textSizes[level]}">{$translate(displayText)}</div>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name={key}
|
name={key}
|
||||||
@@ -32,5 +32,5 @@
|
|||||||
class="checkbox"
|
class="checkbox"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { tr } from "lib/Stores";
|
import { translate } from "lib/Stores";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
|
|
||||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||||
@@ -16,12 +16,14 @@
|
|||||||
await PlayletApi.clearCache();
|
await PlayletApi.clearCache();
|
||||||
InvidiousApi.clearCache();
|
InvidiousApi.clearCache();
|
||||||
|
|
||||||
alert(get(tr)("Cache cleared."));
|
alert(get(translate)("Cache cleared."));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||||
<button class="btn m-1" on:click={clearCache}>{$tr("Clear cache")}</button>
|
<button class="btn m-1" on:click={clearCache}
|
||||||
|
>{$translate("Clear cache")}</button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { searchHistoryStore, tr } from "lib/Stores";
|
import { searchHistoryStore, translate } from "lib/Stores";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
|
|
||||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||||
@@ -15,14 +15,14 @@
|
|||||||
await PlayletApi.clearSearchHistory();
|
await PlayletApi.clearSearchHistory();
|
||||||
searchHistoryStore.set([]);
|
searchHistoryStore.set([]);
|
||||||
|
|
||||||
alert(get(tr)("Search history cleared."));
|
alert(get(translate)("Search history cleared."));
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||||
<button class="btn m-1" on:click={clearSeachHistory}
|
<button class="btn m-1" on:click={clearSeachHistory}
|
||||||
>{$tr("Clear search history")}</button
|
>{$translate("Clear search history")}</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import {
|
import {
|
||||||
homeLayoutFileStore,
|
homeLayoutFileStore,
|
||||||
homeLayoutStore,
|
homeLayoutStore,
|
||||||
tr,
|
translate,
|
||||||
userPreferencesStore,
|
userPreferencesStore,
|
||||||
} from "lib/Stores";
|
} from "lib/Stores";
|
||||||
import ArrowUpIcon from "assets/remote-control/arrow-up.svg.svelte";
|
import ArrowUpIcon from "assets/remote-control/arrow-up.svg.svelte";
|
||||||
@@ -89,10 +89,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||||
<button class="btn m-1" on:click={openHomeScreenEditor}
|
<button class="btn m-1" on:click={openHomeScreenEditor}
|
||||||
>{$tr("Edit home screen")}</button
|
>{$translate("Edit home screen")}</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -100,6 +100,7 @@
|
|||||||
<div class="modal-box bg-base-100">
|
<div class="modal-box bg-base-100">
|
||||||
{#if value && homeLayout}
|
{#if value && homeLayout}
|
||||||
<table class="w-full">
|
<table class="w-full">
|
||||||
|
<tbody>
|
||||||
{#each value as item, i (i)}
|
{#each value as item, i (i)}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@@ -115,7 +116,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label class="label p-0 cursor-pointer">
|
<label class="label p-0 cursor-pointer">
|
||||||
<div class="label-text">{$tr(homeLayout[item.id].title)}</div>
|
<div class="label-text">
|
||||||
|
{$translate(homeLayout[item.id].title)}
|
||||||
|
</div>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
name={item.id}
|
name={item.id}
|
||||||
@@ -137,14 +140,17 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<form method="dialog" class="flex justify-center space-x-2">
|
<form method="dialog" class="flex justify-center space-x-2">
|
||||||
<button class="btn btn-primary" on:click={save}>{$tr("Save")}</button>
|
<button class="btn btn-primary" on:click={save}
|
||||||
<button class="btn btn-primary">{$tr("Close")}</button>
|
>{$translate("Save")}</button
|
||||||
|
>
|
||||||
|
<button class="btn btn-primary">{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<form method="dialog" class="modal-backdrop">
|
<form method="dialog" class="modal-backdrop">
|
||||||
<button>{$tr("Close")}</button>
|
<button>{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { tr, userPreferencesStore } from "lib/Stores";
|
import { translate, userPreferencesStore } from "lib/Stores";
|
||||||
|
|
||||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||||
const qualityLabels = {
|
const qualityLabels = {
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
}, {});
|
}, {});
|
||||||
displayValue = originalValue
|
displayValue = originalValue
|
||||||
.split(",")
|
.split(",")
|
||||||
.map((item) => $tr(qualityLabels[item] || item))
|
.map((item) => $translate(qualityLabels[item] || item))
|
||||||
.join(", ");
|
.join(", ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,20 +117,21 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||||
<button class="btn m-1" on:click={openQualitySelector}>{displayValue}</button>
|
<button class="btn m-1" on:click={openQualitySelector}>{displayValue}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<dialog bind:this={modal} class="modal" on:close={onClose}>
|
<dialog bind:this={modal} class="modal" on:close={onClose}>
|
||||||
<div class="modal-box bg-base-100">
|
<div class="modal-box bg-base-100">
|
||||||
<table class="w-full">
|
<table class="w-full">
|
||||||
|
<tbody>
|
||||||
{#each Object.keys(qualityLabels) as quality}
|
{#each Object.keys(qualityLabels) as quality}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label class="label p-0 cursor-pointer">
|
<label class="label p-0 cursor-pointer">
|
||||||
<div class="label-text text-lg">
|
<div class="label-text text-lg">
|
||||||
{$tr(qualityLabels[quality])}
|
{$translate(qualityLabels[quality])}
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -142,13 +143,16 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<form method="dialog" class="flex justify-center space-x-2">
|
<form method="dialog" class="flex justify-center space-x-2">
|
||||||
<button class="btn btn-primary" on:click={save}>{$tr("Save")}</button>
|
<button class="btn btn-primary" on:click={save}
|
||||||
<button class="btn btn-primary">{$tr("Close")}</button>
|
>{$translate("Save")}</button
|
||||||
|
>
|
||||||
|
<button class="btn btn-primary">{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<form method="dialog" class="modal-backdrop">
|
<form method="dialog" class="modal-backdrop">
|
||||||
<button>{$tr("Close")}</button>
|
<button>{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { tr, userPreferencesStore } from "lib/Stores";
|
import { translate, userPreferencesStore } from "lib/Stores";
|
||||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||||
export let displayText: string = "";
|
export let displayText: string = "";
|
||||||
export let key: string = "";
|
export let key: string = "";
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<div class="form-control m-5">
|
<div class="form-control m-5">
|
||||||
<label class="label p-0 cursor-pointer">
|
<label class="label p-0 cursor-pointer">
|
||||||
<div class="label-text {textSizes[level]}">{$tr(displayText)}</div>
|
<div class="label-text {textSizes[level]}">{$translate(displayText)}</div>
|
||||||
<div class="join mt-2 mb-2">
|
<div class="join mt-2 mb-2">
|
||||||
<button
|
<button
|
||||||
class="join-item btn btn-sm btn-primary"
|
class="join-item btn btn-sm btn-primary"
|
||||||
@@ -52,5 +52,5 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||||
</div>
|
</div>
|
||||||
+7
-6
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
import { ExternalControlProtocol } from "lib/Api/ExternalControlProtocol";
|
import { ExternalControlProtocol } from "lib/Api/ExternalControlProtocol";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
version = "latest";
|
version = "latest";
|
||||||
}
|
}
|
||||||
|
|
||||||
const trFn = get(tr);
|
const trFn = get(translate);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
confirm(
|
confirm(
|
||||||
@@ -100,9 +100,9 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<div class="text-lg">{$tr("Playlet Library version")}</div>
|
<div class="text-lg">{$translate("Playlet Library version")}</div>
|
||||||
<div class="text-xs text-gray-500">
|
<div class="text-xs text-gray-500">
|
||||||
{$tr(
|
{$translate(
|
||||||
"The version of Playlet Lib to use. These correspond to tagged releases on Github. Releases that do not have a playlet-lib.zip file are disabled."
|
"The version of Playlet Lib to use. These correspond to tagged releases on Github. Releases that do not have a playlet-lib.zip file are disabled."
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -112,13 +112,14 @@
|
|||||||
bind:value={selectedRelease}
|
bind:value={selectedRelease}
|
||||||
class="select select-bordered join-item w-full mr-1"
|
class="select select-bordered join-item w-full mr-1"
|
||||||
>
|
>
|
||||||
<option selected value="">{$tr("Latest (default)")}</option>
|
<option selected value="">{$translate("Latest (default)")}</option>
|
||||||
{#each releases as release}
|
{#each releases as release}
|
||||||
<option disabled={!release.enabled} value={release.name}
|
<option disabled={!release.enabled} value={release.name}
|
||||||
>{release.name}</option
|
>{release.name}</option
|
||||||
>
|
>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</select>
|
||||||
<button class="join-item btn" on:click={apply}>{$tr("Apply")}</button>
|
<button class="join-item btn" on:click={apply}>{$translate("Apply")}</button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { tr, userPreferencesStore } from "lib/Stores";
|
import { translate, userPreferencesStore } from "lib/Stores";
|
||||||
|
|
||||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||||
|
|
||||||
@@ -24,13 +24,13 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||||
<div class="text-xs text-gray-500">{@html $tr(description)}</div>
|
<div class="text-xs text-gray-500">{@html $translate(description)}</div>
|
||||||
|
|
||||||
{#each options as option}
|
{#each options as option}
|
||||||
<div class="form-control">
|
<div class="form-control">
|
||||||
<label class="label cursor-pointer">
|
<label class="label cursor-pointer">
|
||||||
<span class="label-text">{$tr(option.displayText)}</span>
|
<span class="label-text">{$translate(option.displayText)}</span>
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
name={key}
|
name={key}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { tr, userPreferencesStore } from "lib/Stores";
|
import { translate, userPreferencesStore } from "lib/Stores";
|
||||||
|
|
||||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||||
const invidiousPublicInstancesLink = `<a class="link" href="https://api.invidious.io" target="_blank" rel="noopener noreferrer">https://api.invidious.io</a>`;
|
const invidiousPublicInstancesLink = `<a class="link" href="https://api.invidious.io" target="_blank" rel="noopener noreferrer">https://api.invidious.io</a>`;
|
||||||
@@ -27,10 +27,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||||
<div class="text-xs text-gray-500">
|
<div class="text-xs text-gray-500">
|
||||||
<!-- TODO:P2 this should not be hardcoded here -->
|
<!-- TODO:P2 this should not be hardcoded here -->
|
||||||
{@html $tr(description).replace(
|
{@html $translate(description).replace(
|
||||||
"%INVIDIOUS_PUBLIC_INSTANCES%",
|
"%INVIDIOUS_PUBLIC_INSTANCES%",
|
||||||
invidiousPublicInstancesLink
|
invidiousPublicInstancesLink
|
||||||
)}
|
)}
|
||||||
@@ -45,7 +45,8 @@
|
|||||||
class="join-item input w-full mr-1"
|
class="join-item input w-full mr-1"
|
||||||
/>
|
/>
|
||||||
{#if inputValue !== currentValue}
|
{#if inputValue !== currentValue}
|
||||||
<button class="join-item btn" on:click={save}>{$tr("Save")}</button>
|
<button class="join-item btn" on:click={save}>{$translate("Save")}</button
|
||||||
|
>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
import NumberControl from "./SettingControls/NumberControl.svelte";
|
import NumberControl from "./SettingControls/NumberControl.svelte";
|
||||||
import ClearCacheControl from "./SettingControls/ClearCacheControl.svelte";
|
import ClearCacheControl from "./SettingControls/ClearCacheControl.svelte";
|
||||||
import EditQualityControl from "./SettingControls/EditQualityControl.svelte";
|
import EditQualityControl from "./SettingControls/EditQualityControl.svelte";
|
||||||
import { tr } from "lib/Stores";
|
import { translate } from "lib/Stores";
|
||||||
|
|
||||||
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
const textSizes = ["text-2xl", "text-lg", "text-base", "text-sm", "text-xs"];
|
||||||
|
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="m-5">
|
<div class="m-5">
|
||||||
<div class={textSizes[level]}>{$tr(displayText)}</div>
|
<div class={textSizes[level]}>{$translate(displayText)}</div>
|
||||||
<div class="text-xs text-gray-500">{$tr(description)}</div>
|
<div class="text-xs text-gray-500">{$translate(description)}</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
{#if pref.visibility !== "tv"}
|
{#if pref.visibility !== "tv"}
|
||||||
<SettingsNode {...pref} />
|
<SettingsNode {...pref} />
|
||||||
{#if i !== $preferencesModelStore.length - 1}
|
{#if i !== $preferencesModelStore.length - 1}
|
||||||
<div class="divider" />
|
<div class="divider"></div>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -23,4 +23,4 @@ export const bookmarksStore = writable([] as any);
|
|||||||
|
|
||||||
export const searchHistoryStore = writable([] as any);
|
export const searchHistoryStore = writable([] as any);
|
||||||
|
|
||||||
export const tr = writable((s: string) => s as any);
|
export const translate = writable((s: string) => s as any);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
import ChannelThumbnail from "./ChannelThumbnail.svelte";
|
import ChannelThumbnail from "./ChannelThumbnail.svelte";
|
||||||
|
|
||||||
export let author: string | undefined = undefined;
|
export let author: string | undefined = undefined;
|
||||||
@@ -47,16 +47,18 @@
|
|||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<div class="join join-vertical m-2">
|
<div class="join join-vertical m-2">
|
||||||
<button class="btn join-item hover:btn-accent" on:click={openOnTv}>
|
<button class="btn join-item hover:btn-accent" on:click={openOnTv}>
|
||||||
{$tr("Open on %1").replace("%1", tvName)}
|
{$translate("Open on %1").replace("%1", tvName)}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
||||||
{$tr("Open in Invidious")}
|
{$translate("Open in Invidious")}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent">{$tr("Cancel")}</button>
|
<button class="btn join-item hover:btn-accent"
|
||||||
|
>{$translate("Cancel")}</button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<form method="dialog" class="modal-backdrop">
|
<form method="dialog" class="modal-backdrop">
|
||||||
<button>{$tr("Close")}</button>
|
<button>{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -41,7 +41,12 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button class="w-60 p-2" on:click={modal.show()}>
|
<button
|
||||||
|
class="w-60 p-2"
|
||||||
|
on:click={() => {
|
||||||
|
modal.show();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div class="card card-compact bg-base-100 shadow-xl border border-neutral">
|
<div class="card card-compact bg-base-100 shadow-xl border border-neutral">
|
||||||
<ChannelThumbnail bind:author bind:authorThumbnails />
|
<ChannelThumbnail bind:author bind:authorThumbnails />
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
import PlaylistThumbnail from "./PlaylistThumbnail.svelte";
|
import PlaylistThumbnail from "./PlaylistThumbnail.svelte";
|
||||||
|
|
||||||
export let title: string | undefined = undefined;
|
export let title: string | undefined = undefined;
|
||||||
@@ -102,22 +102,24 @@
|
|||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<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}>
|
||||||
{$tr("Play on %1").replace("%1", tvName)}
|
{$translate("Play on %1").replace("%1", tvName)}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent" on:click={queueOnTv}>
|
<button class="btn join-item hover:btn-accent" on:click={queueOnTv}>
|
||||||
{$tr("Queue on %1").replace("%1", tvName)}
|
{$translate("Queue on %1").replace("%1", tvName)}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent" on:click={openOnTv}>
|
<button class="btn join-item hover:btn-accent" on:click={openOnTv}>
|
||||||
{$tr("Open on %1").replace("%1", tvName)}
|
{$translate("Open on %1").replace("%1", tvName)}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
||||||
{$tr("Open in Invidious")}
|
{$translate("Open in Invidious")}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent">{$tr("Cancel")}</button>
|
<button class="btn join-item hover:btn-accent"
|
||||||
|
>{$translate("Cancel")}</button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<form method="dialog" class="modal-backdrop">
|
<form method="dialog" class="modal-backdrop">
|
||||||
<button>{$tr("Close")}</button>
|
<button>{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
import PlaylistCastDialog from "./PlaylistCastDialog.svelte";
|
import PlaylistCastDialog from "./PlaylistCastDialog.svelte";
|
||||||
import PlaylistThumbnail from "./PlaylistThumbnail.svelte";
|
import PlaylistThumbnail from "./PlaylistThumbnail.svelte";
|
||||||
import { get } from "svelte/store";
|
import { get } from "svelte/store";
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const trFn = get(tr);
|
const trFn = get(translate);
|
||||||
|
|
||||||
const totalDays = Math.floor(span / 86400);
|
const totalDays = Math.floor(span / 86400);
|
||||||
if (totalDays > 365) {
|
if (totalDays > 365) {
|
||||||
@@ -79,7 +79,12 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button class="w-80 p-2" on:click={modal.show()}>
|
<button
|
||||||
|
class="w-80 p-2"
|
||||||
|
on:click={() => {
|
||||||
|
modal.show();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div class="card card-compact bg-base-100 shadow-xl border border-neutral">
|
<div class="card card-compact bg-base-100 shadow-xl border border-neutral">
|
||||||
<PlaylistThumbnail
|
<PlaylistThumbnail
|
||||||
bind:title
|
bind:title
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PlayletApi } from "lib/Api/PlayletApi";
|
import { PlayletApi } from "lib/Api/PlayletApi";
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
import VideoStartAt from "./VideoStartAt.svelte";
|
import VideoStartAt from "./VideoStartAt.svelte";
|
||||||
import VideoThumbnail from "./VideoThumbnail.svelte";
|
import VideoThumbnail from "./VideoThumbnail.svelte";
|
||||||
|
|
||||||
@@ -116,19 +116,21 @@
|
|||||||
/>
|
/>
|
||||||
<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}>
|
||||||
{$tr("Play on %1").replace("%1", tvName)}
|
{$translate("Play on %1").replace("%1", tvName)}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent" on:click={queueOnTv}>
|
<button class="btn join-item hover:btn-accent" on:click={queueOnTv}>
|
||||||
{$tr("Queue on %1").replace("%1", tvName)}
|
{$translate("Queue on %1").replace("%1", tvName)}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
<button class="btn join-item hover:btn-accent" on:click={openInvidious}>
|
||||||
{$tr("Open in Invidious")}
|
{$translate("Open in Invidious")}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn join-item hover:btn-accent">{$tr("Cancel")}</button>
|
<button class="btn join-item hover:btn-accent"
|
||||||
|
>{$translate("Cancel")}</button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<form method="dialog" class="modal-backdrop">
|
<form method="dialog" class="modal-backdrop">
|
||||||
<button>{$tr("Close")}</button>
|
<button>{$translate("Close")}</button>
|
||||||
</form>
|
</form>
|
||||||
</dialog>
|
</dialog>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { playletStateStore, tr } from "lib/Stores";
|
import { playletStateStore, translate } from "lib/Stores";
|
||||||
import VideoCastDialog from "./VideoCastDialog.svelte";
|
import VideoCastDialog from "./VideoCastDialog.svelte";
|
||||||
import VideoThumbnail from "./VideoThumbnail.svelte";
|
import VideoThumbnail from "./VideoThumbnail.svelte";
|
||||||
import ChannelCastDialog from "./ChannelCastDialog.svelte";
|
import ChannelCastDialog from "./ChannelCastDialog.svelte";
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const trFn = get(tr);
|
const trFn = get(translate);
|
||||||
|
|
||||||
const currentTime = Math.floor(Date.now() / 1000);
|
const currentTime = Math.floor(Date.now() / 1000);
|
||||||
let timeLeft = premiereTimestamp - currentTime;
|
let timeLeft = premiereTimestamp - currentTime;
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
if (isNaN(published)) {
|
if (isNaN(published)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
const trFn = get(tr);
|
const trFn = get(translate);
|
||||||
const currentTime = Math.floor(Date.now() / 1000);
|
const currentTime = Math.floor(Date.now() / 1000);
|
||||||
const span = currentTime - published;
|
const span = currentTime - published;
|
||||||
if (span < 1) {
|
if (span < 1) {
|
||||||
@@ -181,7 +181,12 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button class="w-80 p-2" on:click={videoModal.show()}>
|
<button
|
||||||
|
class="w-80 p-2"
|
||||||
|
on:click={() => {
|
||||||
|
videoModal.show();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<div class="card card-compact bg-base-100 shadow-xl border border-neutral">
|
<div class="card card-compact bg-base-100 shadow-xl border border-neutral">
|
||||||
<VideoThumbnail
|
<VideoThumbnail
|
||||||
bind:videoId
|
bind:videoId
|
||||||
@@ -197,15 +202,23 @@
|
|||||||
/>
|
/>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 class="card-title text-base line-clamp-2 min-h-12">{title || ""}</h3>
|
<h3 class="card-title text-base line-clamp-2 min-h-12">{title || ""}</h3>
|
||||||
<button
|
<span
|
||||||
class="font-semibold link"
|
class="font-semibold link cursor-pointer"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
on:click={(e) => {
|
on:click={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
channelModal.show();
|
channelModal.show();
|
||||||
}}
|
}}
|
||||||
|
on:keydown={(e) => {
|
||||||
|
if (e.key === "Enter" || e.key === " ") {
|
||||||
|
e.preventDefault();
|
||||||
|
channelModal.show();
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{author || ""}
|
{author || ""}
|
||||||
</button>
|
</span>
|
||||||
<div>{getViewCountDateText()}</div>
|
<div>{getViewCountDateText()}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
import { InvidiousApi } from "lib/Api/InvidiousApi";
|
||||||
import { invidiousVideoApiStore, playletStateStore, tr } from "lib/Stores";
|
import {
|
||||||
|
invidiousVideoApiStore,
|
||||||
|
playletStateStore,
|
||||||
|
translate,
|
||||||
|
} from "lib/Stores";
|
||||||
import VideoCell from "./VideoCell.svelte";
|
import VideoCell from "./VideoCell.svelte";
|
||||||
import PlaylistCell from "./PlaylistCell.svelte";
|
import PlaylistCell from "./PlaylistCell.svelte";
|
||||||
import ChannelCell from "./ChannelCell.svelte";
|
import ChannelCell from "./ChannelCell.svelte";
|
||||||
@@ -268,7 +272,7 @@
|
|||||||
-->
|
-->
|
||||||
{#if feedLoadState !== FeedLoadState.Loaded || videos.length !== 0}
|
{#if feedLoadState !== FeedLoadState.Loaded || videos.length !== 0}
|
||||||
<div class="text-lg font-semibold ml-4">
|
<div class="text-lg font-semibold ml-4">
|
||||||
{$tr(feed.title)}
|
{$translate(feed.title)}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="carousel carousel-center rounded-box w-full space-x-4"
|
class="carousel carousel-center rounded-box w-full space-x-4"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { tr } from "lib/Stores";
|
import { translate } from "lib/Stores";
|
||||||
|
|
||||||
export let checked = false;
|
export let checked = false;
|
||||||
export let lengthSeconds = undefined;
|
export let lengthSeconds = undefined;
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<div class="flex flex-row items-center">
|
<div class="flex flex-row items-center">
|
||||||
<label class="label justify-start cursor-pointer">
|
<label class="label justify-start cursor-pointer">
|
||||||
<input type="checkbox" bind:checked class="checkbox" />
|
<input type="checkbox" bind:checked class="checkbox" />
|
||||||
<span class="label-text m-2">{$tr("Start at")}</span>
|
<span class="label-text m-2">{$translate("Start at")}</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
bind:this={textInputElemet}
|
bind:this={textInputElemet}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { tr } from "lib/Stores";
|
import { translate } from "lib/Stores";
|
||||||
|
|
||||||
export let videoId: string | undefined = undefined;
|
export let videoId: string | undefined = undefined;
|
||||||
export let title: string | undefined = undefined;
|
export let title: string | undefined = undefined;
|
||||||
@@ -77,13 +77,13 @@
|
|||||||
<div
|
<div
|
||||||
class="absolute bottom-2 right-0 bg-black/70 text-white text-sm rounded-sm font-bold pt-1 pb-1 pr-2 pl-2"
|
class="absolute bottom-2 right-0 bg-black/70 text-white text-sm rounded-sm font-bold pt-1 pb-1 pr-2 pl-2"
|
||||||
>
|
>
|
||||||
{$tr("UPCOMING")}
|
{$translate("UPCOMING")}
|
||||||
</div>
|
</div>
|
||||||
{:else if isVideoLive()}
|
{:else if isVideoLive()}
|
||||||
<div
|
<div
|
||||||
class="absolute bottom-2 right-0 bg-red-500 text-white text-sm rounded-sm font-bold pt-1 pb-1 pr-2 pl-2"
|
class="absolute bottom-2 right-0 bg-red-500 text-white text-sm rounded-sm font-bold pt-1 pb-1 pr-2 pl-2"
|
||||||
>
|
>
|
||||||
{$tr("LIVE")}
|
{$translate("LIVE")}
|
||||||
</div>
|
</div>
|
||||||
{:else if lengthSeconds || lengthText}
|
{:else if lengthSeconds || lengthText}
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import './app.css'
|
import './app.css'
|
||||||
import App from './App.svelte'
|
import App from './App.svelte'
|
||||||
|
import { mount } from 'svelte';
|
||||||
|
|
||||||
const app = new App({
|
const app = mount(App, {
|
||||||
target: document.getElementById('app')
|
target: document.getElementById('app')!
|
||||||
})
|
});
|
||||||
|
|
||||||
export default app
|
export default app
|
||||||
@@ -72,8 +72,8 @@ export class WebServerPlugin implements CompilerPlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const routeInfo = this.getRouteInfo(functionStatement);
|
const routeInfos = this.getRouteInfos(functionStatement);
|
||||||
if (!routeInfo) {
|
if (!routeInfos || routeInfos.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,9 +83,12 @@ export class WebServerPlugin implements CompilerPlugin {
|
|||||||
}
|
}
|
||||||
const classConstructor = this.getClassConstructor(classStmt) as MethodStatement;
|
const classConstructor = this.getClassConstructor(classStmt) as MethodStatement;
|
||||||
|
|
||||||
|
for (let index = 0; index < routeInfos.length; index++) {
|
||||||
|
const routeInfo = routeInfos[index];
|
||||||
const method = routeInfo.method === 'ALL' ? '*' : routeInfo.method;
|
const method = routeInfo.method === 'ALL' ? '*' : routeInfo.method;
|
||||||
const stmt = new RawCodeStatement(`m.routes.push({ method: "${method}", path: "${routeInfo.route}", router: m, func: "${func.functionStatement?.name.text}" })`)
|
const stmt = new RawCodeStatement(`m.routes.push({ method: "${method}", path: "${routeInfo.route}", router: m, func: "${func.functionStatement?.name.text}" })`)
|
||||||
event.editor.arrayPush(classConstructor.func.body.statements, stmt);
|
event.editor.arrayPush(classConstructor.func.body.statements, stmt);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}), {
|
}), {
|
||||||
walkMode: WalkMode.visitExpressionsRecursive
|
walkMode: WalkMode.visitExpressionsRecursive
|
||||||
@@ -102,12 +105,13 @@ export class WebServerPlugin implements CompilerPlugin {
|
|||||||
return parentClass === httpRouterBaseClass;
|
return parentClass === httpRouterBaseClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
getRouteInfo(functionStatement: FunctionStatement | undefined) {
|
getRouteInfos(functionStatement: FunctionStatement | undefined) {
|
||||||
const annotations = functionStatement?.annotations
|
const annotations = functionStatement?.annotations
|
||||||
if (!annotations || annotations.length === 0) {
|
if (!annotations || annotations.length === 0) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const routeInfos = [];
|
||||||
for (let index = 0; index < annotations.length; index++) {
|
for (let index = 0; index < annotations.length; index++) {
|
||||||
const annotation = annotations[index];
|
const annotation = annotations[index];
|
||||||
if (annotationNames.includes(annotation.name)) {
|
if (annotationNames.includes(annotation.name)) {
|
||||||
@@ -120,12 +124,14 @@ export class WebServerPlugin implements CompilerPlugin {
|
|||||||
throw new Error(`Expected string argument for annotation ${annotation.name}`)
|
throw new Error(`Expected string argument for annotation ${annotation.name}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
routeInfos.push({
|
||||||
method: annotation.name.toUpperCase(),
|
method: annotation.name.toUpperCase(),
|
||||||
route: args[0]
|
route: args[0]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
return routeInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
getClass(func: FunctionExpression) {
|
getClass(func: FunctionExpression) {
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
// Restarts the Roku app
|
||||||
|
|
||||||
|
const { ArgumentParser } = require('argparse');
|
||||||
|
const getEnvVars = require('./get-env-vars');
|
||||||
|
|
||||||
|
const config = getEnvVars(['ROKU_DEV_TARGET']);
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const parser = new ArgumentParser({
|
||||||
|
description: 'Restart Roku app using ECP'
|
||||||
|
});
|
||||||
|
|
||||||
|
parser.add_argument('--app-id', { help: 'App Id' });
|
||||||
|
|
||||||
|
const args = parser.parse_args();
|
||||||
|
let appId = args.app_id || "dev";
|
||||||
|
|
||||||
|
if (appId === "prod") {
|
||||||
|
appId = "693751";
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = `http://${config.ROKU_DEV_TARGET}:8060/launch/${appId}?restart=true`;
|
||||||
|
console.log("Restarting app", appId);
|
||||||
|
await fetch(url, {
|
||||||
|
method: 'POST',
|
||||||
|
body: '',
|
||||||
|
});
|
||||||
|
})();
|
||||||
Reference in new issue
Block a user