@@ -44,18 +44,21 @@ internal async Task StartFarming() {
4444 // Find the number of badge pages
4545 HtmlDocument badgesDocument = await Bot . ArchiWebHandler . GetBadgePage ( 1 ) . ConfigureAwait ( false ) ;
4646 if ( badgesDocument == null ) {
47+ Logging . LogGenericWarning ( Bot . BotName , "Could not get badges information, farming is stopped!" ) ;
4748 return ;
4849 }
4950
5051 var maxPages = 1 ;
5152 HtmlNodeCollection badgesPagesNodeCollection = badgesDocument . DocumentNode . SelectNodes ( "//a[@class='pagelink']" ) ;
5253 if ( badgesPagesNodeCollection != null ) {
53- maxPages = ( byte ) ( badgesPagesNodeCollection . Count / 2 + 1 ) ; // Don't do this at home
54+ maxPages = ( badgesPagesNodeCollection . Count / 2 ) + 1 ; // Don't do this at home
5455 }
5556
5657 // Find APPIDs we need to farm
5758 List < uint > appIDs = new List < uint > ( ) ;
5859 for ( var page = 1 ; page <= maxPages ; page ++ ) {
60+ Logging . LogGenericInfo ( Bot . BotName , "Checking page: " + page + "/" + maxPages ) ;
61+
5962 if ( page > 1 ) { // Because we fetched page number 1 already
6063 badgesDocument = await Bot . ArchiWebHandler . GetBadgePage ( page ) . ConfigureAwait ( false ) ;
6164 if ( badgesDocument == null ) {
@@ -71,14 +74,14 @@ internal async Task StartFarming() {
7174 foreach ( HtmlNode badgesPageNode in badgesPageNodes ) {
7275 string steamLink = badgesPageNode . GetAttributeValue ( "href" , null ) ;
7376 if ( steamLink == null ) {
74- page = maxPages ; // Break from outer loop
75- break ;
77+ Logging . LogGenericWarning ( Bot . BotName , "Couldn't get steamLink for one of the games: " + badgesPageNode . OuterHtml ) ;
78+ continue ;
7679 }
7780
7881 uint appID = ( uint ) Utilities . OnlyNumbers ( steamLink ) ;
7982 if ( appID == 0 ) {
80- page = maxPages ; // Break from outer loop
81- break ;
83+ Logging . LogGenericWarning ( Bot . BotName , "Couldn't get appID for one of the games: " + badgesPageNode . OuterHtml ) ;
84+ continue ;
8285 }
8386
8487 appIDs . Add ( appID ) ;
0 commit comments