@@ -28,17 +28,17 @@ public class PredictHatCommand : IBasicCommand
2828
2929 internal static string IterationName = "" ;
3030 private ScreenshotTrainingService _TrainHat ;
31- private readonly HatDescriptionRepository _Repository ;
31+ // private readonly HatDescriptionRepository _Repository;
3232 private readonly IHubContext < ObsHub > _HubContext ;
3333
34- public PredictHatCommand ( IConfiguration configuration , ScreenshotTrainingService service , HatDescriptionRepository repository , IHubContext < ObsHub > hubContext )
34+ public PredictHatCommand ( IConfiguration configuration , ScreenshotTrainingService service , IHubContext < ObsHub > hubContext )
3535 {
3636 _CustomVisionKey = configuration [ "AzureServices:HatDetection:Key" ] ;
3737 _AzureEndpoint = configuration [ "AzureServices:HatDetection:CustomVisionEndpoint" ] ;
3838 _TwitchChannel = configuration [ "StreamServices:Twitch:Channel" ] ;
3939 _AzureProjectId = Guid . Parse ( configuration [ "AzureServices:HatDetection:ProjectId" ] ) ;
4040 _TrainHat = service ;
41- _Repository = repository ;
41+ // _Repository = repository;
4242 _HubContext = hubContext ;
4343 }
4444
@@ -86,13 +86,13 @@ public async Task Execute(IChatService chatService, string userName, ReadOnlyMem
8686
8787 if ( result . Predictions . Count ( b => b . Probability > 0.4d ) > 1 ) {
8888
89- var guess1Data = ( await _Repository . GetHatData ( bestMatch . TagName ) ) ;
90- var guess2Data = ( await _Repository . GetHatData ( result . Predictions . OrderByDescending ( p => p . Probability ) . Skip ( 1 ) . First ( ) . TagName ) ) ;
89+ var guess1Data = new HatData ( "" , "" ) ; // (await _Repository.GetHatData(bestMatch.TagName));
90+ var guess2Data = new HatData ( "" , "" ) ; // (await _Repository.GetHatData(result.Predictions.OrderByDescending(p => p.Probability).Skip(1).First().TagName));
9191 await chatService . SendMessageAsync ( $ "csharpGuess I'm not quite sure if this is { guess1Data . Name } ({ bestMatch . Probability . ToString ( "0.0%" ) } ) or { guess2Data . Name } ({ result . Predictions . OrderByDescending ( p => p . Probability ) . Skip ( 1 ) . First ( ) . Probability . ToString ( "0.0%" ) } )") ;
9292 return ;
9393
9494 } else {
95- var guessData = ( await _Repository . GetHatData ( bestMatch . TagName ) ) ;
95+ var guessData = new HatData ( "" , "" ) ; // (await _Repository.GetHatData(bestMatch.TagName));
9696 await chatService . SendMessageAsync ( $ "csharpGuess I'm not quite sure if this is { guessData . Name } ({ bestMatch . Probability . ToString ( "0.0%" ) } )") ;
9797 return ;
9898 }
@@ -103,7 +103,7 @@ public async Task Execute(IChatService chatService, string userName, ReadOnlyMem
103103 return ;
104104 }
105105
106- var hatData = ( await _Repository . GetHatData ( bestMatch . TagName ) ) ;
106+ var hatData = new HatData ( "" , "" ) ; // (await _Repository.GetHatData(bestMatch.TagName));
107107 var nameToReport = ( hatData == null ? bestMatch . TagName : ( string . IsNullOrEmpty ( hatData . Name ) ? bestMatch . TagName : hatData . Name ) ) ;
108108 await chatService . SendMessageAsync ( $ "csharpClip I think (with { bestMatch . Probability . ToString ( "0.0%" ) } certainty) Jeff is currently wearing his { nameToReport } hat csharpClip") ;
109109 if ( hatData != null && ! string . IsNullOrEmpty ( hatData . Description ) ) await chatService . SendMessageAsync ( hatData . Description ) ;
@@ -127,4 +127,7 @@ private async Task IdentifyIterationName()
127127
128128 }
129129 }
130+
131+ internal record HatData ( string Name , string Description ) ;
132+
130133}
0 commit comments