File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -564,11 +564,7 @@ func (b *Bot) createPreview(
564564 ID : mediaID ,
565565 OriginalTerms : originalTerms ,
566566 OriginalPosition : util .ToPtr (mediaID .FormatPositionRange ()),
567- Settings : Settings {
568- // defaults
569- OutputFormat : OutputWebp ,
570- BoomerModeNumGifs : 5 ,
571- },
567+ Settings : defaultSetting (),
572568 }
573569
574570 dialogWithContext , err := b .getDialogWithContext (state .ID )
Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ const (
4343 OutputWebp = OutputFileType ("webp" )
4444)
4545
46+ func defaultSetting () Settings {
47+ return Settings {
48+ BoomerModeNumGifs : 5 ,
49+ OutputFormat : OutputWebp ,
50+ }
51+ }
52+
4653type Settings struct {
4754 ExtendOrTrim time.Duration `json:"x,omitempty"`
4855 Shift time.Duration `json:"s,omitempty"`
@@ -231,6 +238,7 @@ func (c *PreviewState) ApplyUpdate(upd StateUpdate) error {
231238 // must keep this value to allow navigating between results
232239 OriginalTerms : c .OriginalTerms ,
233240 OriginalPosition : util .ToPtr (customID .FormatPositionRange ()),
241+ Settings : defaultSetting (),
234242 }
235243 * c = newState
236244 case StateUpdateUpdateMediaID :
You can’t perform that action at this time.
0 commit comments