Use Info.BestName in a few more places

This commit is contained in:
Matt Joiner 2022-03-18 09:15:50 +11:00
parent aa4a831c78
commit dd1ca6f514
No known key found for this signature in database
GPG Key ID: 6B990B8185E7F782
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ func (mi *MetaInfo) SetDefaults() {
func (mi *MetaInfo) Magnet(infoHash *Hash, info *Info) (m Magnet) {
m.Trackers = append(m.Trackers, mi.UpvertedAnnounceList().DistinctValues()...)
if info != nil {
m.DisplayName = info.Name
m.DisplayName = info.BestName()
}
if infoHash != nil {
m.InfoHash = *infoHash

View File

@ -543,7 +543,7 @@ func (t *Torrent) name() string {
t.nameMu.RLock()
defer t.nameMu.RUnlock()
if t.haveInfo() {
return t.info.Name
return t.info.BestName()
}
if t.displayName != "" {
return t.displayName