Skip to content

Commit

Permalink
Fix unknown card detection on Clean DB.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastiii committed Jan 7, 2013
1 parent c99adfd commit dd941aa
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -516,6 +516,8 @@ private void InitController()

IList<Card> allCards = TVDatabase.TVBusinessLayer.CardManagement.ListAllCards(CardIncludeRelationEnum.None);

bool oneOrMoreCardsFound = false;

foreach (ITVCard itvCard in _localCardCollection.Cards)
{
//for each card, check if its already mentioned in the database
Expand All @@ -541,10 +543,14 @@ private void InitController()
PidFilterMode = (int)PidFilterMode.Auto,
IdleMode = (int)DeviceIdleMode.Stop
};

oneOrMoreCardsFound = true;
TVDatabase.TVBusinessLayer.CardManagement.SaveCard(newCard);
}
}
if (oneOrMoreCardsFound)
{
allCards = TVDatabase.TVBusinessLayer.CardManagement.ListAllCards(CardIncludeRelationEnum.None);
}
//notify log about cards from the database which are removed from the pc
int cardsInstalled = _localCardCollection.Cards.Count;
foreach (Card dbsCard in allCards)
Expand Down

0 comments on commit dd941aa

Please sign in to comment.