diff options
author | 2024-08-02 10:52:31 +0800 | |
---|---|---|
committer | 2024-08-01 19:52:31 -0700 | |
commit | bcbf9f402512353c4d0eb6a8209c5ff04e8bc56a (patch) | |
tree | a4f1b68bbdd9264cb4ef8fb84ba42078a7e9754e /internal/config/options.go | |
parent | 569529d73b4413401959cec8390e8c5c19d57053 (diff) | |
download | v2-bcbf9f402512353c4d0eb6a8209c5ff04e8bc56a.tar.gz v2-bcbf9f402512353c4d0eb6a8209c5ff04e8bc56a.tar.zst v2-bcbf9f402512353c4d0eb6a8209c5ff04e8bc56a.zip |
feat: add `FETCH_BILIBILI_WATCH_TIME` config option
Diffstat (limited to 'internal/config/options.go')
-rw-r--r-- | internal/config/options.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/config/options.go b/internal/config/options.go index d5d793ac..d2536070 100644 --- a/internal/config/options.go +++ b/internal/config/options.go @@ -56,6 +56,7 @@ const ( defaultMediaResourceTypes = "image" defaultMediaProxyURL = "" defaultFilterEntryMaxAgeDays = 0 + defaultFetchBilibiliWatchTime = false defaultFetchNebulaWatchTime = false defaultFetchOdyseeWatchTime = false defaultFetchYouTubeWatchTime = false @@ -141,6 +142,7 @@ type Options struct { mediaProxyMode string mediaProxyResourceTypes []string mediaProxyCustomURL string + fetchBilibiliWatchTime bool fetchNebulaWatchTime bool fetchOdyseeWatchTime bool fetchYouTubeWatchTime bool @@ -218,6 +220,7 @@ func NewOptions() *Options { mediaProxyResourceTypes: []string{defaultMediaResourceTypes}, mediaProxyCustomURL: defaultMediaProxyURL, filterEntryMaxAgeDays: defaultFilterEntryMaxAgeDays, + fetchBilibiliWatchTime: defaultFetchBilibiliWatchTime, fetchNebulaWatchTime: defaultFetchNebulaWatchTime, fetchOdyseeWatchTime: defaultFetchOdyseeWatchTime, fetchYouTubeWatchTime: defaultFetchYouTubeWatchTime, @@ -501,6 +504,12 @@ func (o *Options) FetchOdyseeWatchTime() bool { return o.fetchOdyseeWatchTime } +// FetchBilibiliWatchTime returns true if the Bilibili video duration +// should be fetched and used as a reading time. +func (o *Options) FetchBilibiliWatchTime() bool { + return o.fetchBilibiliWatchTime +} + // MediaProxyMode returns "none" to never proxy, "http-only" to proxy non-HTTPS, "all" to always proxy. func (o *Options) MediaProxyMode() string { return o.mediaProxyMode @@ -658,6 +667,7 @@ func (o *Options) SortedOptions(redactSecret bool) []*Option { "FETCH_YOUTUBE_WATCH_TIME": o.fetchYouTubeWatchTime, "FETCH_NEBULA_WATCH_TIME": o.fetchNebulaWatchTime, "FETCH_ODYSEE_WATCH_TIME": o.fetchOdyseeWatchTime, + "FETCH_BILIBILI_WATCH_TIME": o.fetchBilibiliWatchTime, "HTTPS": o.HTTPS, "HTTP_CLIENT_MAX_BODY_SIZE": o.httpClientMaxBodySize, "HTTP_CLIENT_PROXY": o.httpClientProxy, |