]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Make webseedUrlKey more ergonomic to use
authorMatt Joiner <anacrolix@gmail.com>
Tue, 5 Aug 2025 10:01:13 +0000 (20:01 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 5 Aug 2025 10:01:13 +0000 (20:01 +1000)
torrent.go
webseed-requesting.go

index f1c334a51f9919c8b842b83292063fe035bd1209..0bd27b57a87318dbe5cb06fd742cf6ea2372cfa0 100644 (file)
@@ -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
                }(),
index 698eea7912de401ac6c368a9e03932847880618e..37567270a80a7688db22522d4a5d26f60d27575e 100644 (file)
@@ -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.