diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-20 20:52:13 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-20 20:52:13 +0200 |
commit | 1e4613aa1113b373a8d841c28e222599237a33c5 (patch) | |
tree | d307a10051d6e504366e76a71c17cba7deda47ac /pkg/database/sql | |
parent | 64603aa1e13ba82b9393b9eb91b6332237f45821 (diff) | |
download | lens-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.go | 11 |
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 } |