public static void ArrayWrite(AlCConfigScheme preset, string[] array) {
     foreach (string writeObj in array) {
         lock (LockObj) {
             AlConsole.WriteLine(preset, writeObj);
         }
     }
 }
Example #2
0
        public static void Main(string[] args)
        {
            // Start Message
            AlConsole.WriteLine(LauncherInfoScheme, $"Start Up RavenLauncher.");

            // Arguments Parse.
            ArgParser.Decomposition(args);

            // Make Status Folder
            StatusChecker.MakeStatusDir();

            // Setup
            if (!StatusChecker.IsDownloaded())
            {
                RavenSetupProcess.GitClone(Settings.ControllerRepoUrl, Settings.CloneDir, gitToken: Settings.GithubToken);
                RavenSetupProcess.BuildController(Settings.CloneDir);
                RavenSetupProcess.GitClone(Settings.ConfigRepoUrl, Settings.ConfigDir, gitToken: Settings.GithubToken);
                Settings.RecvFile.Create();
            }

            // Service Starter
            ScheduledTasks.Fire();
            AlConsole.WriteLine(LauncherCautScheme, "> Press Enter, Launcher to Stop. <");
            Console.ReadLine();
            AlConsole.WriteLine(LauncherCautScheme, "Stopped Launcher.");
        }
        public static void OnLoadEvent(MongoClient client)
        {
            AlExtension.ColorizeWriteLine(LogIndex.CONFIG_INFORMATION, "-->^ FIRST INITIALIZATION.", new [] { ConsoleColor.Blue, ConsoleColor.Green });

            List <string> configFolders = _ConfigFolderDir();
            Dictionary <string, string[]> configFiles = _ConfigFileDir(configFolders);
            Dictionary <string, Dictionary <string, ConfigScheme> > groupedDict = new Dictionary <string, Dictionary <string, ConfigScheme> >();

            foreach (KeyValuePair <string, string[]> fileComponent in configFiles)
            {
                Dictionary <string, ConfigScheme> loadedDict = new Dictionary <string, ConfigScheme>();
                AlExtension.ColorizeWriteLine(LogIndex.CONFIG_INFORMATION, $"Parse Group [ ^{fileComponent.Key.Substring(GeneralSettings.ConfigDir.Length)}^ ]",
                                              new [] { ConsoleColor.Green, ConsoleColor.Cyan, ConsoleColor.Green });
                // AlConsole.WriteLine(CONFIG_INFORMATION, $"Parse Group [ {fileComponent.Key.Substring(Settings.ConfigDir.Length)} ]");
                foreach (string file in fileComponent.Value)
                {
                    using (StreamReader reader = new StreamReader(file)) {
                        string       raw        = reader.ReadToEnd();
                        ConfigScheme clazzParse = Toml.ReadString <ConfigScheme>(raw);
                        AlExtension.ColorizeWriteLine(LogIndex.CONFIG_INFORMATION, $"{clazzParse.Profile.Name + ".toml", 32}^ => Parsed!",
                                                      new [] { ConsoleColor.Magenta, ConsoleColor.Green });
                        // AlConsole.WriteLine(CONFIG_INFORMATION, $"{clazzParse.Profile.Name + ".toml", 32} => Parsed!");
                        loadedDict.Add(clazzParse.Profile.DBName, clazzParse);
                    }
                }
                groupedDict.Add(fileComponent.Key.Substring(GeneralSettings.ConfigDir.Length), loadedDict);
            }
            AlConsole.WriteLine(LogIndex.CONFIG_INFORMATION, $"Loaded All Config Operational!");
            AlExtension.ColorizeWriteLine(LogIndex.CONFIG_INFORMATION, "-->^ SECOND INITIALIZATION.", new [] { ConsoleColor.Blue, ConsoleColor.Green });
            // AlConsole.WriteLine(CONFIG_INFORMATION, "-> Second Initialization.");
            GenerateDataBaseProperty(client, groupedDict);
            AlConsole.WriteLine(LogIndex.CONFIG_INFORMATION, $"Generated DataBase Property from Loaded Config.");
        }
        public static List <string> GetCollectionNames(MongoClient client, string databaseName)
        {
            IMongoDatabase database        = client.GetDatabase(databaseName);
            List <string>  collectionNames = database.ListCollectionNames().ToList();

            AlConsole.WriteLine(DB_INFO_C, $"Requested {databaseName, MaxIndex} | {"CountCollection(s) [" + collectionNames.Count + "]", MaxIndex} |");
            return(collectionNames);
        }
Example #5
0
 public static void Fire()
 {
     AlConsole.WriteLine(LauncherInfoScheme, "Service Fired (*´ω`*)");
     //_timer = new Timer(60 * 60 * 1000);
     _timer          = Settings.IsMaintenanceMode ? new Timer(60 * 1000) : new Timer(60 * 60 * 1000);
     _timer.Elapsed += new ElapsedEventHandler(OnTimeEvent);
     _timer.Start();
     CollectStart();
 }
 public static void ColorizeWrite(AlCConfigScheme preset, string message, ConsoleColor[] colors, bool isAlConsole = true) {
     if (isAlConsole) { AlConsole.Write(preset, ""); }
     string[] disParsedMessage = message.Split("^");
     for (int i = 0; i < disParsedMessage.Length; i++) {
         Console.ForegroundColor = colors[i];
         Console.Write(disParsedMessage[i]);
     }
     Console.ResetColor();
 }
Example #7
0
 private static void Interval()
 {
     AlConsole.Write(AlStatusEnum.Caution, $"{"Recovery Booting", 16}", $"{"Launcher", 16}", "Interval.");
     for (int i = 0; i < 10; i++)
     {
         Thread.Sleep(1000);
         Console.Write(".");
     }
     Console.Write("\n");
 }
        public static List <UpcomingScheme> GetDocuments(MongoClient client, string databaseName, string collectionName)
        {
            List <UpcomingScheme>             schemes            = new List <UpcomingScheme>();
            IMongoCollection <UpcomingScheme> upcomingCollection = ConnectDataBase(client, databaseName, collectionName);
            IAggregateFluent <UpcomingScheme> aggregateObject    = upcomingCollection.Aggregate();

            schemes = aggregateObject.ToList();

            AlConsole.WriteLine(DB_INFO_C, $"Requested {databaseName, MaxIndex} | {collectionName, MaxIndex} |");

            return(schemes);
        }
Example #9
0
 public static void SetBundleDict(Dictionary <string, Item> dictJsonScheme, Dictionary <string, ExtendItem> dictExtendItem)
 {
     foreach (KeyValuePair <string, Item> value in dictJsonScheme)
     {
         try {
             _bundleDictionary.Add(value.Value, dictExtendItem[value.Key]);
         } catch (Exception e) {
             AlConsole.WriteLine(DefaultScheme.SORTLOG_WARN_SCHEME, "結合する辞書内に対応する値が見つかりません。");
             continue;
         }
     }
 }
Example #10
0
 public static void ExpandWrite(RefactorScheme schemes)
 {
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, "以下のデータをコレクションに格納します。");
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $"生放送予定枠:");
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" => UUID          : {schemes._id}");
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" => タイトル    :{schemes.Title}");
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" => チャンネル名  :{schemes.ChannelName}");
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" => チャンネルID :{schemes.ChannelId}");
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" ");
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" ================================================ ");
     AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" ");
 }
Example #11
0
        public static void BuildController(string clonePath)
        {
            AlConsole.WriteLine(BuildInfoScheme, "ビルドを開始します。");
            int statusCode = RavenAppBuilder.Build(clonePath, true);

            if (statusCode != 0)
            {
                AlConsole.WriteLine(BuildFailureScheme, "ビルドに失敗しました。");
                AlConsole.WriteLine(BuildFailureScheme, $"ステータスコード : [{statusCode}]");
                Environment.Exit(-1);
            }
            AlConsole.WriteLine(BuildInfoScheme, "ビルドに成功。");
        }
Example #12
0
        public static void Fire()
        {
            AlConsole.WriteLine(LauncherInfoScheme, "Service Fired (*´ω`*)");
            //_timer = new Timer(60 * 60 * 1000);
#if DEBUG
            _timer = new Timer(60 * 1000);
#else
            _timer = new Timer(60 * 60 * 1000);
#endif
            _timer.Elapsed += new ElapsedEventHandler(OnTimeEvent);
            _timer.Start();
            CollectStart();
        }
        public static void Insert(MongoClient client, List <RefactorScheme> schemeList)
        {
            // Start Initialization
            AlConsole.WriteLine(DefaultScheme.DB_INITIALIZE_SCHEME, $"初期化を開始します。");

            foreach (KeyValuePair <IMongoDatabase, Dictionary <string, IMongoCollection <RefactorScheme> > > collection in LoadedComponent.GetAllCollections())
            {
                AlExtension.ColorizeWriteLine(DefaultScheme.DB_INITIALIZE_SCHEME, $" ┏ ^DataBase  ^: ^{collection.Key.DatabaseNamespace.DatabaseName}",
                                              new [] { ConsoleColor.DarkGray, ConsoleColor.Green, ConsoleColor.DarkGray, ConsoleColor.Magenta });
                // AlConsole.WriteLine(DefaultScheme.DB_INITIALIZE_SCHEME, $" ┏ DataBase  : {collection.Key.DatabaseNamespace.DatabaseName}");
                foreach (KeyValuePair <string, IMongoCollection <RefactorScheme> > collectionDict in collection.Value)
                {
                    Initialization(collection.Key, collectionDict.Key);
                }
            }

            AlExtension.ColorizeWriteLine(DefaultScheme.DB_INITIALIZE_SCHEME, $" ┗ ^全ての初期化が終了しました。",
                                          new [] { ConsoleColor.DarkGray, ConsoleColor.Green });

            // AlConsole.WriteLine(DefaultScheme.DB_INITIALIZE_SCHEME, $" ┗ 全ての初期化が終了しました。");
            AlConsole.WriteLine(DefaultScheme.DB_INITIALIZE_SCHEME, $"初期化しました。");

            // Start Insert Data

            AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, "以下の回収したデータをコレクションに格納します。");
            AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" + List");
            AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" +---------------------+---------------------+---------------------+ ");
            AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" | -> | UUID     | VideoId     | ChannelId                | ChannelName             ");

            schemeList.ForEach(scheme => {
                AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY,
                                    $"   >>   {scheme._id.Substring(0, 8)} | " +
                                    $"{scheme.VideoId} | {scheme.ChannelId} | {scheme.ChannelName}"
                                    );
            });

            AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $" +---------------------+---------------------+---------------------+ ");
            AlConsole.Write(DefaultScheme.DB_IN_DATA_SCHEME_STBY, $"Inserting Data... [ 0   % ]");
            int progress = Math.Abs(100 / schemeList.Count);
            int count    = 1;

            schemeList.ForEach(schemes => {
                Console.CursorLeft    = 84;
                string searchedObject = LoadedComponent.GetDataBaseName(schemes.ChannelId);
                LoadedComponent.GetCollection()[searchedObject].InsertOne(schemes);
                Console.Write(progress * count);
                count++;
            });
            Console.Write("\n");
            AlConsole.WriteLine(DefaultScheme.DB_IN_DATA_SCHEME_COMP, "全ての挿入が成功しました。");
        }
Example #14
0
        public static async Task <string> RequestStartTimeAsync(HttpClient client, string videoIds /*string[] videoId */)
        {
            Uri url = new Uri("https://www.googleapis.com/youtube/v3/videos?")
                      .AddQuery("part", "liveStreamingDetails")
                      .AddQuery("key", getToken())
                      .AddQuery("id", videoIds);
            //.AddArrayQuery("id", videoId);
            string res = ReSpell.Execute(5, 5,
                                         () => client.GetStringAsync(url).Result,
                                         (c) => AlConsole.WriteLine(DefaultScheme.REQUEST_SCHEME, $"Retry Request... [ Count: {c}]"));

            //foreach (string value in videoId) {
            //    AlConsole.WriteLine(DefaultScheme.REQUEST_SCHEME, $"  #-- {value, 15}");
            //}
            Settings.UseQuota += 8;
            return(res);
        }
Example #15
0
        public static void Main(string[] args)
        {
            // Arguments Parse.
            ArgParser.Decomposition(args);

            // Config Setup
            if (!Settings.DoSkipConfigGenerate)
            {
                ConfigExporter.onTemplateGenerate();
            }

            ConfigModel config = ConfigImporter.onDeserialize();

            Settings.DataBaseUserName = config.DB_ACCESS_USERNAME;
            Settings.DataBasePassWord = config.DB_ACCESS_PASSWORD;
            Settings.IgnoreDataArray  = string.Join(',', config.ignoreData);

            // Make Status Folder
            StatusChecker.MakeStatusDir();

            // Start Message
            AlConsole.WriteLine(LauncherInfoScheme, $"Start Up RavenLauncher.");

            ScheduledTasks.Fire();
            AlConsole.WriteLine(LauncherCautScheme, "> Press Enter, Launcher to Stop. <");
            Console.ReadLine();
            AlConsole.WriteLine(LauncherCautScheme, "Stopped Launcher.");

            /*
             * // Arguments Parse.
             * ArgParser.Decomposition(args);
             *
             *
             * // Setup
             * if (!StatusChecker.IsDownloaded()) {
             *  RavenSetupProcess.BuildController(Settings.CloneDir);
             *  Settings.RecvFile.Create();
             * }
             *
             * // Service Starter
             * ScheduledTasks.Fire();
             * AlConsole.WriteLine(LauncherCautScheme, "> Press Enter, Launcher to Stop. <");
             * Console.ReadLine();
             * AlConsole.WriteLine(LauncherCautScheme, "Stopped Launcher.");
             */
        }
Example #16
0
        public static void GitClone(string repoUrl, string clonePath, [Optional] string gitToken)
        {
            CloneOptions options = new CloneOptions()
            {
                CredentialsProvider = (a, b, c) => new UsernamePasswordCredentials()
                {
                    Username = gitToken ?? Settings.GithubUserName,
                    Password = gitToken != null ? String.Empty : Settings.GithubPassWord
                }
            };

            try {
                AlConsole.WriteLine(CloneInfoScheme, $"クローンを開始します。[ {repoUrl.Substring(37).Replace(".git", "")} ]");
                Repository.Clone(repoUrl, clonePath, options);
                AlConsole.WriteLine(CloneInfoScheme, "クローンに成功しました。");
            } catch (Exception e) {
                AlConsole.WriteLine(CloneFailureScheme, "クローンに失敗しました。");
                Console.WriteLine(e.StackTrace);
                Environment.Exit(-1);
            }
        }
Example #17
0
        private static void OnTimeEvent(object obj, ElapsedEventArgs eventArgs)
        {
            _timer.Start();
            AlConsole.WriteLine(RunCollectorScheme, "Collect Start");
            int statusCode = CollectStart();

            if (statusCode != 0)
            {
                AlConsole.WriteLine(FailureCollectScheme, "コントローラーの起動に失敗しました。");
                Interval();
                if (!StatusChecker.IsRecoveryMode())
                {
                    Settings.RecvFile.Create();
                }
                using (StreamWriter writer = new StreamWriter(Settings.StatusDir + Settings.RecoveryStat, true)) {
                    writer.Write($"Recovery Boot Time:{DateTime.Now:g}\n");
                    AlConsole.WriteLine(RecoveryBootScheme, "コントローラーを再起動します。");
                    for (int i = 0; i < 5; i++)
                    {
                        statusCode = CollectStart();
                        if (statusCode != 0)
                        {
                            AlConsole.WriteLine(FailureCollectScheme, "コントローラーの再起動に失敗しました。");
                            AlConsole.WriteLine(FailureCollectScheme,
                                                i < 4 ? $"リトライします。[{i + 1}]" : $"起動に{i + 1}回失敗しました。強制終了します。");
                            Interval();
                            writer.Write($"Recovery Boot Time:{DateTime.Now:g}\n");
                        }
                        else
                        {
                            AlConsole.WriteLine(FailureCollectScheme, $"リカバリーに成功しました。");
                            writer.Write($"Successfully Recovery Boot Time:{DateTime.Now:g}\n");
                            break;
                        }
                    }
                }
            }
            AlConsole.WriteLine(RunCollectorScheme, "Collect Finished Successfully!");
            AlConsole.WriteLine(LauncherInfoScheme, "Set Next Scheduled!");
        }
Example #18
0
        public static void Decomposition(string[] targetArgs)
        {
            try {
                for (int i = 0; i < targetArgs.Length; i++)
                {
                    switch (targetArgs[i])
                    {
                    case "--user":
                        Settings.DataBaseUserName = targetArgs[++i];
                        break;

                    case "--pass":
                        Settings.DataBasePassWord = targetArgs[++i];
                        break;

                    case "--local":
                        Settings.DataBaseIsLocal = targetArgs[++i].Equals("true");
                        break;

                    case "--ismaintenance":
                        Settings.IsMaintenanceMode = true;
                        break;

                    case "--githubusername":
                        Settings.GithubUserName = targetArgs[++i];
                        break;

                    case "--githubpassword":
                        Settings.GithubPassWord = targetArgs[++i];
                        break;

                    case "--githubtoken":
                        Settings.GithubToken = targetArgs[++i];
                        break;
                    }
                }
            } catch (IndexOutOfRangeException) {
                AlConsole.WriteLine(AlStatusEnum.Error, "ArgExcp", "Arg Parser", "Arguments is incorrect.");
            }
        }
        public static void Decomposition(string[] targetArgs)
        {
            try {
                for (int i = 0; i < targetArgs.Length; i++)
                {
                    switch (targetArgs[i])
                    {
                    case "--user":
                        Settings.User = targetArgs[++i];
                        break;

                    case "--pass":
                        Settings.Pass = targetArgs[++i];
                        break;

                    case "--local":
                        Settings.isLocal = targetArgs[++i].Equals("true");
                        break;

                    case "--ignore":
                        Settings.IgnoreVideoId = targetArgs[++i].Split(',').ToList();
                        break;

                    case "--freechat":
                        Settings.OutputFreeChatVideoId = true;
                        break;

                    default:
                        AlConsole.WriteLine(AlStatusEnum.Warning, "ArgExcp", "Arg Parser", $"Unknown Argument: {targetArgs[i]}");
                        break;
                    }
                }
            } catch (IndexOutOfRangeException) {
                AlConsole.WriteLine(AlStatusEnum.Error, "ArgExcp", "Arg Parser", "Arguments is incorrect.");
            }
        }
 public static void PrintCaut(string msg)
 {
     AlConsole.WriteLine(ClientSide.Caution, msg);
 }
 public static void PrintWarn(string msg)
 {
     AlConsole.WriteLine(ClientSide.Warning, msg);
 }
 public static void PrintErr(string msg)
 {
     AlConsole.WriteLine(ClientSide.Error, msg);
 }
 public static void PrintCrit(string msg)
 {
     AlConsole.WriteLine(ClientSide.Critical, msg);
 }
 public static void PrintDebug(string msg)
 {
     AlConsole.WriteLine(ClientSide.Verbose, msg);
 }
 public static void PrintInfo(string msg)
 {
     AlConsole.WriteLine(ServerSide.Information, msg);
 }
        // ReSharper disable all PossibleMultipleEnumeration
        static void Main(string[] args)
        {
            Console.CursorVisible = false;
            Settings.StartupTime  = DateTime.Now;
            AlExtension.ArrayWrite(START_UP, Settings.Startup);

            ArgumentParser.Decomposition(args);

            //Thread.Sleep(50000);

            // Set Client for Environment (Windows or Linux).
            _mongoClient = Settings.isLocal
                ? new MongoClient($"mongodb://{Settings.User}:{Settings.Pass}@124.0.0.1")
                : new MongoClient($"mongodb://{Settings.User}:{Settings.Pass}@{Settings.NekomataAws}");

            ConfigLoader.OnLoadEvent(_mongoClient);

            // Set Http Client. (For Reuse)
            // HttpClient isn't disposable, but is designed to "For Reuse".
            HttpClient httpClient = new HttpClient();

            // Send Request to YoutubeAPI.
            LoadedComponent.GetChannelId().ForEach(channelId => {
                string result = Task.Run(() => YoutubeAPIResponce.requestAsync(httpClient, channelId)).Result;
                //Thread.Sleep(3000);
                ListAggregation.SetResultList(result);
            });

            //ProductionHoloLive.GetAllKey().ForEach(channelId => {
            //    string result = Task.Run(() => YoutubeAPIResponce.requestAsync(httpClient, channelId)).Result;
            //    ListAggregation.SetResultList(result);
            //});

            // Finish Message
            AlConsole.WriteLine(DefaultScheme.RESPONCE_SCHEME, $"Success. Number of Request ({ListAggregation.GetResultList().Count})");

            // Youtube Response Json Deserialize
            ListAggregation.GetResultList().ForEach(result => {
                JsonScheme scheme = JsonConvert.DeserializeObject <JsonScheme>(result);
                ListAggregation.SetJsonSchemeDict(scheme);
            });

            // Result List Re-Initialize.
            ListAggregation.ResultListInit();

            IEnumerable <string> videoIdEnum = ListAggregation.GetVideoIdList().AsEnumerable <string>();

            // Because it is possible to save Quota,
            // When I search for 50 items in a batch, I can add 50 VideoId to the Dictionary<page number(int), VideoId(string)> as a lump organized into.
            // Send Request to YoutubeAPI. (Start Time for ScheduleLive)
            AlConsole.WriteLine(DefaultScheme.REQUEST_SCHEME, "Extend Information Request...");
            while (videoIdEnum.Any())
            {
                string   requestIds = String.Join(",", videoIdEnum.Take <string>(50));
                string[] sliced     = videoIdEnum.ToArray <string>();
                string   startTime  = Task.Run(() => YoutubeAPIResponce.RequestStartTimeAsync(httpClient, requestIds)).Result;
                for (int i = 0; i < (sliced.Length % 50 > 0 ? sliced.Length / 50 + 1 : sliced.Length / 50); i++)
                {
                    for (int j = 0; j < 5; j++)
                    {
                        AlExtension.ColorizeWrite(REQUEST_SCHEME, $"  #-- ^[ ", new [] { ConsoleColor.DarkGray, ConsoleColor.Green });
                        AlExtension.ColorizeWrite(REQUEST_SCHEME, String.Join(", ", sliced.Take(5)),
                                                  new [] { ConsoleColor.Magenta }, false);
                        AlExtension.ColorizeWriteLine(REQUEST_SCHEME, $" ]", new [] { ConsoleColor.Green }, false);
                        sliced = sliced.Skip <string>(5).ToArray();
                    }
                }
                // foreach (string splitValue in requestIds.Split(",")) {
                //     AlConsole.WriteLine(DefaultScheme.REQUEST_SCHEME, $"  #-- {splitValue, 15}");
                // }
                // string startTime = Task.Run(() => YoutubeAPIResponce.RequestStartTimeAsync(httpClient, requestIds)).Result;
                ListAggregation.SetResultList(startTime);
                videoIdEnum = videoIdEnum.Skip <string>(50);
            }

            // Finish Message
            AlConsole.WriteLine(DefaultScheme.RESPONCE_SCHEME, "Success.");

            // Youtube Response Json Deserialize
            ListAggregation.GetResultList().ForEach(result => {
                StartTimeScheme scheme = JsonConvert.DeserializeObject <StartTimeScheme>(result);
                ListAggregation.SetTimeScheme(scheme);
            });

            // Link JsonScheme and ExtendItem whose VideoId is the same.
            ListCombination.Scheme.SetBundleDict(ListAggregation.GetJsonSchemeList(), ListAggregation.GetTimeScheme());

            // Organize necessary information and put it into a RefactorScheme and store it in List(RefactorScheme).

            /*
             * ReSpell.Execute(5, 5,
             *  () => { SchemeOrthopedy.BundleModification(ListCombination.Scheme.GetBundleDict()); }, (count) => {
             *      AlConsole.Write(AlStatusEnum.Caution, $"{"TASK RESUMED", -15}", $"{"Data Bundler", -15}",
             *          "Failed to execute the task. Task will try again.");
             *      Console.CursorLeft = 0;
             *  }, (count) => {
             *      AlConsole.WriteLine(AlStatusEnum.Error, $"{"TASK FAILURE", -15}", $"{"Data Bundler", -15}",
             *          $"Failed to execute the task. TryCount: {count, -10}\n");
             *  }); */
            SchemeOrthopedy.BundleModification(ListCombination.Scheme.GetBundleDict());

            AlConsole.WriteLine(SORTLOG_SCHEME, $"{" ", -63}");
            AlConsole.WriteLine(SORTLOG_SCHEME, "既に終了していたライブ : 以下のものは挿入タスクから除外されます。");
            AlConsole.WriteLine(SORTLOG_SCHEME, "----------------------------- 対象 -----------------------------");
            foreach (KeyValuePair <string, string> liveData in SchemeOrthopedy.GetFinishedLivesDict())
            {
                AlExtension.ColorizeWriteLine(SORTLOG_SCHEME, $"[ ^{liveData.Key} ^] => \"^{liveData.Value}^\"",
                                              new [] { ConsoleColor.Green, ConsoleColor.Blue, ConsoleColor.Green, ConsoleColor.Gray, ConsoleColor.Green });
            }

            // foreach (string lives in SchemeOrthopedy.GetFinishedLives()) {
            //     AlConsole.WriteLine(SORTLOG_SCHEME, lives);
            // }

            AlConsole.WriteLine(SORTLOG_SCHEME, " ");
            AlConsole.WriteLine(SORTLOG_SCHEME, "フリーチャット専用枠 : 以下のものは挿入タスクから除外されます。");
            AlConsole.WriteLine(SORTLOG_SCHEME, "----------------------------- 対象 -----------------------------");
            foreach (KeyValuePair <string, string> liveData in SchemeOrthopedy.GetFreeChatLivesDict())
            {
                AlExtension.ColorizeWriteLine(SORTLOG_SCHEME, $"[ ^{liveData.Key} ^] => \"^{liveData.Value}^\"",
                                              new [] { ConsoleColor.Green, ConsoleColor.Blue, ConsoleColor.Green, ConsoleColor.Gray, ConsoleColor.Green });
            }

            string free = string.Join(',', SchemeOrthopedy.GetFreeChatLivesDict().Keys);

            AlConsole.WriteLine(SORTLOG_SCHEME, " ");
            AlConsole.WriteLine(SORTLOG_SCHEME, "遅刻ライブ : 以下のものは挿入タスクに追加されます。");
            AlConsole.WriteLine(SORTLOG_SCHEME, "----------------------------- 対象 -----------------------------");
            if (SchemeOrthopedy.GetLazyLivesDict().Count != 0)
            {
                foreach (KeyValuePair <string, string> liveData in SchemeOrthopedy.GetLazyLivesDict())
                {
                    AlExtension.ColorizeWriteLine(SORTLOG_SCHEME, $"[ ^{liveData.Key} ^] => \"^{liveData.Value}^\"",
                                                  new [] { ConsoleColor.Green, ConsoleColor.Blue, ConsoleColor.Green, ConsoleColor.Gray, ConsoleColor.Green });
                }
            }
            else
            {
                AlConsole.WriteLine(SORTLOG_SCHEME, "遅刻ライブはありません。");
            }

            AlConsole.WriteLine(SORTLOG_SCHEME, " ");
            // foreach (string lives in SchemeOrthopedy.GetFreeChatLives()) {
            //     AlConsole.WriteLine(SORTLOG_SCHEME, lives);
            // }

            // Serialize the organized information.
            SchemeOrthopedy.GetSchemes().ForEach(i => {
                serializedObject.Add(JsonConvert.SerializeObject(i));
            });

            // Displays serialized information.
            serializedObject.ForEach(i => AlConsole.WriteLine(DefaultScheme.SERIALIZELOG_SCHEME, $"{i.ToString().Substring(0, 64), -67}" + "......[OMT]"));

            // Send the serialize object to Database.
            DataBaseCollection.Insert(_mongoClient, SchemeOrthopedy.GetSchemes());

            // Controller Task Finish Message
            long progressTicks = DateTime.Now.Ticks - Settings.StartupTime.Ticks;

            AlConsole.WriteLine(CONTROLLER,
                                $"Task Finished ! / {progressTicks} Ticks" +
                                $" ({TimeSpan.FromTicks(progressTicks).Seconds} Sec)"
                                );
            AlConsole.WriteLine(CONTROLLER, $"Number of Scheduled Live => {SchemeOrthopedy.GetSchemes().Count}");
            AlConsole.WriteLine(CONTROLLER, $"             Usage Quota => {Settings.UseQuota}");
            AlConsole.WriteLine(CONTROLLER, $"  Validated Caution Data => {Settings.CautData}");
            AlConsole.WriteLine(CONTROLLER, $"  Validated Warning Data => {Settings.WarnData}");
            AlConsole.WriteLine(CONTROLLER, "Have a good live broadcast today !");

            if (Settings.OutputFreeChatVideoId)
            {
                Console.WriteLine(free);
            }
        }