private async Task GetCardDetails(HtmlNode details, CardSWD card)
        {
            var panelDefault = details.SelectSingleNode("./div/div[contains(@class, 'panel-default')]");
            var panelHead    = panelDefault.SelectSingleNode("./div[contains(@class, 'panel-heading')]");

            var title      = panelHead.SelectSingleNode("./h3");
            var spanUnique = title.SelectSingleNode("./span[class='icon-unique']");

            var panelContent    = panelDefault.SelectSingleNode("./div[contains(@class, 'panel-body')]");
            var cardText        = panelContent.SelectSingleNode("./div[contains(@class, 'card-text')]");
            var cardFlavor      = panelContent.SelectSingleNode("./div[contains(@class, 'card-flavor')]");
            var cardIllustrator = panelContent.SelectSingleNode("./div[contains(@class, 'card-illustrator')]");

            var cardLegality = panelContent.SelectSingleNode("./div[contains(@class, 'card-legality-table')]");
            var cardBalance  = panelContent.SelectSingleNode("./div[contains(@class, 'card-balance-table')]");

            if (cardIllustrator != null)
            {
                card.ArtistId = await _artistService.GetModelIdAsync(cardIllustrator.InnerText.FormatText());
            }
            if (cardLegality != null)
            {
                await InsertCardLegality(cardLegality, card);
            }
            if (cardBalance != null)
            {
                await InsertCardBalance(cardBalance, card);
            }

            card.IsUnique = spanUnique != null;
            card.Text     = GetCardText(cardText);
            card.Flavor   = cardFlavor.InnerText.FormatText();
        }
        private async Task InsertCardBalance(HtmlNode divBalance, CardSWD card)
        {
            var table = divBalance.SelectSingleNode("./div/table");
            var ths   = table.SelectNodes("./thead/tr/th");
            var tds   = table.SelectNodes("./tr/td");

            for (int i = 0; i < ths.Count; i++)
            {
                var th         = ths[i];
                var td         = tds[i];
                var legalityId = await _legalityService.GetModelIdAsync(th.InnerText.FormatText());

                var cardLegality = await _cardLegalityService.GetCardLegalityByCardLegality(card.Id, legalityId);

                var balanceForceInDb = await _balanceForceService.GetBalanceForceByCardLegality(cardLegality.Id);

                var innerText      = td.InnerText.FormatText();
                var splitInnerText = innerText.Split('/');
                var points         = Convert.ToInt32(splitInnerText[0]);
                var elitePoints    = splitInnerText.Length > 1 ? Convert.ToInt32(splitInnerText[1]) : (int?)null;

                if (balanceForceInDb == default)
                {
                    var balanceForce = new BalanceForce
                    {
                        CardLegalityId = cardLegality.Id,
                        ElitePoints    = elitePoints,
                        InsertedIn     = DateTime.Now,
                        Points         = points
                    };

                    await _balanceForceService.CreateAsync(balanceForce);
                }
                else
                {
                    balanceForceInDb.ElitePoints = elitePoints;
                    balanceForceInDb.Points      = points;

                    await _balanceForceService.PartialUpdateAsync(balanceForceInDb,
                                                                  new[] { nameof(BalanceForce.ElitePoints), nameof(BalanceForce.Points) });
                }
            }
        }
        private async Task InsertCardLegality(HtmlNode divLegality, CardSWD card)
        {
            var table = divLegality.SelectSingleNode("./div/table");

            var ths = table.SelectNodes("./thead/tr/th");
            var tds = table.SelectNodes("./tr/td");

            for (int i = 0; i < ths.Count; i++)
            {
                var th         = ths[i];
                var td         = tds[i];
                var legalityId = await _legalityService.GetModelIdAsync(th.InnerText.FormatText());

                var isLegal = !td.Attributes["class"].Value.Contains("no-legal");

                var cardLegalityInDB = await _cardLegalityService.GetCardLegalityByCardLegality(card.Id, legalityId);

                if (cardLegalityInDB == default)
                {
                    var cardLegality = new CardLegality
                    {
                        CardId     = card.Id,
                        InsertedIn = DateTime.Now,
                        IsLegal    = isLegal,
                        LegalityId = legalityId
                    };
                    await _cardLegalityService.CreateAsync(cardLegality);
                }
                else
                {
                    cardLegalityInDB.IsLegal = isLegal;
                    await _cardLegalityService.PartialUpdateAsync(cardLegalityInDB,
                                                                  new[] { nameof(CardLegality.IsLegal) });
                }
            }
        }