Skip to content

Commit

Permalink
Merge pull request #3100 from mrixner/fix-vcpkg-icon-id
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment authored Dec 20, 2024
2 parents 628b724 + b544140 commit 997acb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/UniGetUI.PackageEngine.Package/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ public string GetIconId()
iconId = iconId.Replace(".install", "").Replace(".portable", "");
else if (Manager.Name == "Scoop")
iconId = iconId.Replace(".app", "");
else if (Manager.Name == "vcpkg")
iconId = iconId.split(":")[0].Split("[")[0];
return iconId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public Package(
"Winget" => string.Join('.', id.ToLower().Split(".")[1..]),
"Scoop" => id.ToLower().Replace(".app", ""),
"Chocolatey" => id.ToLower().Replace(".install", "").Replace(".portable", ""),
"vcpkg" => id.ToLower().Split(":")[0].Split("[")[0],
_ => id.ToLower()
};
}
Expand Down Expand Up @@ -173,7 +174,7 @@ public virtual Uri GetIconUrl()
try
{
CacheableIcon? icon = TaskRecycler<CacheableIcon?>.RunOrAttach(Manager.DetailsHelper.GetIcon, this);
string? path = IconCacheEngine.GetCacheOrDownloadIcon(icon, Manager.Name, Id);
string? path = IconCacheEngine.GetCacheOrDownloadIcon(icon, Manager.Name, _iconId);
return path is null? null: new Uri("file:///" + path);
}
catch (Exception ex)
Expand Down

0 comments on commit 997acb1

Please sign in to comment.