From 34a10c484711a4dffd9c04c2141d3ed465557603 Mon Sep 17 00:00:00 2001 From: Eris Loona <142046400+ErisLoona@users.noreply.github.com> Date: Fri, 23 Aug 2024 10:44:55 +0200 Subject: [PATCH] added selection preferences - Added a drop-down that allows choosing between preferring scanlation groups based on who translated *most chapters in the entire manga* and *most up to each chapter*, defaulting to most in manga; the user can freely switch between modes to see which one they prefer - Fixed a minor bug that prevented the download button from correctly updating to indicate download progress --- Manga Library Manager.csproj | 2 +- .../PublishProfiles/FolderProfile.pubxml.user | 2 +- README.md | 3 +- mangaDownloader.Designer.cs | 73 +++++++----- mangaDownloader.cs | 112 ++++++++++++------ mangaDownloader.resx | 4 +- 6 files changed, 127 insertions(+), 69 deletions(-) diff --git a/Manga Library Manager.csproj b/Manga Library Manager.csproj index a4ccbb2..43243b7 100644 --- a/Manga Library Manager.csproj +++ b/Manga Library Manager.csproj @@ -9,7 +9,7 @@ enable ytpfp.ico en - 2.2.1 + 2.3.0 https://github.com/ErisLoona/Manga-Library-Manager Eris Loona, pseudonym A manga downloader and offline library manager. diff --git a/Properties/PublishProfiles/FolderProfile.pubxml.user b/Properties/PublishProfiles/FolderProfile.pubxml.user index b6fabd3..5934fe4 100644 --- a/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - True|2024-08-10T17:01:54.9741116Z||;True|2024-08-10T18:26:38.2101766+02:00||;True|2024-08-04T12:17:01.5508620+02:00||;True|2024-08-04T10:41:41.2423209+02:00||;True|2024-06-18T20:31:41.3666760+02:00||;True|2024-06-18T19:36:53.1267502+02:00||;True|2024-06-18T19:31:38.9594414+02:00||;True|2024-06-18T18:11:20.9585577+02:00||;True|2024-06-18T17:54:04.9775606+02:00||;True|2024-06-18T17:53:03.5685184+02:00||;True|2024-06-18T17:52:26.3088028+02:00||;True|2024-06-17T11:12:58.4583359+02:00||;True|2024-06-17T10:36:25.6841440+02:00||;True|2024-06-14T11:31:32.6934516+02:00||;True|2024-06-14T11:31:23.3706499+02:00||;True|2024-06-14T11:31:18.7205494+02:00||;True|2024-06-13T09:43:43.5390795+02:00||;True|2024-06-13T08:57:35.0322797+02:00||;True|2024-06-06T15:42:28.6568298+02:00||;True|2024-06-06T15:40:12.6240419+02:00||;True|2024-06-06T13:48:19.4662781+02:00||;True|2024-06-06T12:38:52.6425012+02:00||;True|2024-06-06T12:31:36.7948282+02:00||;True|2024-06-06T10:35:12.1369025+02:00||;True|2024-06-06T10:34:54.5189019+02:00||;True|2024-06-05T23:32:06.1114024+02:00||;True|2024-05-27T18:47:08.3065316+02:00||;True|2024-05-27T18:43:26.7575713+02:00||;True|2024-05-27T16:16:44.1211325+02:00||;True|2024-05-27T16:16:29.4947310+02:00||;True|2024-05-27T11:07:49.8981157+02:00||;True|2024-05-27T11:07:01.1240671+02:00||;True|2024-05-27T11:06:53.1694382+02:00||;True|2024-05-27T09:10:47.9526993+02:00||;True|2024-05-27T09:10:02.8503554+02:00||;True|2024-05-27T09:09:35.2317189+02:00||;True|2024-05-27T08:58:09.8645241+02:00||;True|2024-05-27T08:52:52.8051920+02:00||;True|2024-05-27T08:45:19.6197985+02:00||;True|2024-05-24T11:02:27.2916636+02:00||;True|2024-05-24T08:59:01.6326756+02:00||;True|2024-05-23T09:17:13.9644300+02:00||;True|2024-05-23T09:05:46.2467509+02:00||;True|2024-05-22T22:13:45.9526537+02:00||;True|2024-05-22T22:09:03.4000755+02:00||;True|2024-05-22T22:08:00.0350517+02:00||;True|2024-05-22T21:44:48.4725626+02:00||;True|2024-05-22T21:32:35.3627900+02:00||;True|2024-05-22T19:33:34.6467061+02:00||;True|2024-05-19T19:19:28.1467287+02:00||;True|2024-05-19T19:17:09.7006733+02:00||;True|2024-05-19T19:14:06.6668981+02:00||;True|2024-05-19T14:42:07.1301968+02:00||;True|2024-05-19T14:38:02.4943907+02:00||;True|2024-05-19T09:20:51.2871097+02:00||;True|2024-05-19T09:18:16.6124371+02:00||;True|2024-05-19T09:15:08.6048404+02:00||;True|2024-05-18T22:34:28.8521894+02:00||;True|2024-05-18T22:22:14.4673452+02:00||;True|2024-05-18T21:56:58.6143811+02:00||;True|2024-05-18T07:41:43.4161277+02:00||;True|2024-05-17T11:48:43.3293227+02:00||;True|2024-05-17T09:31:58.9329403+02:00||;True|2024-05-17T09:25:57.4957904+02:00||;True|2024-05-16T19:52:10.0997229+02:00||;True|2024-05-16T18:17:01.7850021+02:00||;True|2024-05-15T09:33:00.6957135+02:00||;True|2024-05-15T08:32:31.7735956+02:00||;True|2024-05-13T17:25:21.1454345+02:00||;True|2024-05-13T17:15:09.7285346+02:00||;True|2024-05-13T16:52:20.9054581+02:00||;True|2024-05-13T16:51:27.0891569+02:00||;True|2024-05-13T16:50:34.5522468+02:00||;True|2024-05-13T16:49:22.6946988+02:00||; + True|2024-08-23T08:36:17.5489790Z||;True|2024-08-10T20:30:27.2783260+02:00||;True|2024-08-10T20:30:03.4943545+02:00||;True|2024-08-10T19:01:54.9741116+02:00||;True|2024-08-10T18:26:38.2101766+02:00||;True|2024-08-04T12:17:01.5508620+02:00||;True|2024-08-04T10:41:41.2423209+02:00||;True|2024-06-18T20:31:41.3666760+02:00||;True|2024-06-18T19:36:53.1267502+02:00||;True|2024-06-18T19:31:38.9594414+02:00||;True|2024-06-18T18:11:20.9585577+02:00||;True|2024-06-18T17:54:04.9775606+02:00||;True|2024-06-18T17:53:03.5685184+02:00||;True|2024-06-18T17:52:26.3088028+02:00||;True|2024-06-17T11:12:58.4583359+02:00||;True|2024-06-17T10:36:25.6841440+02:00||;True|2024-06-14T11:31:32.6934516+02:00||;True|2024-06-14T11:31:23.3706499+02:00||;True|2024-06-14T11:31:18.7205494+02:00||;True|2024-06-13T09:43:43.5390795+02:00||;True|2024-06-13T08:57:35.0322797+02:00||;True|2024-06-06T15:42:28.6568298+02:00||;True|2024-06-06T15:40:12.6240419+02:00||;True|2024-06-06T13:48:19.4662781+02:00||;True|2024-06-06T12:38:52.6425012+02:00||;True|2024-06-06T12:31:36.7948282+02:00||;True|2024-06-06T10:35:12.1369025+02:00||;True|2024-06-06T10:34:54.5189019+02:00||;True|2024-06-05T23:32:06.1114024+02:00||;True|2024-05-27T18:47:08.3065316+02:00||;True|2024-05-27T18:43:26.7575713+02:00||;True|2024-05-27T16:16:44.1211325+02:00||;True|2024-05-27T16:16:29.4947310+02:00||;True|2024-05-27T11:07:49.8981157+02:00||;True|2024-05-27T11:07:01.1240671+02:00||;True|2024-05-27T11:06:53.1694382+02:00||;True|2024-05-27T09:10:47.9526993+02:00||;True|2024-05-27T09:10:02.8503554+02:00||;True|2024-05-27T09:09:35.2317189+02:00||;True|2024-05-27T08:58:09.8645241+02:00||;True|2024-05-27T08:52:52.8051920+02:00||;True|2024-05-27T08:45:19.6197985+02:00||;True|2024-05-24T11:02:27.2916636+02:00||;True|2024-05-24T08:59:01.6326756+02:00||;True|2024-05-23T09:17:13.9644300+02:00||;True|2024-05-23T09:05:46.2467509+02:00||;True|2024-05-22T22:13:45.9526537+02:00||;True|2024-05-22T22:09:03.4000755+02:00||;True|2024-05-22T22:08:00.0350517+02:00||;True|2024-05-22T21:44:48.4725626+02:00||;True|2024-05-22T21:32:35.3627900+02:00||;True|2024-05-22T19:33:34.6467061+02:00||;True|2024-05-19T19:19:28.1467287+02:00||;True|2024-05-19T19:17:09.7006733+02:00||;True|2024-05-19T19:14:06.6668981+02:00||;True|2024-05-19T14:42:07.1301968+02:00||;True|2024-05-19T14:38:02.4943907+02:00||;True|2024-05-19T09:20:51.2871097+02:00||;True|2024-05-19T09:18:16.6124371+02:00||;True|2024-05-19T09:15:08.6048404+02:00||;True|2024-05-18T22:34:28.8521894+02:00||;True|2024-05-18T22:22:14.4673452+02:00||;True|2024-05-18T21:56:58.6143811+02:00||;True|2024-05-18T07:41:43.4161277+02:00||;True|2024-05-17T11:48:43.3293227+02:00||;True|2024-05-17T09:31:58.9329403+02:00||;True|2024-05-17T09:25:57.4957904+02:00||;True|2024-05-16T19:52:10.0997229+02:00||;True|2024-05-16T18:17:01.7850021+02:00||;True|2024-05-15T09:33:00.6957135+02:00||;True|2024-05-15T08:32:31.7735956+02:00||;True|2024-05-13T17:25:21.1454345+02:00||;True|2024-05-13T17:15:09.7285346+02:00||;True|2024-05-13T16:52:20.9054581+02:00||;True|2024-05-13T16:51:27.0891569+02:00||;True|2024-05-13T16:50:34.5522468+02:00||;True|2024-05-13T16:49:22.6946988+02:00||; \ No newline at end of file diff --git a/README.md b/README.md index 26e98fd..751909c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ The downloads and sync features rely on the [MangaDex.org](https://mangadex.org/ Features: - Easily download mangas from MangaDex, however you want to - - Choose which chapters to download - the program automatically selects each chapter; if a chapter was scanlated by more than one group, the program will try and select the scanlator who covered *most* of the chapters up to that point to maintain consistency + - Choose which chapters to download - the program automatically selects each chapter; if a chapter was scanlated by more than one group, the program will try and select the scanlator who covered most of the chapters in the manga to maintain consistency + - There is an option to instead prefer the group who covered most chapters *up to each chapter*, to allow consistency in chunks for mangas with spotty coverage - The program also offers a button to quickly unselect / reselect interlude chapters / extras, but be warned this is a "dumb" feature, it (un)selects the chapters with decimals, it has no way of knowing the actual content of the chapter - Choose which title to use - the program lets you choose between the main title and any alt-titles listed on MangaDex; the program tries to get the alt-titles in your preferred language - Downloaded mangas are ready to be read - after downloading, the program creates a single `.epub` file with all the chapters, the cover image, author and artist; alternatively, it can create a single `.cbz`, however this will have no metadata (the cover image is still included, as the first entry) diff --git a/mangaDownloader.Designer.cs b/mangaDownloader.Designer.cs index 96643a7..d9ebb8d 100644 --- a/mangaDownloader.Designer.cs +++ b/mangaDownloader.Designer.cs @@ -41,9 +41,10 @@ private void InitializeComponent() tableLayoutPanel4 = new TableLayoutPanel(); addToManagerCheckBox = new CheckBox(); tableLayoutPanel6 = new TableLayoutPanel(); - removeExtrasButton = new Button(); + preferenceComboBox = new ComboBox(); locationButton = new Button(); tableLayoutPanel8 = new TableLayoutPanel(); + removeExtrasButton = new Button(); formatDropDown = new ComboBox(); qualityDropDown = new ComboBox(); tableLayoutPanel5 = new TableLayoutPanel(); @@ -115,7 +116,6 @@ private void InitializeComponent() tableLayoutPanel2.Name = "tableLayoutPanel2"; tableLayoutPanel2.RowCount = 1; tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); - tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F)); tableLayoutPanel2.Size = new Size(914, 34); tableLayoutPanel2.TabIndex = 0; // @@ -144,7 +144,6 @@ private void InitializeComponent() tableLayoutPanel7.Name = "tableLayoutPanel7"; tableLayoutPanel7.RowCount = 1; tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); - tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F)); tableLayoutPanel7.Size = new Size(595, 34); tableLayoutPanel7.TabIndex = 1; // @@ -236,7 +235,7 @@ private void InitializeComponent() tableLayoutPanel6.ColumnCount = 2; tableLayoutPanel6.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); tableLayoutPanel6.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); - tableLayoutPanel6.Controls.Add(removeExtrasButton, 0, 0); + tableLayoutPanel6.Controls.Add(preferenceComboBox, 1, 0); tableLayoutPanel6.Controls.Add(locationButton, 0, 0); tableLayoutPanel6.Dock = DockStyle.Fill; tableLayoutPanel6.Location = new Point(365, 0); @@ -248,25 +247,19 @@ private void InitializeComponent() tableLayoutPanel6.Size = new Size(365, 34); tableLayoutPanel6.TabIndex = 7; // - // removeExtrasButton + // preferenceComboBox // - removeExtrasButton.BackColor = Color.FromArgb(248, 200, 220); - removeExtrasButton.Dock = DockStyle.Fill; - removeExtrasButton.Enabled = false; - removeExtrasButton.FlatAppearance.BorderSize = 0; - removeExtrasButton.FlatAppearance.MouseDownBackColor = Color.FromArgb(188, 152, 167); - removeExtrasButton.FlatAppearance.MouseOverBackColor = Color.FromArgb(255, 229, 240); - removeExtrasButton.FlatStyle = FlatStyle.Flat; - removeExtrasButton.Font = new Font("Calibri", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); - removeExtrasButton.ForeColor = Color.Black; - removeExtrasButton.Location = new Point(185, 3); - removeExtrasButton.Name = "removeExtrasButton"; - removeExtrasButton.Size = new Size(177, 28); - removeExtrasButton.TabIndex = 6; - removeExtrasButton.Text = "Exclude Extras"; - toolTip.SetToolTip(removeExtrasButton, "Deselects all the chapters with decimals."); - removeExtrasButton.UseVisualStyleBackColor = false; - removeExtrasButton.Click += removeExtrasButton_Click; + preferenceComboBox.Dock = DockStyle.Fill; + preferenceComboBox.DropDownStyle = ComboBoxStyle.DropDownList; + preferenceComboBox.Enabled = false; + preferenceComboBox.FormattingEnabled = true; + preferenceComboBox.Items.AddRange(new object[] { "Most in manga", "Most up to chapter" }); + preferenceComboBox.Location = new Point(185, 3); + preferenceComboBox.Name = "preferenceComboBox"; + preferenceComboBox.Size = new Size(177, 27); + preferenceComboBox.TabIndex = 2; + toolTip.SetToolTip(preferenceComboBox, "Choose whether to auto-select chapters based on\r\nwhich scanlator did most of the manga, or most up\r\nto each chapter."); + preferenceComboBox.SelectedIndexChanged += preferenceComboBox_SelectedIndexChanged; // // locationButton // @@ -290,9 +283,11 @@ private void InitializeComponent() // // tableLayoutPanel8 // - tableLayoutPanel8.ColumnCount = 2; - tableLayoutPanel8.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); - tableLayoutPanel8.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F)); + tableLayoutPanel8.ColumnCount = 3; + tableLayoutPanel8.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 34F)); + tableLayoutPanel8.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); + tableLayoutPanel8.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F)); + tableLayoutPanel8.Controls.Add(removeExtrasButton, 2, 0); tableLayoutPanel8.Controls.Add(formatDropDown, 1, 0); tableLayoutPanel8.Controls.Add(qualityDropDown, 0, 0); tableLayoutPanel8.Dock = DockStyle.Fill; @@ -301,10 +296,29 @@ private void InitializeComponent() tableLayoutPanel8.Name = "tableLayoutPanel8"; tableLayoutPanel8.RowCount = 1; tableLayoutPanel8.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); - tableLayoutPanel8.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F)); tableLayoutPanel8.Size = new Size(365, 34); tableLayoutPanel8.TabIndex = 8; // + // removeExtrasButton + // + removeExtrasButton.BackColor = Color.FromArgb(248, 200, 220); + removeExtrasButton.Dock = DockStyle.Fill; + removeExtrasButton.Enabled = false; + removeExtrasButton.FlatAppearance.BorderSize = 0; + removeExtrasButton.FlatAppearance.MouseDownBackColor = Color.FromArgb(188, 152, 167); + removeExtrasButton.FlatAppearance.MouseOverBackColor = Color.FromArgb(255, 229, 240); + removeExtrasButton.FlatStyle = FlatStyle.Flat; + removeExtrasButton.Font = new Font("Calibri", 12F, FontStyle.Bold, GraphicsUnit.Point, 0); + removeExtrasButton.ForeColor = Color.Black; + removeExtrasButton.Location = new Point(247, 3); + removeExtrasButton.Name = "removeExtrasButton"; + removeExtrasButton.Size = new Size(115, 28); + removeExtrasButton.TabIndex = 6; + removeExtrasButton.Text = "Exclude Extras"; + toolTip.SetToolTip(removeExtrasButton, "Deselects all the chapters with decimals."); + removeExtrasButton.UseVisualStyleBackColor = false; + removeExtrasButton.Click += removeExtrasButton_Click; + // // formatDropDown // formatDropDown.Dock = DockStyle.Fill; @@ -312,9 +326,9 @@ private void InitializeComponent() formatDropDown.Enabled = false; formatDropDown.FormattingEnabled = true; formatDropDown.Items.AddRange(new object[] { "EPUB", "CBZ" }); - formatDropDown.Location = new Point(185, 3); + formatDropDown.Location = new Point(127, 3); formatDropDown.Name = "formatDropDown"; - formatDropDown.Size = new Size(177, 27); + formatDropDown.Size = new Size(114, 27); formatDropDown.TabIndex = 1; // // qualityDropDown @@ -326,7 +340,7 @@ private void InitializeComponent() qualityDropDown.Items.AddRange(new object[] { "Original Quality", "Data-Saver" }); qualityDropDown.Location = new Point(3, 3); qualityDropDown.Name = "qualityDropDown"; - qualityDropDown.Size = new Size(176, 27); + qualityDropDown.Size = new Size(118, 27); qualityDropDown.TabIndex = 0; // // tableLayoutPanel5 @@ -444,5 +458,6 @@ private void InitializeComponent() private Button removeExtrasButton; private TableLayoutPanel tableLayoutPanel8; private ComboBox formatDropDown; + private ComboBox preferenceComboBox; } } \ No newline at end of file diff --git a/mangaDownloader.cs b/mangaDownloader.cs index c4dc40e..4d9b4f8 100644 --- a/mangaDownloader.cs +++ b/mangaDownloader.cs @@ -18,7 +18,7 @@ public partial class mangaDownloader : Form private string savingPath; private int startOffset = 2, oldChapterIndex = -1; private List tempChapterNumbers = new List(); - private List checkedIndexes = new List(), duplicateIndexes = new List(), chapterNrPages = new List(); + private List checkedIndexes = new List(), altCheckedIndexes = new List(), duplicateIndexes = new List(), chapterNrPages = new List(); private mainMenu.eBook becomingBook = new mainMenu.eBook(); private List