using System.Collections.Generic; using System.IO; using Newtonsoft.Json; namespace TJAPlayer3 { class DBCDN { public void tDBCDN() { if (!File.Exists(@".\Databases\CDN.json")) tSaveFile(); tLoadFile(); } #region [Auxiliary classes] public class CDNHooks { public string id = "id"; public Dictionary title = new Dictionary() { ["default"] = "title", }; public Dictionary subtitle = new Dictionary() { ["default"] = "subtitle", }; public string[] difficulties = { "easy", "normal", "hard", "extreme", "extra", "tower", "dan" }; public string life = "life"; public string updateDate = "updateDate"; public string creationDate = "creationDate"; public string uploadDate = "uploadDate"; public Dictionary md5 = new Dictionary() { ["default"] = "md5", }; public string genre = "genre"; public Dictionary genreSub = new Dictionary() { ["default"] = "name", }; public string charter = "charter"; } public class CDNData { [JsonProperty("baseUrl")] public string BaseUrl; [JsonProperty("download")] public Dictionary Download = new Dictionary() { ["default"] = "download/", }; [JsonProperty("songList")] public string SongList; [JsonProperty("hooks")] public CDNHooks Hooks; } #endregion public Dictionary data = new Dictionary(); #region [private] private void tSaveFile() { ConfigManager.SaveConfig(data, @".\Databases\CDN.json"); } private void tLoadFile() { data = ConfigManager.GetConfig>(@".\Databases\CDN.json"); } #endregion } }