wish i could preview items but too lazy

This commit is contained in:
bel
2025-05-05 22:10:04 -06:00
parent 0271f84948
commit bf23d6a9cf
3 changed files with 29 additions and 12 deletions

View File

@@ -139,7 +139,11 @@ func proxyFetch(ctx context.Context, u string) (string, error) {
}
func (feed Feed) FetchURL() (*url.URL, error) {
u, err := url.Parse(feed.Version.URL)
return feed.Version.FetchURL()
}
func (version Version) FetchURL() (*url.URL, error) {
u, err := url.Parse(version.URL)
if err != nil {
return nil, err
}
@@ -148,7 +152,7 @@ func (feed Feed) FetchURL() (*url.URL, error) {
case "nyaa": // `nyaa://?q=A B` to `https://nyaa.si/?page=rss&q=A%20B&c=0_0&f=0`
q := u.Query()
if q.Get("q") == "" {
return nil, fmt.Errorf("invalid nyaa:// (%s): no ?q", feed.Version.URL)
return nil, fmt.Errorf("invalid nyaa:// (%s): no ?q", version.URL)
}
q.Set("page", "rss")