From: Matt Joiner Date: Tue, 5 Aug 2025 10:01:13 +0000 (+1000) Subject: Make webseedUrlKey more ergonomic to use X-Git-Tag: v1.59.0~2^2~59 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=75df0c97d1129bfb39b33063c7c13123b8a56fc3;p=btrtrc.git Make webseedUrlKey more ergonomic to use --- diff --git a/torrent.go b/torrent.go index f1c334a5..0bd27b57 100644 --- a/torrent.go +++ b/torrent.go @@ -1013,7 +1013,7 @@ func (t *Torrent) newMetaInfo() metainfo.MetaInfo { UrlList: func() []string { ret := make([]string, 0, len(t.webSeeds)) for url := range t.webSeeds { - ret = append(ret, unique.Handle[string](url).Value()) + ret = append(ret, url.Value()) } return ret }(), diff --git a/webseed-requesting.go b/webseed-requesting.go index 698eea79..37567270 100644 --- a/webseed-requesting.go +++ b/webseed-requesting.go @@ -31,6 +31,14 @@ type ( webseedUrlKey unique.Handle[string] ) +func (me webseedUrlKey) Value() string { + return unique.Handle[string](me).Value() +} + +func (me webseedUrlKey) String() string { + return me.Value() +} + /* - Go through all the requestable pieces in order of priority, availability, whether there are peer requests, partial, infohash. - For each piece calculate files involved. Record each file not seen before and the piece index.