<commit_before>﻿using RelhaxModpack.Database;
using RelhaxModpack.Utilities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace RelhaxModpack.Automation
{
    public abstract class PackageTransferTask : AutomationTask, IXmlSerializable
    {
        public string FilePath { get; set; } = string.Empty;

        public DatabasePackage DatabasePackage { get { return AutomationSequence.Package; } }

        public string WoTOnlineFolderVersion { get { return AutomationSequence.DatabaseManager.WoTOnlineFolderVersion; } }

        protected WebClient WebClient;

        protected bool TransferSuccess = false;

        #region Xml serialization
        public override string[] PropertiesForSerializationAttributes()
        {
            return base.PropertiesForSerializationAttributes().Concat(new string[] { nameof(FilePath) }).ToArray();
        }
        #endregion

        #region Task execution
        public override void ProcessMacros()
        {
            FilePath = ProcessMacro(nameof(FilePath), FilePath);
        }

        public override void ValidateCommands()
        {
            if (ValidateCommandTrue(string.IsNullOrEmpty(FilePath), string.Format("ExitCode {0}: FilePath is null/empty", ExitCode)))
                return;

            if (ValidateCommandTrue(DatabasePackage == null, string.Format("ExitCode {0}: DatabasePackage is null (This is an internal application error)", ExitCode)))
                return;

            if (ValidateCommandTrue(string.IsNullOrEmpty(AutomationSettings.BigmodsUsername), string.Format("ExitCode {0}: AutomationSettings.BigmodsUsername is null/empty", ExitCode)))
                return;

            if (ValidateCommandTrue(string.IsNullOrEmpty(AutomationSettings.BigmodsPassword), string.Format("ExitCode {0}: AutomationSettings.BigmodsPassword is null/empty", ExitCode)))
                return;
        }

        public override void ProcessTaskResults()
        {
            if (!ProcessTaskResultTrue(TransferSuccess, "The transfer reported a failure. Check the log for more information"))
                return;
        }
        #endregion
    }
}<commit_msg>fixed logic bug of ProcessTaskResults() for PackageTransferTask<commit_after>﻿using RelhaxModpack.Database;
using RelhaxModpack.Utilities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace RelhaxModpack.Automation
{
    public abstract class PackageTransferTask : AutomationTask, IXmlSerializable
    {
        public string FilePath { get; set; } = string.Empty;

        public DatabasePackage DatabasePackage { get { return AutomationSequence.Package; } }

        public string WoTOnlineFolderVersion { get { return AutomationSequence.DatabaseManager.WoTOnlineFolderVersion; } }

        protected WebClient WebClient;

        protected bool TransferSuccess = false;

        #region Xml serialization
        public override string[] PropertiesForSerializationAttributes()
        {
            return base.PropertiesForSerializationAttributes().Concat(new string[] { nameof(FilePath) }).ToArray();
        }
        #endregion

        #region Task execution
        public override void ProcessMacros()
        {
            FilePath = ProcessMacro(nameof(FilePath), FilePath);
        }

        public override void ValidateCommands()
        {
            if (ValidateCommandTrue(string.IsNullOrEmpty(FilePath), string.Format("ExitCode {0}: FilePath is null/empty", ExitCode)))
                return;

            if (ValidateCommandTrue(DatabasePackage == null, string.Format("ExitCode {0}: DatabasePackage is null (This is an internal application error)", ExitCode)))
                return;

            if (ValidateCommandTrue(string.IsNullOrEmpty(AutomationSettings.BigmodsUsername), string.Format("ExitCode {0}: AutomationSettings.BigmodsUsername is null/empty", ExitCode)))
                return;

            if (ValidateCommandTrue(string.IsNullOrEmpty(AutomationSettings.BigmodsPassword), string.Format("ExitCode {0}: AutomationSettings.BigmodsPassword is null/empty", ExitCode)))
                return;
        }

        public override void ProcessTaskResults()
        {
            if (!ProcessTaskResultFalse(TransferSuccess, "The transfer reported a failure. Check the log for more information"))
                return;
        }
        #endregion
    }
}
{'fraction_non_alphanumeric': 0.08305721228186437, 'fraction_numerical': 0.0017671747294013696, 'mean_word_length': 3.060986547085202, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3138195', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1096, 'n_words': 282}