Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,18 @@ public Package(

_iconId = Manager.Name switch
{
"Winget" => string.Join('.', id.ToLower().Split(".")[1..]),
"Winget" => Source.Name switch
{
"Steam" => id.ToLower().Split("\\")[^1].Replace("steam app ", "steam:").Trim(),
"Local PC" => id.ToLower().Split("\\")[^1],
"Microsoft Store" => id.IndexOf('_') < id.IndexOf('.') ? // If the first underscore is before the period, this ID has no publisher
string.Join('_', id.ToLower().Split("\\")[1].Split("_")[0..^4]) : // no publisher: remove `MSIX\`, then the standard ending _version_arch__{random id}
string.Join('_', string.Join('.', id.ToLower().Split(".")[1..]).Split("_")[0..^4]), // remove the publisher (before the first .), then the standard _version_arch__{random id}
_ => 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],
"Steam" => id.ToLower().Split("\\")[^1].Replace("Steam App", "steam:"),
"Local PC" => id.ToLower().Split("\\")[^1],
"Microsoft Store" => id.ToLower().Split(".")[1].Split("_")[0],
_ => id.ToLower()
};
}
Expand Down
Loading