2
2
using Fritz . StreamTools . Hubs ;
3
3
using Fritz . Twitch ;
4
4
using Fritz . Twitch . PubSub ;
5
+ using Microsoft . AspNetCore . Hosting ;
5
6
using Microsoft . AspNetCore . SignalR ;
6
7
using Microsoft . Extensions . Configuration ;
7
8
using Microsoft . Extensions . DependencyInjection ;
8
9
using Microsoft . Extensions . Hosting ;
10
+ using Microsoft . Extensions . Hosting . Internal ;
9
11
using Microsoft . Extensions . Logging ;
10
12
using Microsoft . Extensions . Options ;
11
13
using System ;
@@ -27,11 +29,11 @@ public class TwitchPubSubService : IHostedService
27
29
public static short _OldManCount = 0 ;
28
30
private readonly Twitch . PubSub . Proxy _Proxy ;
29
31
private readonly ConfigurationSettings _Configuration ;
30
- private readonly IHostEnvironment _HostEnvironment ;
32
+ private readonly IWebHostEnvironment _HostEnvironment ;
31
33
private readonly ILogger _Logger ;
32
34
private readonly Dictionary < string , Action < IHubContext < AttentionHub , IAttentionHubClient > > > _ChannelPointActions = new Dictionary < string , Action < IHubContext < AttentionHub , IAttentionHubClient > > > ( ) ;
33
35
34
- public TwitchPubSubService ( IServiceProvider serviceProvider , Twitch . PubSub . Proxy proxy , IHostEnvironment hostEnvironment , IOptions < ConfigurationSettings > settings , ILoggerFactory loggerFactory )
36
+ public TwitchPubSubService ( IServiceProvider serviceProvider , Twitch . PubSub . Proxy proxy , IWebHostEnvironment hostEnvironment , IOptions < ConfigurationSettings > settings , ILoggerFactory loggerFactory )
35
37
{
36
38
_ServiceProvider = serviceProvider ;
37
39
_Proxy = proxy ;
@@ -67,7 +69,7 @@ public Task StartAsync(CancellationToken cancellationToken)
67
69
private void IdentifyOldManAudio ( )
68
70
{
69
71
70
- var oldManPath = Path . Combine ( _HostEnvironment . ContentRootPath , "wwwroot" , "contents" , "oldman" ) ;
72
+ var oldManPath = Path . Combine ( _HostEnvironment . WebRootPath , "contents" , "oldman" ) ;
71
73
var di = new DirectoryInfo ( oldManPath ) ;
72
74
73
75
if ( di . Exists && di . GetFiles ( ) . Any ( ) ) {
0 commit comments