diff --git a/MyCBZ/App.config b/MyCBZ/App.config index d9eff7e3..0c8b4b90 100644 --- a/MyCBZ/App.config +++ b/MyCBZ/App.config @@ -135,7 +135,7 @@ - 0.19.149b + 0.19.150b diff --git a/MyCBZ/Data/AddImagesThreadParams.cs b/MyCBZ/Data/AddImagesThreadParams.cs index 92db1037..bffc73f3 100644 --- a/MyCBZ/Data/AddImagesThreadParams.cs +++ b/MyCBZ/Data/AddImagesThreadParams.cs @@ -16,5 +16,9 @@ internal class AddImagesThreadParams : ThreadParam public MetaData.PageIndexVersion PageIndexVerToWrite { get; set; } = MetaData.PageIndexVersion.VERSION_1; public string[] InvalidFileNames { get; set; } = new string[0]; + + public string[] FilterExtensions { get; set; } = new string[0]; + + public int MaxCountPages { get; set; } = 0; } } diff --git a/MyCBZ/Data/ParseFilesThreadParams.cs b/MyCBZ/Data/ParseFilesThreadParams.cs index 29a0e84d..9fcf6d5e 100644 --- a/MyCBZ/Data/ParseFilesThreadParams.cs +++ b/MyCBZ/Data/ParseFilesThreadParams.cs @@ -16,6 +16,10 @@ internal class ParseFilesThreadParams : ThreadParam public bool HasMetaData { get; set; } + public int MaxCountPages { get; set; } = 0; + + public List Pages { get; set; } + public MetaData.PageIndexVersion PageIndexVerToWrite { get; set; } = MetaData.PageIndexVersion.VERSION_1; public bool ContinuePipeline { get; set; } diff --git a/MyCBZ/Forms/MainForm.cs b/MyCBZ/Forms/MainForm.cs index ec0588d1..ea9b1bb5 100644 --- a/MyCBZ/Forms/MainForm.cs +++ b/MyCBZ/Forms/MainForm.cs @@ -2563,8 +2563,9 @@ private void PagesList_AfterLabelEdit(object sender, LabelEditEventArgs e) Program.ProjectModel.MetaData.UpdatePageIndexMetaDataEntry((Page)changedItem.Tag, ((Page)changedItem.Tag).Key); - AppEventHandler.OnPageChanged(sender, new PageChangedEvent(((Page)changedItem.Tag), null, PageChangedEvent.IMAGE_STATUS_RENAMED)); - AppEventHandler.OnArchiveStatusChanged(sender, new CBZArchiveStatusEvent(Program.ProjectModel, CBZArchiveStatusEvent.ARCHIVE_FILE_UPDATED)); + // dont fire events again! + //AppEventHandler.OnPageChanged(sender, new PageChangedEvent(((Page)changedItem.Tag), null, PageChangedEvent.IMAGE_STATUS_RENAMED)); + //AppEventHandler.OnArchiveStatusChanged(sender, new CBZArchiveStatusEvent(Program.ProjectModel, CBZArchiveStatusEvent.ARCHIVE_FILE_UPDATED)); } catch (PageDuplicateNameException eduplicate) { @@ -2661,7 +2662,7 @@ private void MoveItemsTo(int newIndex, System.Windows.Forms.ListView.SelectedLis NewIndex = newIndex, Items = items, PageIndexVersion = MetaDataVersionFlavorHandler.GetInstance().HandlePageIndexVersion(), - CancelToken = CancellationTokenSourceMoveItems.Token + CancelToken = CancellationTokenSourceMoveItems.Token, }); } diff --git a/MyCBZ/Models/ProjectModel.cs b/MyCBZ/Models/ProjectModel.cs index 3c6e8de3..ff6701d0 100644 --- a/MyCBZ/Models/ProjectModel.cs +++ b/MyCBZ/Models/ProjectModel.cs @@ -302,13 +302,16 @@ private void HandlePipeline(object sender, PipelineEvent e) } } + AddImagesThreadParams p = nextTask.ThreadParams as AddImagesThreadParams; + ProcessAddedFiles = new Thread(AddImagesProc); - ProcessAddedFiles.Start(new AddImagesThreadParams() - { - LocalFiles = new List((IEnumerable)e.Data), + ProcessAddedFiles.Start(new AddImagesThreadParams() + { + LocalFiles = new List((IEnumerable)e.Data), Stack = remainingStack, InvalidFileNames = FilteredFileNames.ToArray(), - CancelToken = CancellationTokenSourceProcessAddedFiles.Token + CancelToken = CancellationTokenSourceProcessAddedFiles.Token, + MaxCountPages = p.MaxCountPages, }); currentPerformed = e.Task; @@ -807,6 +810,7 @@ protected void OpenArchiveProc(object threadParams) else { MetaDataPageIndexFileMissing = true; + MetaDataPageIndexMissingData = true; IndexUpdateReasonMessage = "Image metadata missing from pageindex! Reload image metadata and rebuild pageindex now?"; MessageLogger.Instance.Log(LogMessageEvent.LOGMESSAGE_TYPE_WARNING, "Warning! Archive page metadata missing for page [" + page.Name + "]!"); } @@ -1896,8 +1900,8 @@ public void AddImagesProc(object threadParams) { AddImagesThreadParams tParams = threadParams as AddImagesThreadParams; - int index = MaxFileIndex; - int realNewIndex = MaxFileIndex; + int index = tParams.MaxCountPages; + int realNewIndex = tParams.MaxCountPages; int total = tParams?.LocalFiles.Count ?? 0; int progressIndex = 0; bool pageError = false; @@ -1918,6 +1922,13 @@ public void AddImagesProc(object threadParams) continue; } + if (tParams.FilterExtensions.Contains(localPath.Extension.ToLower())) + { + MessageLogger.Instance.Log(LogMessageEvent.LOGMESSAGE_TYPE_WARNING, "Skipping file ['" + localPath.Name + "'] because of filtered file-extension ['" + localPath.Extension.ToLower() + "']!"); + + continue; + } + targetPath = MakeNewTempFileName(); //CopyFile(fileObject.FullPath, targetPath.FullName); @@ -2037,6 +2048,8 @@ public void ParseFiles(List files) HasMetaData = MetaData.Exists(), PageIndexVerToWrite = PageIndexVersionWriter, CancelToken = CancellationTokenSourceParseAddedFileNames.Token, + Pages = Pages, + MaxCountPages = Pages.Count, }); } @@ -2090,6 +2103,7 @@ public void ParseFilesProc(object threadParams) { LocalFiles = files.ToList(), PageIndexVerToWrite = tParams.PageIndexVerToWrite, + MaxCountPages = tParams.MaxCountPages, } }, new StackItem @@ -2099,6 +2113,7 @@ public void ParseFilesProc(object threadParams) { ContinuePipeline = true, InitialIndexRebuild = false, + Pages = tParams.Pages, } } }; diff --git a/MyCBZ/Win_CBZ.csproj b/MyCBZ/Win_CBZ.csproj index 2d0418c1..c08d8adf 100644 --- a/MyCBZ/Win_CBZ.csproj +++ b/MyCBZ/Win_CBZ.csproj @@ -21,7 +21,7 @@ false true 0 - 0.19.149.%2a + 0.19.150.%2a false true false diff --git a/MyCBZ/Win_CBZSettings.Designer.cs b/MyCBZ/Win_CBZSettings.Designer.cs index 0d2ad224..6affb305 100644 --- a/MyCBZ/Win_CBZSettings.Designer.cs +++ b/MyCBZ/Win_CBZSettings.Designer.cs @@ -37,7 +37,7 @@ public string TempFolderPath { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0.19.149b")] + [global::System.Configuration.DefaultSettingValueAttribute("0.19.150b")] public string Version { get { return ((string)(this["Version"])); diff --git a/MyCBZ/Win_CBZSettings.settings b/MyCBZ/Win_CBZSettings.settings index 7aec7ad9..7ec521ee 100644 --- a/MyCBZ/Win_CBZSettings.settings +++ b/MyCBZ/Win_CBZSettings.settings @@ -6,7 +6,7 @@ %APPDATA%\WIN_CBZ\Temp\ - 0.19.149b + 0.19.150b <?xml version="1.0" encoding="utf-16"?> diff --git a/Readme.md b/Readme.md index fcc8a0dc..f67123b5 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ # Win_CBZ -![Screenshot](/meta/Screenshot.jpg) +![Screenshot](/meta/Screenshot.png) ## Author @@ -48,7 +48,7 @@ Microsoft Visual Studio [Community] 2022 (64-Bit) ## Latest Release -v0.19.149b released! +v0.19.150b released! ## Third party components diff --git a/Win_CBZ-Setup/Win_CBZ-Setup.vdproj b/Win_CBZ-Setup/Win_CBZ-Setup.vdproj index b68e382e..d004d7f0 100644 --- a/Win_CBZ-Setup/Win_CBZ-Setup.vdproj +++ b/Win_CBZ-Setup/Win_CBZ-Setup.vdproj @@ -248,15 +248,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Win_CBZ" - "ProductCode" = "8:{9FF5D4E1-977E-4FF8-B9F7-6CD90B8E0696}" - "PackageCode" = "8:{60CEB024-3F05-41E9-86BD-02EEE26C709E}" + "ProductCode" = "8:{B383F08E-7C5E-40D2-9FEB-48C1A9E90986}" + "PackageCode" = "8:{C7E3D790-092C-42B0-B330-74EFFCC530F4}" "UpgradeCode" = "8:{66FAEF81-1CAE-4971-9E0F-796310EFEA5E}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:FALSE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:0.19.149" + "ProductVersion" = "8:0.19.150" "Manufacturer" = "8:Trash_s0Ft" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" diff --git a/meta/screenshot.png b/meta/screenshot.png new file mode 100644 index 00000000..b623be96 Binary files /dev/null and b/meta/screenshot.png differ