Skip to content

Commit

Permalink
Handle MetaStats change from GUID to integer IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsey0 committed Apr 9, 2020
1 parent 7cc9c88 commit 72e80d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Advisor/Services/MetaStats/SnapshotImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,11 @@ private async Task<IList<Deck>> GetClassDecks(string url, IProgress<Tuple<int, i
result.Note = innerText;

// Parse and add Guid to the deck
string strGuid = Regex.Match(hrefValue, @"[0-9a-f]{8}[-]?([0-9a-f]{4}[-]?){3}[0-9a-f]{12}").ToString();
result.DeckId = new Guid(strGuid);
string strId = Regex.Match(hrefValue, @"/deck/([0-9]+)/").Groups[1].Value;
if (!string.IsNullOrEmpty(strId))
{
result.DeckId = new Guid(strId.PadLeft(32, '0'));
}

// Set import datetime as LastEdited
result.LastEdited = DateTime.Now;
Expand Down

0 comments on commit 72e80d4

Please sign in to comment.