Compare commits

...
15 Commits
Author SHA1 Message Date
Brahim Hadriche e59e45e310 Release v0.18.1 (#248) 2024-01-02 12:48:57 -05:00
Brahim Hadriche 2548fb9097 Fix/invalid subs (#247)
* Sort

* Remove invalid

* Fix for unsupported subtitles

* Actually disable unsupported subs
2024-01-02 12:34:44 -05:00
Brahim Hadriche 1cb80f71b5 Use asyncStopSemantics to prevent execution timeout crashes (#246)
* Use asyncStopSemantics to prevent execution timeout crashes

* Clarify

* Changelog

* no message
2024-01-02 11:05:47 -05:00
Brahim Hadriche 0a7a6c65e2 Bug fix 2024-01-02 10:57:14 -05:00
Brahim Hadriche 529b915d7f [skip ci] Add comment with supported subtitle languages 2024-01-01 15:15:21 -05:00
Brahim Hadriche a76a2cb77f [skip ci] typo 2024-01-01 13:01:49 -05:00
Brahim Hadriche 707739b901 small refactor 2024-01-01 10:52:14 -05:00
Brahim Hadriche 8c72258879 Add TODO 2024-01-01 10:40:13 -05:00
Brahim Hadriche d245c072e9 Remove Funny and News from home screen (#245) 2023-12-30 22:47:06 -05:00
Brahim Hadriche 0f000590a0 Fixes for RowList cells (#244)
* Fixes for RowList cells

* typo
2023-12-30 22:32:43 -05:00
Brahim Hadriche 93c1e48d39 Add TODO 2023-12-30 19:21:21 -05:00
d6c7d81347 [chore] update dependencies (#243)
* Add TODO

* update dependencies

* plugin fix

---------

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
Co-authored-by: iBicha <iBicha@users.noreply.github.com>
2023-12-29 22:46:52 -05:00
Brahim Hadriche 331f2ff3cb Add playlist updated field in web app 2023-12-29 17:58:30 -05:00
Brahim Hadriche 6c42fbe056 Add tab titles in web app 2023-12-29 11:04:19 -05:00
Brahim Hadriche 7e8c828007 Remove legacy stuff 2023-12-28 18:17:42 -05:00
29 changed files with 259 additions and 316 deletions

No files matched your search

+19
View File
@@ -5,6 +5,25 @@ 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.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.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.18.1] - 2024-01-02
### Fixed
- A rare bug that causes the app to crash when displaying video cells
- A rare bug where a long press can cause a crash
- [Attempt] to fix a crash caused by execution timeout when stopping a video takes too long
- Unsupported subtitles (subtitles that can be rendered will not be used)
### Removed
- `Funny` and `News` from the Home screen.
- These are not standard feeds (like `Trending`), and are just search results for `Funny` and `News`. They were added in earlier Playlet versions to have more content in the Home screen.
- If you like to add these two feeds to your bookmarks:
- Search for `Funny` (or `News`)
- Set the `Sort by` filter to `Upload date`
- Press and hold the `Ok` button while a video from the search result is selected
- Choose the `Add to "Search - Funny"` option
## [0.18.0] - 2023-12-28 ## [0.18.0] - 2023-12-28
### Added ### Added
+1 -1
View File
@@ -2,7 +2,7 @@ openapi: 3.0.0
info: info:
title: Playlet Web API title: Playlet Web API
version: 0.18.0 version: 0.18.1
description: description:
Playlet Web API is a RESTful API for controlling the Playlet app on Playlet Web API is a RESTful API for controlling the Playlet app on
Roku devices. The API is intended to be used by the Playlet web app, but can Roku devices. The API is intended to be used by the Playlet web app, but can
+10 -10
View File
@@ -1,21 +1,21 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.18.0", "version": "0.18.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet", "name": "playlet",
"version": "0.18.0", "version": "0.18.1",
"hasInstallScript": true, "hasInstallScript": true,
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.13", "@rokucommunity/bslint": "^0.8.13",
"@types/crypto-js": "^4.2.1", "@types/crypto-js": "^4.2.1",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^20.10.5", "@types/node": "^20.10.6",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.65.14", "brighterscript": "0.65.15",
"brighterscript-formatter": "^1.6.36", "brighterscript-formatter": "^1.6.36",
"convert-svg-to-png": "^0.6.4", "convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0", "cross-fetch": "^4.0.0",
@@ -370,9 +370,9 @@
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.10.5", "version": "20.10.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz",
"integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"undici-types": "~5.26.4" "undici-types": "~5.26.4"
@@ -728,9 +728,9 @@
} }
}, },
"node_modules/brighterscript": { "node_modules/brighterscript": {
"version": "0.65.14", "version": "0.65.15",
"resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.14.tgz", "resolved": "https://registry.npmjs.org/brighterscript/-/brighterscript-0.65.15.tgz",
"integrity": "sha512-DVbFFp/ESu3Ow1LNsELTrmf4S/8bmXUTP9Z3R3VW21WRed392pur9ZU+tiz8w0Z0BaKjPOi+JD13P+PWkEq8zw==", "integrity": "sha512-WDnHaeCQclDG8wic1SCLYavnZDSjjzHcWxo+efwYkvyTjZivPoGWXbEulsYM3Nm9VawPuWWwzVqzHiN0Y4RvxQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@rokucommunity/bslib": "^0.1.1", "@rokucommunity/bslib": "^0.1.1",
+3 -3
View File
@@ -1,15 +1,15 @@
{ {
"name": "playlet", "name": "playlet",
"version": "0.18.0", "version": "0.18.1",
"description": "Unofficial Youtube client for Roku", "description": "Unofficial Youtube client for Roku",
"devDependencies": { "devDependencies": {
"@rokucommunity/bslint": "^0.8.13", "@rokucommunity/bslint": "^0.8.13",
"@types/crypto-js": "^4.2.1", "@types/crypto-js": "^4.2.1",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^20.10.5", "@types/node": "^20.10.6",
"@types/xml2js": "^0.4.14", "@types/xml2js": "^0.4.14",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"brighterscript": "0.65.14", "brighterscript": "0.65.15",
"brighterscript-formatter": "^1.6.36", "brighterscript-formatter": "^1.6.36",
"convert-svg-to-png": "^0.6.4", "convert-svg-to-png": "^0.6.4",
"cross-fetch": "^4.0.0", "cross-fetch": "^4.0.0",
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.18.0", "version": "0.18.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-app", "name": "playlet-app",
"version": "0.18.0" "version": "0.18.1"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-app", "name": "playlet-app",
"version": "0.18.0", "version": "0.18.1",
"description": "Unofficial Youtube client for Roku", "description": "Unofficial Youtube client for Roku",
"scripts": { "scripts": {
"prebuild": "rm -rf build/playlet-app", "prebuild": "rm -rf build/playlet-app",
@@ -1,5 +1,8 @@
import "LoadingMessages.bs" import "LoadingMessages.bs"
' TODO:P2 Add a "logQueue" field to the scene, and push it to the logger later when playlet-lib is loaded
' Alternatively, just log to the console and the known log file in cachefs
' TODO:P2 log the playlet-lib load status and load speed to the log queue
function Init() as void function Init() as void
m.scene = m.top.getScene() m.scene = m.top.getScene()
m.top.backgroundColor = "#242424FF" m.top.backgroundColor = "#242424FF"
+1 -1
View File
@@ -3,7 +3,7 @@ title=Playlet
# Do not update version manually, it is auto updated from package.json # Do not update version manually, it is auto updated from package.json
major_version=0 major_version=0
minor_version=18 minor_version=18
build_version=00000 build_version=00001
ui_resolutions=hd ui_resolutions=hd
+1 -1
View File
@@ -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) 2023 Brahim Hadriche ' Copyright (C) 2024 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
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.18.0", "version": "0.18.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.18.0" "version": "0.18.1"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-lib", "name": "playlet-lib",
"version": "0.18.0", "version": "0.18.1",
"description": "Unofficial Youtube client for Roku", "description": "Unofficial Youtube client for Roku",
"scripts": { "scripts": {
"prebuild": "rm -rf build/playlet-lib", "prebuild": "rm -rf build/playlet-lib",
@@ -185,9 +185,6 @@ function InitializeTabs()
playlists: function(authorId as string, author as string) as object playlists: function(authorId as string, author as string) as object
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author) return CreateChannelFeed("Playlists", "channel_playlists", authorId, author)
end function end function
channels: function(authorId as string, author as string) as object
return CreateChannelFeed("Channels", "channel_channels", authorId, author)
end function
} }
end function end function
@@ -1,13 +1,8 @@
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
m.titleLabel = m.top.FindNode("titleLabel")
m.authorLabel = m.top.FindNode("authorLabel")
m.updatedLabel = m.top.FindNode("updatedLabel")
m.videoCountRect = m.top.FindNode("videoCountRect") m.videoCountRect = m.top.FindNode("videoCountRect")
m.videoCountLabel = m.top.FindNode("videoCountLabel") m.videoCountLabel = m.top.FindNode("videoCountLabel")
m.thumbnail = m.top.FindNode("thumbnail")
m.thumbnail.failedBitmapUri = "pkg:/images/thumbnail-missing.jpg"
end function end function
function OnContentSet() as void function OnContentSet() as void
@@ -17,23 +12,28 @@ function OnContentSet() as void
return return
end if end if
m.titleLabel.text = content.title m.top.title = content.title
' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation. ' NOTE: "_author" not "author". See PlaylistContentNode.xml for explanation.
m.authorLabel.text = content._author m.top.author = content._author
m.updatedLabel.text = content.updatedText m.top.updated = content.updatedText
m.thumbnail.uri = content.thumbnail m.top.thumbnailUri = content.thumbnail
SetVideoCount(content.videoCountText) SetVideoCount(content.videoCountText)
end function end function
function SetVideoCount(videoCountText as string) function SetVideoCount(videoCountText as string) as void
m.top.videoCount = videoCountText
label = m.videoCountLabel label = m.videoCountLabel
rect = m.videoCountRect rect = m.videoCountRect
if label = invalid or rect = invalid
return
end if
rectParent = rect.getParent() rectParent = rect.getParent()
label.text = videoCountText
size = label.localBoundingRect() size = label.localBoundingRect()
rect.width = size.width + 16 rect.width = size.width + 16
@@ -2,6 +2,11 @@
<interface> <interface>
<field id="itemContent" type="node" onChange="OnContentSet" /> <field id="itemContent" type="node" onChange="OnContentSet" />
<field id="type" type="string" value="playlist" /> <field id="type" type="string" value="playlist" />
<field id="title" type="string" alias="titleLabel.text" />
<field id="author" type="string" alias="authorLabel.text" />
<field id="updated" type="string" alias="updatedLabel.text" />
<field id="thumbnailUri" type="uri" alias="thumbnail.uri" />
<field id="videoCount" type="string" alias="videoCountLabel.text" />
</interface> </interface>
<children> <children>
<LayoutGroup <LayoutGroup
@@ -10,7 +15,8 @@
id="thumbnail" id="thumbnail"
loadDisplayMode="scaleToZoom" loadDisplayMode="scaleToZoom"
width="350" width="350"
height="196"> height="196"
failedBitmapUri="pkg:/images/thumbnail-missing.jpg">
<Rectangle <Rectangle
id="videoCountRect" id="videoCountRect"
width="60" width="60"
@@ -3,19 +3,8 @@ import "pkg:/source/utils/TimeUtils.bs"
import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/Types.bs"
function Init() function Init()
FindChildren()
end function
function FindChildren()
' TODO:P2 use component properties with alias instead of FindNode
m.titleLabel = m.top.FindNode("titleLabel")
m.authorLabel = m.top.FindNode("authorLabel")
m.viewCountDateLabel = m.top.FindNode("viewCountDateLabel")
m.liveRect = m.top.FindNode("liveRect")
m.upcomingRect = m.top.FindNode("upcomingRect")
m.durationRect = m.top.FindNode("durationRect") m.durationRect = m.top.FindNode("durationRect")
m.durationLabel = m.top.FindNode("durationLabel") m.durationLabel = m.top.FindNode("durationLabel")
m.thumbnail = m.top.FindNode("thumbnail")
end function end function
function OnContentSet() as void function OnContentSet() as void
@@ -25,50 +14,51 @@ function OnContentSet() as void
return return
end if end if
if m.titleLabel = invalid m.top.title = content.title
FindChildren() m.top.author = content.author
end if
m.titleLabel.text = content.title
m.authorLabel.text = content.author
if content.isUpcoming = true if content.isUpcoming = true
m.viewCountDateLabel.text = content.premiereTimestampText m.top.viewCountDate = content.premiereTimestampText
else if not StringUtils.IsNullOrEmpty(content.publishedText) else if not StringUtils.IsNullOrEmpty(content.publishedText)
label = content.publishedText label = content.publishedText
if not StringUtils.IsNullOrEmpty(content.viewCountText) if not StringUtils.IsNullOrEmpty(content.viewCountText)
label = `${label} • ${content.viewCountText}` label = `${label} • ${content.viewCountText}`
end if end if
m.viewCountDateLabel.text = label m.top.viewCountDate = label
else else
m.viewCountDateLabel.text = "" m.top.viewCountDate = ""
end if end if
m.thumbnail.uri = content.thumbnail m.top.thumbnailUri = content.thumbnail
m.durationRect.visible = false m.top.durationRectVisible = false
m.upcomingRect.visible = false m.top.upcomingRectVisible = false
m.liveRect.visible = false m.top.liveRectVisible = false
if ValidInt(content.lengthSeconds) <> 0 if ValidInt(content.lengthSeconds) <> 0
SetDurationText(content.lengthText) SetDurationText(content.lengthText)
m.durationRect.visible = true m.top.durationRectVisible = true
else else
if content.isUpcoming = true if content.isUpcoming = true
m.upcomingRect.visible = true m.top.upcomingRectVisible = true
else if content.liveNow else if content.liveNow
m.liveRect.visible = true m.top.liveRectVisible = true
end if end if
end if end if
end function end function
function SetDurationText(text as string) function SetDurationText(text as string) as void
m.top.duration = text
label = m.durationLabel label = m.durationLabel
rect = m.durationRect rect = m.durationRect
if label = invalid or rect = invalid
return
end if
rectParent = rect.getParent() rectParent = rect.getParent()
label.text = text
size = label.localBoundingRect() size = label.localBoundingRect()
rect.width = size.width + 16 rect.width = size.width + 16
@@ -2,6 +2,14 @@
<interface> <interface>
<field id="itemContent" type="node" onChange="OnContentSet" /> <field id="itemContent" type="node" onChange="OnContentSet" />
<field id="type" type="string" value="video" /> <field id="type" type="string" value="video" />
<field id="title" type="string" alias="titleLabel.text" />
<field id="author" type="string" alias="authorLabel.text" />
<field id="viewCountDate" type="string" alias="viewCountDateLabel.text" />
<field id="liveRectVisible" type="boolean" alias="liveRect.visible" />
<field id="upcomingRectVisible" type="boolean" alias="upcomingRect.visible" />
<field id="durationRectVisible" type="boolean" alias="durationRect.visible" />
<field id="duration" type="string" alias="durationLabel.text" />
<field id="thumbnailUri" type="string" alias="thumbnail.uri" />
</interface> </interface>
<children> <children>
<LayoutGroup <LayoutGroup
@@ -123,16 +123,21 @@ function OnRowItemLongPressed(index as object) as void
return return
end if end if
if not IsArray(index) or index.count() <> 2
LogWarn("Invalid index:", index)
return
end if
rowIndex = index[0] rowIndex = index[0]
rowItemIndex = index[1] rowItemIndex = index[1]
if rowIndex < 0 or rowIndex >= content.GetChildCount() if not IsInt(rowIndex) or rowIndex < 0 or rowIndex >= content.GetChildCount()
LogWarn("Invalid row index:", rowIndex) LogWarn("Invalid row index:", rowIndex)
return return
end if end if
row = content.GetChild(rowIndex) row = content.GetChild(rowIndex)
if rowItemIndex < 0 or rowItemIndex >= row.GetChildCount() if not IsInt(rowItemIndex) or rowItemIndex < 0 or rowItemIndex >= row.GetChildCount()
LogWarn("Invalid row item index:", rowItemIndex) LogWarn("Invalid row item index:", rowItemIndex)
return return
end if end if
@@ -164,6 +164,7 @@ function SetCaptions(metadata as object, service as object, contentNode as objec
if metadata.captions.Count() = 0 if metadata.captions.Count() = 0
return return
end if end if
' TODO:P2 we don't need to read and parse this every time ' TODO:P2 we don't need to read and parse this every time
isoLanguageList = ParseJson(ReadAsciiFile("libpkg:/config/ISO-639-1-to-ISO-639-2T.json5")) isoLanguageList = ParseJson(ReadAsciiFile("libpkg:/config/ISO-639-1-to-ISO-639-2T.json5"))
instance = service.GetInstance() instance = service.GetInstance()
@@ -171,9 +172,25 @@ function SetCaptions(metadata as object, service as object, contentNode as objec
subtitleTracks = [] subtitleTracks = []
for each caption in metadata.captions for each caption in metadata.captions
code = caption.language_code
if StringUtils.IsNullOrEmpty(code)
continue for
end if
if code.InStr("-") <> -1
code = code.Split("-")[0]
end if
if code.len() = 2
if not isoLanguageList.DoesExist(code)
continue for
end if
code = isoLanguageList[code]
end if
subtitleTracks.Push({ subtitleTracks.Push({
Description: caption.label Description: caption.label
Language: isoLanguageList[caption.language_code] ?? caption.language_code Language: code
TrackName: instance + caption.url TrackName: instance + caption.url
}) })
end for end for
@@ -15,12 +15,22 @@ function Init()
' videoPlayingSuccess indicates if we started playing a video successfully ' videoPlayingSuccess indicates if we started playing a video successfully
' We use it to detect if we should try another link for a video, or if another error ' We use it to detect if we should try another link for a video, or if another error
' occurred (such as a next work error) ' occurred (such as a network error)
m.videoPlayingSuccess = false m.videoPlayingSuccess = false
' ignoreNextFinishedState indicates if we should ignore the next finished state ' ignoreNextFinishedState indicates if we should ignore the next finished state
' This is used to prevent the video from playing the next video when we are ' This is used to prevent the video from playing the next video when we are
' still trying to find a working stream url ' still trying to find a working stream url
m.ignoreNextFinishedState = false m.ignoreNextFinishedState = false
' asyncStopSemantics available since Roku OS 12.5
' It is set to true because stopping synchronously causes timeout and crash
' Usually we would need to wait for the video state to move to "stopping" then to "stopped"
' before considering the video node closed, and creating a new one.
' However, since we have a task to load video details, there should be enough time for the
' video node to close before we create a new one.
if m.top.hasField("asyncStopSemantics")
m.top.asyncStopSemantics = true
end if
end function end function
function OnNodeReady() function OnNodeReady()
@@ -35,7 +45,6 @@ function OnNodeReady()
m.container.observeFieldScoped("fullscreen", FuncName(OnFullScreenChange)) m.container.observeFieldScoped("fullscreen", FuncName(OnFullScreenChange))
m.top.ObserveField("state", FuncName(OnVideoPlayerStateChange)) m.top.ObserveField("state", FuncName(OnVideoPlayerStateChange))
m.top.observeField("control", FuncName(OnControlChange))
SponsorBlock.SetupSponsorBlock() SponsorBlock.SetupSponsorBlock()
end function end function
@@ -117,6 +126,15 @@ function MarkVideoWatched(videoId as string)
end function end function
function Close(_unused as dynamic) function Close(_unused as dynamic)
if m.videoContentTask <> invalid
m.videoContentTask.cancel = true
m.videoContentTask = invalid
end if
if m.sponsorBlockTask <> invalid
m.sponsorBlockTask.cancel = true
m.sponsorBlockTask = invalid
end if
m.top.control = "stop" m.top.control = "stop"
m.top.content = invalid m.top.content = invalid
parent = m.top.getParent() parent = m.top.getParent()
@@ -126,19 +144,6 @@ function Close(_unused as dynamic)
SponsorBlock.RemoveNotifcation(m.notifications) SponsorBlock.RemoveNotifcation(m.notifications)
end function end function
function OnControlChange()
if m.top.control = "stop"
if m.videoContentTask <> invalid
m.videoContentTask.cancel = true
m.videoContentTask = invalid
end if
if m.sponsorBlockTask <> invalid
m.sponsorBlockTask.cancel = true
m.sponsorBlockTask = invalid
end if
end if
end function
function OnVideoPlayerStateChange() as void function OnVideoPlayerStateChange() as void
state = m.top.state state = m.top.state
content = m.top.content content = m.top.content
@@ -1,186 +1,64 @@
// Language codes from ISO 639-1 to ISO 639-2T.
// Only includes a subset of the supported languages, as indicated
// in https://www.ccfonts.com/cinecav-styles/
// Languages covered
// Albanian, Avar, Basque, Basque, Belarusian, Bosnian, Breton, Bulgarian, Buryat,
// Catalan, Chamorro, Chichewa, Croatian, Cyrillic, Czech, Danish, Dutch, English,
// Estonian, Faroese, Finnish, French, Frisian, Galician, German, Greek, Hungarian,
// Icelandic, Irish, Italian, Kalmyk, Kurdish, Kyrgyz, Latvian, Lithuanian, Macedonian,
// Malagasy, Maltese, Montenegrin, Norwegian, Ossetian, Polish, Portuguese, Romani,
// Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Tajik, Tatar, Turkish,
// Ukrainian & Welsh.
// Some of the languages don't seem to have a 2 letter code, so they are not on the list.
{ {
aa: "aar", sq: "sqi", // Albanian
ab: "abk", av: "ava", // Avar
af: "afr", eu: "eus", // Basque
ak: "aka", be: "bel", // Belarusian
sq: "alb", bs: "bos", // Bosnian
am: "amh", br: "bre", // Breton
ar: "ara", bg: "bul", // Bulgarian
an: "arg", ca: "cat", // Catalan
hy: "hye", ch: "cha", // Chamorro
as: "asm", ny: "nya", // Chichewa
av: "ava", hr: "hrv", // Croatian
ae: "ave", cu: "chu", // Cyrillic
ay: "aym", cs: "ces", // Czech
az: "aze", da: "dan", // Danish
ba: "bak", nl: "nld", // Dutch
bm: "bam", en: "eng", // English
eu: "eus", et: "est", // Estonian
be: "bel", fo: "fao", // Faroese
bn: "ben", fi: "fin", // Finnish
bh: "bih", fr: "fra", // French
bi: "bis", fy: "fry", // Frisian
bo: "tib", gl: "glg", // Galician
bs: "bos", de: "deu", // German
br: "bre", el: "ell", // Greek
bg: "bul", hu: "hun", // Hungarian
my: "mya", is: "isl", // Icelandic
ca: "cat", ga: "gle", // Irish
cs: "cze", it: "ita", // Italian
ch: "cha", ku: "kur", // Kurdish
ce: "che", ky: "kir", // Kyrgyz
zh: "zho", lv: "lav", // Latvian
cu: "chu", lt: "lit", // Lithuanian
cv: "chv", mk: "mkd", // Macedonian
kw: "cor", mg: "mlg", // Malagasy
co: "cos", mt: "mlt", // Maltese
cr: "cre", no: "nor", // Norwegian
cy: "wel", os: "oss", // Ossetian
da: "dan", pl: "pol", // Polish
de: "ger", pt: "por", // Portuguese
dv: "div", ro: "ron", // Romanian
nl: "dut", ru: "rus", // Russian
dz: "dzo", sr: "srp", // Serbian
el: "gre", sk: "slk", // Slovak
en: "eng", sl: "slv", // Slovenian
eo: "epo", es: "spa", // Spanish
et: "est", tg: "tgk", // Tajik
ee: "ewe", tt: "tat", // Tatar
fo: "fao", tr: "tur", // Turkish
fa: "per", uk: "ukr", // Ukrainian
fj: "fij", cy: "cym", // Welsh
fi: "fin",
fr: "fra",
fy: "fry",
ff: "ful",
ka: "geo",
gd: "gla",
ga: "gle",
gl: "glg",
gv: "glv",
gn: "grn",
gu: "guj",
ht: "hat",
ha: "hau",
he: "heb",
hz: "her",
hi: "hin",
ho: "hmo",
hr: "hrv",
hu: "hun",
ig: "ibo",
is: "ice",
io: "ido",
ii: "iii",
iu: "iku",
ie: "ile",
ia: "ina",
id: "ind",
ik: "ipk",
it: "ita",
jv: "jav",
ja: "jpn",
kl: "kal",
kn: "kan",
ks: "kas",
kr: "kau",
kk: "kaz",
km: "khm",
ki: "kik",
rw: "kin",
ky: "kir",
kv: "kom",
kg: "kon",
ko: "kor",
kj: "kua",
ku: "kur",
lo: "lao",
la: "lat",
lv: "lav",
li: "lim",
ln: "lin",
lt: "lit",
lb: "ltz",
lu: "lub",
lg: "lug",
mk: "mkd",
mh: "mah",
ml: "mal",
mi: "mri",
mr: "mar",
ms: "may",
mg: "mlg",
mt: "mlt",
mn: "mon",
na: "nau",
nv: "nav",
nr: "nbl",
nd: "nde",
ng: "ndo",
ne: "nep",
nn: "nno",
nb: "nob",
no: "nor",
ny: "nya",
oc: "oci",
oj: "oji",
or: "ori",
om: "orm",
os: "oss",
pa: "pan",
pi: "pli",
pl: "pol",
pt: "por",
ps: "pus",
qu: "que",
rm: "roh",
ro: "ron",
rn: "run",
ru: "rus",
sg: "sag",
sa: "san",
si: "sin",
sk: "slk",
sl: "slv",
se: "sme",
sm: "smo",
sn: "sna",
sd: "snd",
so: "som",
st: "sot",
es: "spa",
sc: "srd",
sr: "srp",
ss: "ssw",
su: "sun",
sw: "swa",
sv: "swe",
ty: "tah",
ta: "tam",
tt: "tat",
te: "tel",
tg: "tgk",
tl: "tgl",
th: "tha",
ti: "tir",
to: "ton",
tn: "tsn",
ts: "tso",
tk: "tuk",
tr: "tur",
tw: "twi",
ug: "uig",
uk: "ukr",
ur: "urd",
uz: "uzb",
ve: "ven",
vi: "vie",
vo: "vol",
wa: "wln",
wo: "wol",
xh: "xho",
yi: "yid",
yo: "yor",
za: "zha",
zu: "zul",
} }
@@ -46,26 +46,6 @@
apiType: Invidious apiType: Invidious
endpoint: popular endpoint: popular
- title: Funny
feedSources:
- id: inv_search_funny
title: Search - Funny
apiType: Invidious
endpoint: search
queryParams:
q: Funny
sort_by: upload_date
- title: News
feedSources:
- id: inv_search_news
title: Search - News
apiType: Invidious
endpoint: search
queryParams:
q: News
sort_by: upload_date
- title: Playlists - title: Playlists
feedSources: feedSources:
- id: inv_auth_playlists - id: inv_auth_playlists
@@ -194,15 +194,6 @@ channel_podcasts:
paginationType: Continuation paginationType: Continuation
tryCount: 3 tryCount: 3
# TODO:P1 related channels are no longer working
# https://github.com/iv-org/invidious/issues/4275
channel_channels:
title: Related channels
url: /api/v1/channels/{ucid}/channels
responseHandler: ChannelRelatedChannelsHandler
paginationType: Continuation
tryCount: 3
watch_history: watch_history:
title: Watch history title: Watch history
url: /api/v1/auth/history url: /api/v1/auth/history
+1 -1
View File
@@ -3,7 +3,7 @@ title=PlayletLib
# Do not update version manually, it is auto updated from package.json # Do not update version manually, it is auto updated from package.json
major_version=0 major_version=0
minor_version=18 minor_version=18
build_version=00000 build_version=00001
ui_resolutions=hd ui_resolutions=hd
+10 -10
View File
@@ -1,19 +1,19 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.18.0", "version": "0.18.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "playlet-web", "name": "playlet-web",
"version": "0.18.0", "version": "0.18.1",
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.1", "@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tailwindcss/typography": "^0.5.10", "@tailwindcss/typography": "^0.5.10",
"@tsconfig/svelte": "^5.0.2", "@tsconfig/svelte": "^5.0.2",
"@vitejs/plugin-legacy": "^5.2.0", "@vitejs/plugin-legacy": "^5.2.0",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"daisyui": "^4.4.23", "daisyui": "^4.4.24",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"ip": "^1.1.8", "ip": "^1.1.8",
"postcss": "^8.4.32", "postcss": "^8.4.32",
@@ -25,7 +25,7 @@
"tslib": "^2.6.2", "tslib": "^2.6.2",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"vite": "^5.0.10", "vite": "^5.0.10",
"vite-tsconfig-paths": "^4.2.2" "vite-tsconfig-paths": "^4.2.3"
} }
}, },
"node_modules/@alloc/quick-lru": { "node_modules/@alloc/quick-lru": {
@@ -2925,9 +2925,9 @@
} }
}, },
"node_modules/daisyui": { "node_modules/daisyui": {
"version": "4.4.23", "version": "4.4.24",
"resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.4.23.tgz", "resolved": "https://registry.npmjs.org/daisyui/-/daisyui-4.4.24.tgz",
"integrity": "sha512-IFQRGoGoAke8chxPcDqQJFldVVd51JL7b4mRA3LqsLexW/6xicZzz9X3GXdGdnYsu8QPxZN4uzQZ5fwRNYXOSg==", "integrity": "sha512-u/B3484J08V7N0rIYymnC+SyxOjlYQL+2vyhHWV+/KC+VaUcbEF2Z3H06eCPgdTiZ0J+ml44aH7wBhIymPFQ+g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"css-selector-tokenizer": "^0.8", "css-selector-tokenizer": "^0.8",
@@ -4632,9 +4632,9 @@
} }
}, },
"node_modules/vite-tsconfig-paths": { "node_modules/vite-tsconfig-paths": {
"version": "4.2.2", "version": "4.2.3",
"resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.2.tgz", "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.3.tgz",
"integrity": "sha512-dq0FjyxHHDnp0uS3P12WEOX2W7NeuLzX9AWP38D7Zw2CTbFErapwQVlCiT5DMJcVWKQ1MMdTe92PZl/rBQ7qcw==", "integrity": "sha512-xVsA2xe6QSlzBujtWF8q2NYexh7PAUYfzJ4C8Axpe/7d2pcERYxuxGgph9F4f0iQO36g5tyGq6eBUYIssdUrVw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"debug": "^4.1.1", "debug": "^4.1.1",
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "playlet-web", "name": "playlet-web",
"version": "0.18.0", "version": "0.18.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
@@ -14,7 +14,7 @@
"@tsconfig/svelte": "^5.0.2", "@tsconfig/svelte": "^5.0.2",
"@vitejs/plugin-legacy": "^5.2.0", "@vitejs/plugin-legacy": "^5.2.0",
"autoprefixer": "^10.4.16", "autoprefixer": "^10.4.16",
"daisyui": "^4.4.23", "daisyui": "^4.4.24",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"ip": "^1.1.8", "ip": "^1.1.8",
"postcss": "^8.4.32", "postcss": "^8.4.32",
@@ -26,6 +26,6 @@
"tslib": "^2.6.2", "tslib": "^2.6.2",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"vite": "^5.0.10", "vite": "^5.0.10",
"vite-tsconfig-paths": "^4.2.2" "vite-tsconfig-paths": "^4.2.3"
} }
} }
-4
View File
@@ -119,10 +119,6 @@ export class PlayletApi {
return await response.json(); return await response.json();
} }
static async updateInstance(instance) {
return await PlayletApi.putJson(`${PlayletApi.host()}/api/preferences`, { "invidious.instance": instance });
}
static async setPlayletLibVersion(tag) { static async setPlayletLibVersion(tag) {
if (tag !== "") { if (tag !== "") {
const urls = [{ const urls = [{
@@ -31,6 +31,7 @@
<div class="h-6"> <div class="h-6">
<SearchIcon /> <SearchIcon />
</div> </div>
<span class="text-xs">Search</span>
</button> </button>
<button <button
on:click={() => setScreen("home")} on:click={() => setScreen("home")}
@@ -39,6 +40,7 @@
<div class="h-6"> <div class="h-6">
<HomeIcon /> <HomeIcon />
</div> </div>
<span class="text-xs">Home</span>
</button> </button>
<button <button
on:click={() => setScreen("bookmarks")} on:click={() => setScreen("bookmarks")}
@@ -47,6 +49,7 @@
<div class="h-6"> <div class="h-6">
<BookmarksIcon /> <BookmarksIcon />
</div> </div>
<span class="text-xs">Bookmarks</span>
</button> </button>
<button <button
on:click={() => setScreen("settings")} on:click={() => setScreen("settings")}
@@ -55,6 +58,7 @@
<div class="h-6"> <div class="h-6">
<SettingsIcon /> <SettingsIcon />
</div> </div>
<span class="text-xs">Settings</span>
</button> </button>
<button <button
on:click={() => setScreen("remote")} on:click={() => setScreen("remote")}
@@ -63,6 +67,7 @@
<div class="h-6"> <div class="h-6">
<RemoteIcon /> <RemoteIcon />
</div> </div>
<span class="text-xs">Remote</span>
</button> </button>
<button <button
on:click={() => setScreen("info")} on:click={() => setScreen("info")}
@@ -71,5 +76,6 @@
<div class="h-6"> <div class="h-6">
<InfoIcon /> <InfoIcon />
</div> </div>
<span class="text-xs">Info</span>
</button> </button>
</div> </div>
@@ -9,6 +9,7 @@
export let playlistThumbnail: string | undefined = undefined; export let playlistThumbnail: string | undefined = undefined;
export let videoCount: number | undefined = undefined; export let videoCount: number | undefined = undefined;
export let videos: any[] | undefined = undefined; export let videos: any[] | undefined = undefined;
export let updated: number | undefined = undefined;
// svelte-ignore unused-export-let // svelte-ignore unused-export-let
export let type: string = undefined; export let type: string = undefined;
@@ -19,6 +20,46 @@
playletStateStore.subscribe((value) => { playletStateStore.subscribe((value) => {
invidiousInstance = value?.invidious?.current_instance; invidiousInstance = value?.invidious?.current_instance;
}); });
function GetUpdatedText(updated) {
if (typeof updated !== "number") {
return "";
}
const span = Math.floor(Date.now() / 1000) - updated;
if (span < 1) {
return "";
}
let count = "";
const totalDays = Math.floor(span / 86400);
if (totalDays > 365) {
const years = Math.floor(totalDays / 365);
count = years > 1 ? `${years} years` : "1 year";
} else if (totalDays > 30) {
const months = Math.floor(totalDays / 30);
count = months > 1 ? `${months} months` : "1 month";
} else if (totalDays > 7) {
const weeks = Math.floor(totalDays / 7);
count = weeks > 1 ? `${weeks} weeks` : "1 week";
} else if (totalDays > 1) {
count = `${totalDays} days`;
} else if (span > 3600) {
const hours = Math.floor(span / 3600);
count = hours > 1 ? `${hours} hours` : "1 hour";
} else if (span > 60) {
const minutes = Math.floor(span / 60);
count = minutes > 1 ? `${minutes} minutes` : "1 minute";
} else {
count = span > 1 ? `${span} seconds` : "1 second";
}
if (count === "") {
return "";
}
return `Updated ${count} ago`;
}
</script> </script>
<button class="w-80 p-2" on:click={modal.show()}> <button class="w-80 p-2" on:click={modal.show()}>
@@ -33,6 +74,7 @@
<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>
<div class="font-semibold">{author}</div> <div class="font-semibold">{author}</div>
<div>{GetUpdatedText(updated)}</div>
</div> </div>
</div> </div>
</button> </button>
+1 -1
View File
@@ -78,7 +78,7 @@ export class BindingsPlugin implements CompilerPlugin {
const program = event.program; const program = event.program;
const scope = program.getFirstScopeForFile(event.file); const scope = program.getFirstScopeForFile(event.file);
if (!isXmlScope(scope)) { if (!scope || !isXmlScope(scope)) {
return; return;
} }