}
}
if spec.DisplayName != "" {
- t.displayName = spec.DisplayName
+ t.setDisplayName(spec.DisplayName)
}
// Try to merge in info we have on the torrent. Any err left will
// terminate the function.
defer t.cl.mu.Unlock()
return t.cl.seeding(t.torrent)
}
+
+// Clobbers the torrent display name. The display name is used as the torrent
+// name if the metainfo is not available.
+func (t Torrent) SetDisplayName(dn string) {
+ t.cl.mu.Lock()
+ defer t.cl.mu.Unlock()
+ t.torrent.setDisplayName(dn)
+}
piecePrioritiesNew = expvar.NewInt("piecePrioritiesNew")
)
+func (t *torrent) setDisplayName(dn string) {
+ t.displayName = dn
+}
+
func (t *torrent) newConnPiecePriorities() []int {
_ret := t.connPiecePriorites.Get()
if _ret != nil {