feat: add no_shorts option for YouTube feeds

This commit is contained in:
3rd
2024-08-02 23:39:27 +03:00
parent 738bcf8bcb
commit 09eedc08c1
2 changed files with 12 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ type Videos struct {
CollapseAfterRows int `yaml:"collapse-after-rows"`
Channels []string `yaml:"channels"`
Limit int `yaml:"limit"`
NoShorts bool `yaml:"no_shorts"`
}
func (widget *Videos) Initialize() error {
@@ -34,7 +35,7 @@ func (widget *Videos) Initialize() error {
}
func (widget *Videos) Update(ctx context.Context) {
videos, err := feed.FetchYoutubeChannelUploads(widget.Channels, widget.VideoUrlTemplate)
videos, err := feed.FetchYoutubeChannelUploads(widget.Channels, widget.VideoUrlTemplate, widget.NoShorts)
if !widget.canContinueUpdateAfterHandlingErr(err) {
return