Inlineable `(*Torrent).SetDisplayName()` (#625)
This commit is contained in:
parent
542970b961
commit
e105d8b57a
11
t.go
11
t.go
|
@ -130,15 +130,14 @@ func (t *Torrent) Seeding() bool {
|
||||||
return t.seeding()
|
return t.seeding()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clobbers the torrent display name. The display name is used as the torrent
|
// Clobbers the torrent display name if metainfo is unavailable.
|
||||||
// name if the metainfo is not available.
|
// The display name is used as the torrent name while the metainfo is unavailable.
|
||||||
func (t *Torrent) SetDisplayName(dn string) {
|
func (t *Torrent) SetDisplayName(dn string) {
|
||||||
t.nameMu.Lock()
|
t.nameMu.Lock()
|
||||||
defer t.nameMu.Unlock()
|
if !t.haveInfo() {
|
||||||
if t.haveInfo() {
|
t.displayName = dn
|
||||||
return
|
|
||||||
}
|
}
|
||||||
t.displayName = dn
|
t.nameMu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// The current working name for the torrent. Either the name in the info dict,
|
// The current working name for the torrent. Either the name in the info dict,
|
||||||
|
|
Loading…
Reference in New Issue