mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2026-03-02 02:31:35 +00:00
Proxy video thumbnails through selected instance
This commit is contained in:
parent
2030f623a0
commit
a96d97c9d8
9 changed files with 22 additions and 16 deletions
|
|
@ -29,4 +29,4 @@ block content
|
|||
.videos
|
||||
each video in data.latestVideos
|
||||
.channel-video
|
||||
+video_list_item(video)
|
||||
+video_list_item(video, instanceOrigin)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
mixin video_list_item(video)
|
||||
mixin video_list_item(video, instanceOrigin)
|
||||
- if (!instanceOrigin) instanceOrigin = "https://i.ytimg.com"
|
||||
- let link = `/watch?v=${video.videoId}`
|
||||
a(href=link tabindex="-1").thumbnail
|
||||
img(src=`https://i.ytimg.com/vi/${video.videoId}/mqdefault.jpg` width=320 height=180 alt="").image
|
||||
img(src=`${instanceOrigin}/vi/${video.videoId}/mqdefault.jpg` width=320 height=180 alt="").image
|
||||
if video.second__lengthText != undefined
|
||||
span.duration= video.second__lengthText
|
||||
.info
|
||||
|
|
|
|||
|
|
@ -9,4 +9,4 @@ block content
|
|||
main.search-page
|
||||
each result in results
|
||||
.search-result
|
||||
+video_list_item(result)
|
||||
+video_list_item(result, instanceOrigin)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ block content
|
|||
|
||||
each video in videos
|
||||
.subscriptions-video
|
||||
+video_list_item(video)
|
||||
+video_list_item(video, instanceOrigin)
|
||||
else
|
||||
.no-subscriptions
|
||||
h2 You have no subscriptions.
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ block content
|
|||
h2.related-header Related videos
|
||||
each r in video.recommendedVideos
|
||||
.related-video
|
||||
+video_list_item(r)
|
||||
+video_list_item(r, instanceOrigin)
|
||||
|
||||
else
|
||||
//- error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue