Ejemplo n.º 1
0
        /// <summary>
        /// Упаковка манги.
        /// </summary>
        public virtual void Compress()
        {
            var folder = this.GetAbsoluteFolderPath();

            if (!Directory.Exists(folder))
            {
                return;
            }

            Log.Info(Strings.Mangas_Compress_Started + this.Name);
            switch (this.CompressionMode)
            {
            case Compression.CompressionMode.Manga:
                Compression.CompressManga(folder);
                break;

            case Compression.CompressionMode.Volume:
                Compression.CompressVolumes(folder);
                break;

            case Compression.CompressionMode.Chapter:
                Compression.CompressChapters(folder);
                break;

            case null:
                throw new InvalidEnumArgumentException("CompressionMode is null", -1, typeof(Compression.CompressionMode));

            default:
                throw new InvalidEnumArgumentException(nameof(CompressionMode), (int)this.CompressionMode, typeof(Compression.CompressionMode));
            }
            Log.Info(Strings.Mangas_Compress_Completed);
        }