Expose Torrent.SetDisplayName
This commit is contained in:
parent
83045db3e5
commit
86c4c609f1
|
@ -2183,7 +2183,7 @@ func (cl *Client) AddTorrentSpec(spec *TorrentSpec) (T Torrent, new bool, err er
|
|||
}
|
||||
}
|
||||
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.
|
||||
|
|
8
t.go
8
t.go
|
@ -84,3 +84,11 @@ func (t Torrent) Seeding() bool {
|
|||
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)
|
||||
}
|
||||
|
|
|
@ -103,6 +103,10 @@ var (
|
|||
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 {
|
||||
|
|
Loading…
Reference in New Issue