From 6f0e556e8d9ec61c31773bf5846a429afcd48484 Mon Sep 17 00:00:00 2001 From: Eris Loona <142046400+ErisLoona@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:32:49 +0200 Subject: [PATCH 01/10] initial commit I'm already into it quite a bit, but oh well lmao --- App.axaml | 10 + App.axaml.cs | 24 + App.config | 18 - Globals.cs | 89 + MainMenu.axaml | 109 + MainMenu.axaml.cs | 428 +++ Manga Library Manager.csproj | 65 - Manga Library Manager.csproj.user | 32 - Manga Library Manager.sln | 31 - Manga Manager.csproj | 33 + Manga Manager.sln | 25 + MangaDex Library.dll | Bin 0 -> 19968 bytes Program.cs | 31 +- .../PublishProfiles/FolderProfile.pubxml | 18 - .../PublishProfiles/FolderProfile.pubxml.user | 10 - .../PublishProfiles/FolderProfile1.pubxml | 17 - .../FolderProfile1.pubxml.user | 10 - .../PublishProfiles/FolderProfile2.pubxml | 17 - .../FolderProfile2.pubxml.user | 10 - .../PublishProfiles/FolderProfile3.pubxml | 17 - .../FolderProfile3.pubxml.user | 10 - Properties/Resources.Designer.cs | 73 - Properties/Resources.resx | 124 - Properties/Settings.Designer.cs | 50 - Properties/Settings.settings | 12 - README.md | 86 +- Resources/coverError.png | Bin 492 -> 0 bytes Settings.axaml | 80 + Settings.axaml.cs | 56 + allOnlineChapters.Designer.cs | 238 -- allOnlineChapters.cs | 193 -- allOnlineChapters.resx | 2176 -------------- app.manifest | 18 + dumpJSON.Designer.cs | 96 - dumpJSON.cs | 25 - dumpJSON.resx | 2173 -------------- editTags.Designer.cs | 248 -- editTags.cs | 130 - editTags.resx | 2396 ---------------- importLibrary.Designer.cs | 156 - importLibrary.cs | 36 - importLibrary.resx | 2173 -------------- mainMenu.Designer.cs | 887 ------ mainMenu.cs | 1253 -------- mainMenu.resx | 2543 ----------------- mangaDownloader.Designer.cs | 463 --- mangaDownloader.cs | 1234 -------- mangaDownloader.resx | 2372 --------------- tagsFilter.Designer.cs | 366 --- tagsFilter.cs | 250 -- tagsFilter.resx | 2173 -------------- userSettings.Designer.cs | 192 -- userSettings.cs | 73 - userSettings.resx | 2176 -------------- ytpfp.ico | Bin 122836 -> 0 bytes 55 files changed, 931 insertions(+), 24594 deletions(-) create mode 100644 App.axaml create mode 100644 App.axaml.cs delete mode 100644 App.config create mode 100644 Globals.cs create mode 100644 MainMenu.axaml create mode 100644 MainMenu.axaml.cs delete mode 100644 Manga Library Manager.csproj delete mode 100644 Manga Library Manager.csproj.user delete mode 100644 Manga Library Manager.sln create mode 100644 Manga Manager.csproj create mode 100644 Manga Manager.sln create mode 100644 MangaDex Library.dll delete mode 100644 Properties/PublishProfiles/FolderProfile.pubxml delete mode 100644 Properties/PublishProfiles/FolderProfile.pubxml.user delete mode 100644 Properties/PublishProfiles/FolderProfile1.pubxml delete mode 100644 Properties/PublishProfiles/FolderProfile1.pubxml.user delete mode 100644 Properties/PublishProfiles/FolderProfile2.pubxml delete mode 100644 Properties/PublishProfiles/FolderProfile2.pubxml.user delete mode 100644 Properties/PublishProfiles/FolderProfile3.pubxml delete mode 100644 Properties/PublishProfiles/FolderProfile3.pubxml.user delete mode 100644 Properties/Resources.Designer.cs delete mode 100644 Properties/Resources.resx delete mode 100644 Properties/Settings.Designer.cs delete mode 100644 Properties/Settings.settings delete mode 100644 Resources/coverError.png create mode 100644 Settings.axaml create mode 100644 Settings.axaml.cs delete mode 100644 allOnlineChapters.Designer.cs delete mode 100644 allOnlineChapters.cs delete mode 100644 allOnlineChapters.resx create mode 100644 app.manifest delete mode 100644 dumpJSON.Designer.cs delete mode 100644 dumpJSON.cs delete mode 100644 dumpJSON.resx delete mode 100644 editTags.Designer.cs delete mode 100644 editTags.cs delete mode 100644 editTags.resx delete mode 100644 importLibrary.Designer.cs delete mode 100644 importLibrary.cs delete mode 100644 importLibrary.resx delete mode 100644 mainMenu.Designer.cs delete mode 100644 mainMenu.cs delete mode 100644 mainMenu.resx delete mode 100644 mangaDownloader.Designer.cs delete mode 100644 mangaDownloader.cs delete mode 100644 mangaDownloader.resx delete mode 100644 tagsFilter.Designer.cs delete mode 100644 tagsFilter.cs delete mode 100644 tagsFilter.resx delete mode 100644 userSettings.Designer.cs delete mode 100644 userSettings.cs delete mode 100644 userSettings.resx delete mode 100644 ytpfp.ico diff --git a/App.axaml b/App.axaml new file mode 100644 index 0000000..31d5539 --- /dev/null +++ b/App.axaml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/App.axaml.cs b/App.axaml.cs new file mode 100644 index 0000000..d94f160 --- /dev/null +++ b/App.axaml.cs @@ -0,0 +1,24 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; + +namespace Manga_Manager +{ + public partial class App : Application + { + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow(); + } + + base.OnFrameworkInitializationCompleted(); + } + } +} \ No newline at end of file diff --git a/App.config b/App.config deleted file mode 100644 index 10a3ce2..0000000 --- a/App.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - -
- - - - - - False - - - 0, 0 - - - - \ No newline at end of file diff --git a/Globals.cs b/Globals.cs new file mode 100644 index 0000000..cbb9d18 --- /dev/null +++ b/Globals.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using MangaDex_Library; +using System.Runtime.InteropServices; +using MsBox.Avalonia.Enums; +using MsBox.Avalonia; +using System.Diagnostics; + +namespace Manga_Manager +{ + internal class Manga + { + public string Title = string.Empty; + public string Description = string.Empty; + public string Path = string.Empty; + public decimal FileLastChapter = 0M; + public decimal OnlineLastChapter = 0M; + public DateOnly LastChecked = new DateOnly(69, 1, 1); + public string OngoingStatus = string.Empty; + public bool CheckInBulk = false; + public string ID = string.Empty; + public string ContentRating = string.Empty; + public List Tags = new List(); + } + + internal static class Globals + { + static Globals() + { + foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.AllCultures)) + if (languageDictionary.ContainsValue(culture.TwoLetterISOLanguageName) == false) + languageDictionary[culture.EnglishName] = culture.TwoLetterISOLanguageName; + languageDictionary["Simplified Chinese"] = "zh"; + languageDictionary["Traditional Chinese"] = "zh-hk"; + languageDictionary["Brazilian Portugese"] = "pt-br"; + languageDictionary["Castilian Spanish"] = "es"; + languageDictionary["Latin American Spanish"] = "es-la"; + languageDictionary["Romanized Japanese"] = "ja-ro"; + languageDictionary["Romanized Korean"] = "ko-ro"; + languageDictionary["Romanized Chinese"] = "zh-ro"; + + MDLGetData.ApiRequestFailed += MDLGetData_ApiRequestFailed; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + MDLParameters.SetUserAgent("Manga Library Manager for Windows by (github) ErisLoona"); + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + MDLParameters.SetUserAgent("Manga Library Manager for OSX by (github) ErisLoona"); + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + MDLParameters.SetUserAgent("Manga Library Manager for Linux by (github) ErisLoona"); + else + MDLParameters.SetUserAgent("Manga Library Manager by (github) ErisLoona"); + } + + internal async static void MDLGetData_ApiRequestFailed(object sender, EventArgs e) + { + apiError = true; + await MessageBoxManager.GetMessageBoxStandard("API error", "An error occurred while trying to contact the MangaDex API.", ButtonEnum.Ok).ShowAsync(); + } + + internal static async void OpenLink(string link) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + Process.Start(new ProcessStartInfo(link) { UseShellExecute = true }); + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + Process.Start(new ProcessStartInfo("open", new string[] { link })); + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + Process.Start(new ProcessStartInfo("xdg-open", new string[] { link })); + else + await MessageBoxManager.GetMessageBoxStandard("Unknown OS", $"Couldn't identify your OS, what are you running? Open the link yourself lol:\n{link}", ButtonEnum.Ok).ShowAsync(); + } + + #region Variables + + internal static List mangaList = new List(); + + #region Settings Globals + internal static string selectedLanguage = "en"; + internal static bool noWarning = false, checkUpdates = false, hideJsonFile = false; + internal static int downloaderLastUsedFormat = 0; + #endregion + + internal static Dictionary languageDictionary = new Dictionary(); + internal static Dictionary tagsUsage = new Dictionary(); + + internal static bool apiError = false; + + #endregion + } +} diff --git a/MainMenu.axaml b/MainMenu.axaml new file mode 100644 index 0000000..acd5dd9 --- /dev/null +++ b/MainMenu.axaml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +