Skip to content

Commit

Permalink
修正来自订阅的任务名称展示
Browse files Browse the repository at this point in the history
  • Loading branch information
aiqinxuancai committed Jan 15, 2025
1 parent 565ab34 commit d6422b2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Aria2Fast/Service/Model/TaskModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public bool FromSubscription
//{
// return true;
//}
if (!string.IsNullOrWhiteSpace(Data.InfoHash) &&
SubscriptionManager.Instance.TaskUrlToSubscriptionName.ContainsKey(Data.InfoHash))
if (!string.IsNullOrWhiteSpace(Data.InfoHash) &&
SubscriptionManager.Instance.TaskUrlToSubscriptionName.Any(a => a.Key.Contains(Data.InfoHash)))
{
return true;
}
Expand Down Expand Up @@ -79,11 +79,20 @@ public string SubscriptionName
// return name;
//}

var name = (string)SubscriptionManager.Instance.TaskUrlToSubscriptionName[Data.InfoHash!];
SubscriptionManager.Instance.TaskUrlToSubscriptionName.TryGetValue(Data.InfoHash!, out string name);
if (!string.IsNullOrWhiteSpace(name))
{
return name;
}
else
{
var kv = SubscriptionManager.Instance.TaskUrlToSubscriptionName.FirstOrDefault(a => a.Key.Contains(Data.InfoHash));
if (!string.IsNullOrWhiteSpace(kv.Value))
{
return kv.Value;
}
}


return ShowName;

Expand Down

0 comments on commit d6422b2

Please sign in to comment.