Example #1
0
        public async Task <ApiResponse> Timefree(string programId)
        {
            return(await Execute(() =>
            {
                _timefreeProgress = 0;
                using (SqliteConnection)
                {
                    var pModel = new ProgramModel(SqliteConnection);
                    var program = pModel.Get(programId);

                    var cModel = new ConfigModel(SqliteConnection);
                    var config = cModel.Get();

                    if (program != null)
                    {
                        var rr = new RadikoRecorder(config)
                        {
                            ChangeProgress = (progress) =>
                            {
                                _timefreeProgress = progress;
                            }
                        };
                        rr.TimeFree(program);
                    }
                    Result.Result = true;
                }
            }));
        }