aboutsummaryrefslogtreecommitdiff
path: root/pkg/database/sql
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-20 20:52:13 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2023-07-20 20:52:13 +0200
commit1e4613aa1113b373a8d841c28e222599237a33c5 (patch)
treed307a10051d6e504366e76a71c17cba7deda47ac /pkg/database/sql
parent64603aa1e13ba82b9393b9eb91b6332237f45821 (diff)
downloadlens-1e4613aa1113b373a8d841c28e222599237a33c5.tar.gz
lens-1e4613aa1113b373a8d841c28e222599237a33c5.tar.bz2
lens-1e4613aa1113b373a8d841c28e222599237a33c5.zip
feat: Add option to preload metadata
Let the use pick if they want to preload videos' metadata.
Diffstat (limited to 'pkg/database/sql')
-rw-r--r--pkg/database/sql/settings.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkg/database/sql/settings.go b/pkg/database/sql/settings.go
index 4e73878..3f4ad08 100644
--- a/pkg/database/sql/settings.go
+++ b/pkg/database/sql/settings.go
@@ -11,8 +11,9 @@ import (
type (
Settings struct {
gorm.Model
- ShowMode bool
- ShowOwner bool
+ ShowMode bool
+ ShowOwner bool
+ PreloadVideoMetadata bool
}
SettingsRepository struct {
@@ -51,6 +52,7 @@ func (self *SettingsRepository) Save(ctx context.Context, toSaveSettings *reposi
s.ShowMode = toSaveSettings.ShowMode
s.ShowOwner = toSaveSettings.ShowOwner
+ s.PreloadVideoMetadata = toSaveSettings.PreloadVideoMetadata
result := db.Save(s)
return result.Error
@@ -63,7 +65,8 @@ func (self *SettingsRepository) Load(ctx context.Context) (*repository.Settings,
}
return &repository.Settings{
- ShowMode: s.ShowMode,
- ShowOwner: s.ShowOwner,
+ ShowMode: s.ShowMode,
+ ShowOwner: s.ShowOwner,
+ PreloadVideoMetadata: s.PreloadVideoMetadata,
}, nil
}