Skip to content

Commit 086a66d

Browse files
committed
Updated the IcyVeins import logic for some changes in their URL
1 parent 04753fa commit 086a66d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

TalentTreeViewer_TWW/IcyVeinsImport.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ IcyVeinsImport.bitWidthNodeIndex = 6;
2020
--- @return boolean
2121
--- @public
2222
function IcyVeinsImport:IsTalentUrl(text)
23-
-- example URL https://www.icy-veins.com/wow/the-war-within-talent-calculator#seg1-seg2-seg3-seg4-seg5
2423
-- example URL https://www.icy-veins.com/wow/midnight-talent-calculator#seg1-seg2-seg3-seg4-seg5
25-
return not not text:match('^https?://www%.icy%-veins%.com/wow/the%-war%-within%-talent%-calculator%#[^-]*%-[^-]*%-[^-]*%-[^-]*%-[^-]*$')
26-
or not not text:match('^https?://www%.icy%-veins%.com/wow/midnight%-talent%-calculator%#[^-]*%-[^-]*%-[^-]*%-[^-]*%-[^-]*$');
24+
return not not text:match('^https?://www%.icy%-veins%.com/wow/midnight%-talent%-calculator%#[^-]*%-[^-]*%-[^-]*%-[^-]*%-[^-]*%-?$');
2725
end
2826

2927
--- @private
@@ -63,7 +61,9 @@ function IcyVeinsImport:ParseUrl(url)
6361
local dataSection = url:match('#(.*)');
6462
dataSection = dataSection:gsub(':', '/'); -- IcyVeins uses base64 with `:`, whereas wow uses `/`
6563

66-
local specIDString, classString, specString, heroString, pvpString = string.split('-', dataSection);
64+
local sections = { string.split('-', dataSection) };
65+
local specIDString, classString, specString = sections[1], sections[2], sections[3];
66+
local heroString = sections[#sections - 1]; -- there seems to sometimes be an additional segment in the middle? not sure what that is
6767
local specIDStream = ExportUtil.MakeImportDataStream(specIDString);
6868
local specID = tonumber(specIDStream:ExtractValue(self.bitWidthSpecID));
6969
local classID = specID and C_SpecializationInfo.GetClassIDFromSpecID(specID);

0 commit comments

Comments
 (0)