Skip to content

Commit

Permalink
Fix video thumbnail when adding to queue from lounge
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Dec 25, 2024
1 parent e05a029 commit 1129014
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Channels sub count in web app
- Channel drag and drop in web app
- Video thumbnail when adding to queue from lounge

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ namespace LoungeVideoQueue
if queueNodesDict.DoesExist(vId)
newQueueNodes.Push(queueNodesDict[vId])
else
payload = {
"type": "video"
"videoId": vId
}
payload = CreateVideoPayload(vId)

if instance = invalid
instance = invService.GetInstance()
Expand Down Expand Up @@ -97,10 +94,7 @@ namespace LoungeVideoQueue
preferences = videoQueueNode.preferences
queueNotifications = preferences["misc.queue_notifications"]
if queueNotifications
payload = {
"type": "video"
"videoId": eventVideoId
}
payload = CreateVideoPayload(eventVideoId)

if instance = invalid
instance = invService.GetInstance()
Expand All @@ -117,4 +111,36 @@ namespace LoungeVideoQueue
end if
end function

function CreateVideoPayload(videoId as string) as object
return {
"type": "video"
"videoId": videoId
"videoThumbnails": [
{
"quality": "maxres"
"url": `https://i.ytimg.com/vi/${videoId}/maxresdefault.jpg`
"width": 1280
"height": 720
}
{
"quality": "sddefault"
"url": `https://i.ytimg.com/vi/${videoId}/sddefault.jpg`
"width": 640
"height": 480
}
{
"quality": "high"
"url": `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`
"width": 480
"height": 360
}
{
"quality": "medium"
"url": `https://i.ytimg.com/vi/${videoId}/mqdefault.jpg`
"width": 320
"height": 180
}
]
}
end function
end namespace

0 comments on commit 1129014

Please sign in to comment.