moved connection string to the app config
This commit is contained in:
@@ -9,5 +9,7 @@ namespace Tv7Playlist.Core
|
||||
string UdpxyUrl { get; set; }
|
||||
|
||||
string DownloadFileName { get; set; }
|
||||
|
||||
string SqLiteConnectionString { get; set; }
|
||||
}
|
||||
}
|
@@ -3,9 +3,8 @@ using Tv7Playlist.Core;
|
||||
|
||||
namespace Tv7Playlist
|
||||
{
|
||||
public class AppConfig : IAppConfig
|
||||
internal class AppConfig : IAppConfig
|
||||
{
|
||||
|
||||
private string _tv7Url;
|
||||
private string _udpxyUrl;
|
||||
|
||||
@@ -34,5 +33,7 @@ namespace Tv7Playlist
|
||||
}
|
||||
|
||||
public string DownloadFileName { get; set; }
|
||||
|
||||
public string SqLiteConnectionString { get; set; }
|
||||
}
|
||||
}
|
@@ -112,9 +112,7 @@ namespace Tv7Playlist
|
||||
|
||||
private static void ConfigureDatabase(IServiceCollection services, IAppConfig appConfig)
|
||||
{
|
||||
//TODO: Move to settings to make it configurable within docker.
|
||||
var connection = "Data Source=playlist.db";
|
||||
services.AddDbContext<PlaylistContext>(options => options.UseSqlite(connection));
|
||||
services.AddDbContext<PlaylistContext>(options => options.UseSqlite(appConfig.SqLiteConnectionString));
|
||||
}
|
||||
|
||||
private void LogConfiguration(IAppConfig appConfig)
|
||||
|
@@ -5,5 +5,6 @@
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
},
|
||||
"SqLiteConnectionString": "Data Source=../playlist.db"
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"SourceType": "M3U",
|
||||
"SqLiteConnectionString": "Data Source=/data/playlist.db",
|
||||
"TV7Url": "https://api.init7.net/tvchannels.m3u",
|
||||
"UdpxyUrl": "http://192.168.15.2:4022/udp",
|
||||
"DownloadFileName": "PlaylistTV7udpxy.m3u"
|
||||
|
Reference in New Issue
Block a user