From 1e4613aa1113b373a8d841c28e222599237a33c5 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Thu, 20 Jul 2023 20:52:13 +0200 Subject: feat: Add option to preload metadata Let the use pick if they want to preload videos' metadata. --- templates/media.qtpl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'templates/media.qtpl') diff --git a/templates/media.qtpl b/templates/media.qtpl index 18eac0d..6217899 100644 --- a/templates/media.qtpl +++ b/templates/media.qtpl @@ -2,8 +2,16 @@ {% code type MediaPage struct { - Medias []*repository.Media - Next *repository.Pagination + Medias []*repository.Media + Next *repository.Pagination + Settings *repository.Settings +} + +func (m *MediaPage) PreloadAttr() string { + if m.Settings.PreloadVideoMetadata { + return "metadata" + } + return "none" } %} @@ -14,7 +22,7 @@ type MediaPage struct { {% for _, media := range p.Medias %}
{% if media.IsVideo() %} -