Example #1
0
        public void DecryptCourse(Course course)
        {
            if (course == null)
            {
                Utils.WriteRedText($"\t{course.Name} Folder does not exist");
                return;
            }

            Utils.WriteYellowText($"Decrypting '{course.Title} started ...");
            var courseFolder = DecryptFileHelper.GetCourseFolder(options.CoursesPath, course.Name);

            if (!courseFolder.Exists)
            {
                Utils.WriteRedText($"\t{course.Name} Folder does not exist");
            }
            {
                var modules = repository.GetModules(course.Name);
                modules.ForEach(module => CreateModule(module, course));
                if (options.RemoveFolderAfterDecryption)
                {
                    RemoveCourse(course);
                }
                Utils.WriteYellowText($"Decrypting '{course.Title}' complete");
            }
        }
Example #2
0
        private void RemoveCourse(Course course)
        {
            Utils.WriteCyanText($"Removing course '{course.Title}' from database.");
            repository.DeleteCourse(course.Name);
            Utils.WriteCyanText($"Deleting course '{course.Title}' folder.");
            var courseFolder = DecryptFileHelper.GetCourseFolder(options.CoursesPath, course.Name);

            courseFolder.Delete(recursive: true);
            Utils.WriteCyanText($"Removing course '{course.Title}' complete");
        }