├── .gitattributes ├── .gitignore ├── Inno Setup Files ├── license.rtf └── nekomatasetup.iss ├── License.md ├── Nekomata.sln ├── Nekomata ├── AboutBox.Designer.cs ├── AboutBox.cs ├── AboutBox.resx ├── App.config ├── FailedWindow.Designer.cs ├── FailedWindow.cs ├── FailedWindow.resx ├── MainWindow.Designer.cs ├── MainWindow.cs ├── MainWindow.resx ├── Nekomata.csproj ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Settingsdlg.Designer.cs ├── Settingsdlg.cs ├── Settingsdlg.resx ├── WinSparkle.cs ├── nekomata-windows.png ├── nekomata.ico └── packages.config ├── NekomataCore ├── App.config ├── GraphQLQuery.cs ├── ListEntry.cs ├── ListNormalizer.cs ├── NekomataCore.csproj ├── NormalListToMALXML.cs ├── Properties │ └── AssemblyInfo.cs ├── TitleIDConverter.cs └── packages.config ├── Readme.md └── nekomata.ico /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc 262 | /Inno Setup Files/Output/setup.exe 263 | -------------------------------------------------------------------------------- /Inno Setup Files/license.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Segoe UI;}} 2 | {\colortbl ;\red27\green31\blue34;} 3 | {\*\generator Riched20 10.0.14393}\viewkind4\uc1 4 | \pard\cf1\b\f0\fs24\lang9 The MIT License (MIT)\par 5 | \b0 Copyright \'a9 2018 MAL Updater OS X Group\par 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \ldblquote Software\rdblquote ), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\par 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\par 8 | 9 | \pard\sa200\sl276\slmult1 THE SOFTWARE IS PROVIDED \ldblquote AS IS\rdblquote , WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\cf0\par 10 | } 11 | -------------------------------------------------------------------------------- /Inno Setup Files/nekomatasetup.iss: -------------------------------------------------------------------------------- 1 | ; Script generated by the Inno Script Studio Wizard. 2 | ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! 3 | 4 | #define MyAppName "Nekomata" 5 | #define MyAppVersion "1.0.1" 6 | #define MyAppPublisher "MAL Updater OS X Group" 7 | #define MyAppURL "https://malupdaterosx.moe/nekomata/" 8 | #define MyAppExeName "Nekomata.exe" 9 | 10 | [Setup] 11 | ; NOTE: The value of AppId uniquely identifies this application. 12 | ; Do not use the same AppId value in installers for other applications. 13 | ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) 14 | AppId={{E9146033-AA26-4CD4-8EF6-2CB3CEE189E0} 15 | AppName={#MyAppName} 16 | AppVersion={#MyAppVersion} 17 | ;AppVerName={#MyAppName} {#MyAppVersion} 18 | AppPublisher={#MyAppPublisher} 19 | AppPublisherURL={#MyAppURL} 20 | AppSupportURL={#MyAppURL} 21 | AppUpdatesURL={#MyAppURL} 22 | DefaultDirName={pf}\{#MyAppName} 23 | DefaultGroupName={#MyAppName} 24 | LicenseFile=C:\Users\Kafuu Chino\Desktop\Nekomata\Inno Setup Files\license.rtf 25 | OutputBaseFilename=setup 26 | Compression=lzma 27 | SolidCompression=yes 28 | MinVersion=0,6.1 29 | DisableWelcomePage=False 30 | 31 | [Languages] 32 | Name: "english"; MessagesFile: "compiler:Default.isl" 33 | 34 | [Tasks] 35 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 36 | 37 | [Files] 38 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\CrashReporter.NET.dll"; DestDir: "{app}"; Flags: ignoreversion 39 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\CrashReporter.NET.dll.config"; DestDir: "{app}"; Flags: ignoreversion 40 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\CrashReporter.NET.pdb"; DestDir: "{app}"; Flags: ignoreversion 41 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\CrashReporter.NET.xml"; DestDir: "{app}"; Flags: ignoreversion 42 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\Nekomata.exe"; DestDir: "{app}"; Flags: ignoreversion 43 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\Nekomata.exe.config"; DestDir: "{app}"; Flags: ignoreversion 44 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\Nekomata.pdb"; DestDir: "{app}"; Flags: ignoreversion 45 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\NekomataCore.dll"; DestDir: "{app}"; Flags: ignoreversion 46 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\NekomataCore.dll.config"; DestDir: "{app}"; Flags: ignoreversion 47 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion 48 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\Newtonsoft.Json.xml"; DestDir: "{app}"; Flags: ignoreversion 49 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\RestSharp.dll"; DestDir: "{app}"; Flags: ignoreversion 50 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\System.Data.SQLite.dll"; DestDir: "{app}"; Flags: ignoreversion 51 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\System.Data.SQLite.dll.config"; DestDir: "{app}"; Flags: ignoreversion 52 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\System.Data.SQLite.EF6.dll"; DestDir: "{app}"; Flags: ignoreversion 53 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\System.Data.SQLite.Linq.dll"; DestDir: "{app}"; Flags: ignoreversion 54 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\System.Data.SQLite.xml"; DestDir: "{app}"; Flags: ignoreversion 55 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 56 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\x64\SQLite.Interop.dll"; DestDir: "{app}\x64"; Flags: ignoreversion 57 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\x64\sqlite3.dll"; DestDir: "{app}\x64"; Flags: ignoreversion 58 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\x86\SQLite.Interop.dll"; DestDir: "{app}\x86"; Flags: ignoreversion 59 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\x86\sqlite3.dll"; DestDir: "{app}\x86"; Flags: ignoreversion 60 | Source: "C:\Users\Kafuu Chino\Desktop\Nekomata\Nekomata\bin\Release\x86\WinSparkle.dll"; DestDir: "{app}"; Flags: ignoreversion 61 | 62 | [Icons] 63 | Name: "{group}\{#MyAppName}"; Filename: "{app}\Nekomata.exe" 64 | Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\Nekomata.exe"; Tasks: desktopicon 65 | Name: "{group}\{cm:UninstallProgram, {#MyAppName}}"; Filename: "{uninstallexe}" 66 | 67 | [Run] 68 | Filename: "{app}\Nekomata.exe"; Flags: nowait postinstall skipifsilent; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}" 69 | 70 | [Code] 71 | -------------------------------------------------------------------------------- /License.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MALUpdaterOSXArchive/Nekomata/6544f0df100d8723b6b3d0a2f51ffeee18ff247b/License.md -------------------------------------------------------------------------------- /Nekomata.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nekomata", "Nekomata\Nekomata.csproj", "{6ACCC2AB-224E-4214-A299-3563F6CDC9F8}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NekomataCore", "NekomataCore\NekomataCore.csproj", "{19B00327-56CE-406F-AE63-5293E61680A9}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {6ACCC2AB-224E-4214-A299-3563F6CDC9F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {6ACCC2AB-224E-4214-A299-3563F6CDC9F8}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {6ACCC2AB-224E-4214-A299-3563F6CDC9F8}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {6ACCC2AB-224E-4214-A299-3563F6CDC9F8}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {19B00327-56CE-406F-AE63-5293E61680A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {19B00327-56CE-406F-AE63-5293E61680A9}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {19B00327-56CE-406F-AE63-5293E61680A9}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {19B00327-56CE-406F-AE63-5293E61680A9}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {B1C2789E-E20E-4E81-9965-2D4701B18B96} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Nekomata/AboutBox.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Nekomata 2 | { 3 | partial class AboutBox 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | protected override void Dispose(bool disposing) 14 | { 15 | if (disposing && (components != null)) 16 | { 17 | components.Dispose(); 18 | } 19 | base.Dispose(disposing); 20 | } 21 | 22 | #region Windows Form Designer generated code 23 | 24 | /// 25 | /// Required method for Designer support - do not modify 26 | /// the contents of this method with the code editor. 27 | /// 28 | private void InitializeComponent() 29 | { 30 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox)); 31 | this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 32 | this.logoPictureBox = new System.Windows.Forms.PictureBox(); 33 | this.labelProductName = new System.Windows.Forms.Label(); 34 | this.labelVersion = new System.Windows.Forms.Label(); 35 | this.labelCopyright = new System.Windows.Forms.Label(); 36 | this.labelCompanyName = new System.Windows.Forms.Label(); 37 | this.textBoxDescription = new System.Windows.Forms.TextBox(); 38 | this.okButton = new System.Windows.Forms.Button(); 39 | this.tableLayoutPanel.SuspendLayout(); 40 | ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); 41 | this.SuspendLayout(); 42 | // 43 | // tableLayoutPanel 44 | // 45 | this.tableLayoutPanel.ColumnCount = 2; 46 | this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); 47 | this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67F)); 48 | this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0); 49 | this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); 50 | this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); 51 | this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); 52 | this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3); 53 | this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); 54 | this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); 55 | this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; 56 | this.tableLayoutPanel.Location = new System.Drawing.Point(9, 9); 57 | this.tableLayoutPanel.Name = "tableLayoutPanel"; 58 | this.tableLayoutPanel.RowCount = 6; 59 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 60 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 61 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 62 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 63 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 64 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); 65 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 66 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 67 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 68 | this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 69 | this.tableLayoutPanel.Size = new System.Drawing.Size(417, 265); 70 | this.tableLayoutPanel.TabIndex = 0; 71 | // 72 | // logoPictureBox 73 | // 74 | this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image"))); 75 | this.logoPictureBox.Location = new System.Drawing.Point(3, 3); 76 | this.logoPictureBox.Name = "logoPictureBox"; 77 | this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); 78 | this.logoPictureBox.Size = new System.Drawing.Size(131, 131); 79 | this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 80 | this.logoPictureBox.TabIndex = 12; 81 | this.logoPictureBox.TabStop = false; 82 | // 83 | // labelProductName 84 | // 85 | this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; 86 | this.labelProductName.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 87 | this.labelProductName.Location = new System.Drawing.Point(143, 0); 88 | this.labelProductName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); 89 | this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17); 90 | this.labelProductName.Name = "labelProductName"; 91 | this.labelProductName.Size = new System.Drawing.Size(271, 17); 92 | this.labelProductName.TabIndex = 19; 93 | this.labelProductName.Text = "Product Name"; 94 | this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 95 | // 96 | // labelVersion 97 | // 98 | this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; 99 | this.labelVersion.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 100 | this.labelVersion.Location = new System.Drawing.Point(143, 26); 101 | this.labelVersion.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); 102 | this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17); 103 | this.labelVersion.Name = "labelVersion"; 104 | this.labelVersion.Size = new System.Drawing.Size(271, 17); 105 | this.labelVersion.TabIndex = 0; 106 | this.labelVersion.Text = "Version"; 107 | this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 108 | // 109 | // labelCopyright 110 | // 111 | this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; 112 | this.labelCopyright.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 113 | this.labelCopyright.Location = new System.Drawing.Point(143, 52); 114 | this.labelCopyright.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); 115 | this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17); 116 | this.labelCopyright.Name = "labelCopyright"; 117 | this.labelCopyright.Size = new System.Drawing.Size(271, 17); 118 | this.labelCopyright.TabIndex = 21; 119 | this.labelCopyright.Text = "Copyright"; 120 | this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 121 | // 122 | // labelCompanyName 123 | // 124 | this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; 125 | this.labelCompanyName.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 126 | this.labelCompanyName.Location = new System.Drawing.Point(143, 78); 127 | this.labelCompanyName.Margin = new System.Windows.Forms.Padding(6, 0, 3, 0); 128 | this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17); 129 | this.labelCompanyName.Name = "labelCompanyName"; 130 | this.labelCompanyName.Size = new System.Drawing.Size(271, 17); 131 | this.labelCompanyName.TabIndex = 22; 132 | this.labelCompanyName.Text = "Company Name"; 133 | this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 134 | // 135 | // textBoxDescription 136 | // 137 | this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; 138 | this.textBoxDescription.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 139 | this.textBoxDescription.Location = new System.Drawing.Point(143, 107); 140 | this.textBoxDescription.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3); 141 | this.textBoxDescription.Multiline = true; 142 | this.textBoxDescription.Name = "textBoxDescription"; 143 | this.textBoxDescription.ReadOnly = true; 144 | this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; 145 | this.textBoxDescription.Size = new System.Drawing.Size(271, 126); 146 | this.textBoxDescription.TabIndex = 23; 147 | this.textBoxDescription.TabStop = false; 148 | this.textBoxDescription.Text = resources.GetString("textBoxDescription.Text"); 149 | // 150 | // okButton 151 | // 152 | this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 153 | this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 154 | this.okButton.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 155 | this.okButton.Location = new System.Drawing.Point(339, 239); 156 | this.okButton.Name = "okButton"; 157 | this.okButton.Size = new System.Drawing.Size(75, 23); 158 | this.okButton.TabIndex = 24; 159 | this.okButton.Text = "&OK"; 160 | // 161 | // AboutBox 162 | // 163 | this.AcceptButton = this.okButton; 164 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 165 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 166 | this.ClientSize = new System.Drawing.Size(435, 283); 167 | this.Controls.Add(this.tableLayoutPanel); 168 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 169 | this.MaximizeBox = false; 170 | this.MinimizeBox = false; 171 | this.Name = "AboutBox"; 172 | this.Padding = new System.Windows.Forms.Padding(9); 173 | this.ShowIcon = false; 174 | this.ShowInTaskbar = false; 175 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 176 | this.Text = "About Nekomata"; 177 | this.Load += new System.EventHandler(this.AboutBox1_Load); 178 | this.tableLayoutPanel.ResumeLayout(false); 179 | this.tableLayoutPanel.PerformLayout(); 180 | ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); 181 | this.ResumeLayout(false); 182 | 183 | } 184 | 185 | #endregion 186 | 187 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 188 | private System.Windows.Forms.PictureBox logoPictureBox; 189 | private System.Windows.Forms.Label labelProductName; 190 | private System.Windows.Forms.Label labelVersion; 191 | private System.Windows.Forms.Label labelCopyright; 192 | private System.Windows.Forms.Label labelCompanyName; 193 | private System.Windows.Forms.TextBox textBoxDescription; 194 | private System.Windows.Forms.Button okButton; 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /Nekomata/AboutBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Threading.Tasks; 8 | using System.Windows.Forms; 9 | /* AboutBox.cs 10 | * The About Dialog 11 | * 12 | * Copyright (c) 2018 MAL Updater OS X Group, a division of Moy IT Solutions 13 | * Licensed under MIT License 14 | */ 15 | namespace Nekomata 16 | { 17 | partial class AboutBox : Form 18 | { 19 | public AboutBox() 20 | { 21 | InitializeComponent(); 22 | this.Text = String.Format("About {0}", AssemblyTitle); 23 | this.labelProductName.Text = AssemblyProduct; 24 | this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); 25 | this.labelCopyright.Text = AssemblyCopyright; 26 | this.labelCompanyName.Text = AssemblyCompany; 27 | //this.textBoxDescription.Text = AssemblyDescription; 28 | } 29 | 30 | #region Assembly Attribute Accessors 31 | 32 | public string AssemblyTitle 33 | { 34 | get 35 | { 36 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 37 | if (attributes.Length > 0) 38 | { 39 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; 40 | if (titleAttribute.Title != "") 41 | { 42 | return titleAttribute.Title; 43 | } 44 | } 45 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 46 | } 47 | } 48 | 49 | public string AssemblyVersion 50 | { 51 | get 52 | { 53 | return Assembly.GetExecutingAssembly().GetName().Version.ToString(); 54 | } 55 | } 56 | 57 | public string AssemblyDescription 58 | { 59 | get 60 | { 61 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); 62 | if (attributes.Length == 0) 63 | { 64 | return ""; 65 | } 66 | return ((AssemblyDescriptionAttribute)attributes[0]).Description; 67 | } 68 | } 69 | 70 | public string AssemblyProduct 71 | { 72 | get 73 | { 74 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 75 | if (attributes.Length == 0) 76 | { 77 | return ""; 78 | } 79 | return ((AssemblyProductAttribute)attributes[0]).Product; 80 | } 81 | } 82 | 83 | public string AssemblyCopyright 84 | { 85 | get 86 | { 87 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 88 | if (attributes.Length == 0) 89 | { 90 | return ""; 91 | } 92 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 93 | } 94 | } 95 | 96 | public string AssemblyCompany 97 | { 98 | get 99 | { 100 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 101 | if (attributes.Length == 0) 102 | { 103 | return ""; 104 | } 105 | return ((AssemblyCompanyAttribute)attributes[0]).Company; 106 | } 107 | } 108 | #endregion 109 | 110 | private void AboutBox1_Load(object sender, EventArgs e) 111 | { 112 | 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Nekomata/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | True 35 | 36 | 37 | False 38 | 39 | 40 | False 41 | 42 | 43 | False 44 | 45 | 46 | False 47 | 48 | 49 | False 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Nekomata/FailedWindow.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Nekomata 2 | { 3 | partial class FailedWindow 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.label1 = new System.Windows.Forms.Label(); 32 | this.label2 = new System.Windows.Forms.Label(); 33 | this.faileditems = new System.Windows.Forms.ListBox(); 34 | this.savefailedbtn = new System.Windows.Forms.Button(); 35 | this.continueBtn = new System.Windows.Forms.Button(); 36 | this.SuspendLayout(); 37 | // 38 | // label1 39 | // 40 | this.label1.AutoSize = true; 41 | this.label1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 42 | this.label1.Location = new System.Drawing.Point(65, 18); 43 | this.label1.Name = "label1"; 44 | this.label1.Size = new System.Drawing.Size(261, 13); 45 | this.label1.TabIndex = 0; 46 | this.label1.Text = "There are titles that couldn\'t be exported to MAL"; 47 | // 48 | // label2 49 | // 50 | this.label2.AutoSize = true; 51 | this.label2.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 52 | this.label2.Location = new System.Drawing.Point(65, 40); 53 | this.label2.Name = "label2"; 54 | this.label2.Size = new System.Drawing.Size(147, 13); 55 | this.label2.TabIndex = 1; 56 | this.label2.Text = "You can review them below"; 57 | // 58 | // faileditems 59 | // 60 | this.faileditems.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 61 | this.faileditems.FormattingEnabled = true; 62 | this.faileditems.Location = new System.Drawing.Point(68, 72); 63 | this.faileditems.Name = "faileditems"; 64 | this.faileditems.Size = new System.Drawing.Size(389, 134); 65 | this.faileditems.TabIndex = 2; 66 | // 67 | // savefailedbtn 68 | // 69 | this.savefailedbtn.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 70 | this.savefailedbtn.Location = new System.Drawing.Point(234, 212); 71 | this.savefailedbtn.Name = "savefailedbtn"; 72 | this.savefailedbtn.Size = new System.Drawing.Size(138, 23); 73 | this.savefailedbtn.TabIndex = 3; 74 | this.savefailedbtn.Text = "Save Failed Item List"; 75 | this.savefailedbtn.UseVisualStyleBackColor = true; 76 | this.savefailedbtn.Click += new System.EventHandler(this.savefailedbtn_Click); 77 | // 78 | // continueBtn 79 | // 80 | this.continueBtn.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 81 | this.continueBtn.Location = new System.Drawing.Point(382, 212); 82 | this.continueBtn.Name = "continueBtn"; 83 | this.continueBtn.Size = new System.Drawing.Size(75, 23); 84 | this.continueBtn.TabIndex = 4; 85 | this.continueBtn.Text = "Continue"; 86 | this.continueBtn.UseVisualStyleBackColor = true; 87 | this.continueBtn.Click += new System.EventHandler(this.continueBtn_Click); 88 | // 89 | // FailedWindow 90 | // 91 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 92 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 93 | this.ClientSize = new System.Drawing.Size(482, 250); 94 | this.ControlBox = false; 95 | this.Controls.Add(this.continueBtn); 96 | this.Controls.Add(this.savefailedbtn); 97 | this.Controls.Add(this.faileditems); 98 | this.Controls.Add(this.label2); 99 | this.Controls.Add(this.label1); 100 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 101 | this.Name = "FailedWindow"; 102 | this.Text = "Failed Export Items"; 103 | this.ResumeLayout(false); 104 | this.PerformLayout(); 105 | 106 | } 107 | 108 | #endregion 109 | 110 | private System.Windows.Forms.Label label1; 111 | private System.Windows.Forms.Label label2; 112 | private System.Windows.Forms.ListBox faileditems; 113 | private System.Windows.Forms.Button savefailedbtn; 114 | private System.Windows.Forms.Button continueBtn; 115 | } 116 | } -------------------------------------------------------------------------------- /Nekomata/FailedWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Windows.Forms; 5 | using Newtonsoft.Json; 6 | using NekomataCore; 7 | /* FailedWindow.cs 8 | * This dialog shows the list of titles that couldn't be exported. 9 | * 10 | * Copyright (c) 2018 MAL Updater OS X Group, a division of Moy IT Solutions 11 | * Licensed under MIT License 12 | */ 13 | namespace Nekomata 14 | { 15 | public partial class FailedWindow : Form 16 | { 17 | public List faillist; 18 | 19 | public FailedWindow(List flist) 20 | { 21 | InitializeComponent(); 22 | this.faillist = flist; 23 | faileditems.Items.Clear(); 24 | foreach (ListEntry entry in faillist) 25 | { 26 | faileditems.Items.Add(entry.title); 27 | } 28 | } 29 | 30 | private void continueBtn_Click(object sender, EventArgs e) 31 | { 32 | // Dismiss dialog 33 | DialogResult = DialogResult.OK; 34 | Close(); 35 | } 36 | 37 | private void savefailedbtn_Click(object sender, EventArgs e) 38 | { 39 | string json = JsonConvert.SerializeObject(faillist); 40 | SaveFileDialog savedialog = new SaveFileDialog(); 41 | savedialog.Filter = "Javascript Object Notation file (*.json)|*.json"; 42 | savedialog.RestoreDirectory = true; 43 | if (savedialog.ShowDialog() == DialogResult.OK) 44 | { 45 | StreamWriter jsonfile = new StreamWriter(savedialog.OpenFile()); 46 | StringReader jsonReader = new StringReader(json); 47 | if (jsonfile != null) { 48 | string line; 49 | while ((line = jsonReader.ReadLine()) != null) 50 | { 51 | jsonfile.WriteLine(line); 52 | } 53 | jsonfile.Close(); 54 | } 55 | DialogResult = DialogResult.OK; 56 | Close(); 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Nekomata/FailedWindow.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Nekomata/MainWindow.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Nekomata 2 | { 3 | partial class MainWindow 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | WinSparkle.win_sparkle_cleanup(); 22 | } 23 | 24 | #region Windows Form Designer generated code 25 | 26 | /// 27 | /// Required method for Designer support - do not modify 28 | /// the contents of this method with the code editor. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow)); 33 | this.progressBar1 = new System.Windows.Forms.ProgressBar(); 34 | this.usernameField = new System.Windows.Forms.TextBox(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | this.anilistRadioBtn = new System.Windows.Forms.RadioButton(); 37 | this.kitsuRadioBtn = new System.Windows.Forms.RadioButton(); 38 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 39 | this.groupBox2 = new System.Windows.Forms.GroupBox(); 40 | this.mangaRadioBtn = new System.Windows.Forms.RadioButton(); 41 | this.animeRadioBtn = new System.Windows.Forms.RadioButton(); 42 | this.exportBtn = new System.Windows.Forms.Button(); 43 | this.label2 = new System.Windows.Forms.Label(); 44 | this.linkLabel1 = new System.Windows.Forms.LinkLabel(); 45 | this.menuStrip1 = new System.Windows.Forms.MenuStrip(); 46 | this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 47 | this.aboutNekomataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 48 | this.checkForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 49 | this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 50 | this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); 51 | this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 52 | this.groupBox1.SuspendLayout(); 53 | this.groupBox2.SuspendLayout(); 54 | this.menuStrip1.SuspendLayout(); 55 | this.SuspendLayout(); 56 | // 57 | // progressBar1 58 | // 59 | this.progressBar1.Location = new System.Drawing.Point(273, 144); 60 | this.progressBar1.Name = "progressBar1"; 61 | this.progressBar1.Size = new System.Drawing.Size(100, 23); 62 | this.progressBar1.TabIndex = 0; 63 | // 64 | // usernameField 65 | // 66 | this.usernameField.Location = new System.Drawing.Point(139, 13); 67 | this.usernameField.Name = "usernameField"; 68 | this.usernameField.Size = new System.Drawing.Size(100, 22); 69 | this.usernameField.TabIndex = 1; 70 | // 71 | // label1 72 | // 73 | this.label1.AutoSize = true; 74 | this.label1.Location = new System.Drawing.Point(6, 16); 75 | this.label1.Name = "label1"; 76 | this.label1.Size = new System.Drawing.Size(130, 13); 77 | this.label1.TabIndex = 2; 78 | this.label1.Text = "Username/Profile Name:"; 79 | // 80 | // anilistRadioBtn 81 | // 82 | this.anilistRadioBtn.AutoSize = true; 83 | this.anilistRadioBtn.Checked = true; 84 | this.anilistRadioBtn.Location = new System.Drawing.Point(9, 42); 85 | this.anilistRadioBtn.Name = "anilistRadioBtn"; 86 | this.anilistRadioBtn.Size = new System.Drawing.Size(59, 17); 87 | this.anilistRadioBtn.TabIndex = 3; 88 | this.anilistRadioBtn.TabStop = true; 89 | this.anilistRadioBtn.Text = "AniList"; 90 | this.anilistRadioBtn.UseVisualStyleBackColor = true; 91 | // 92 | // kitsuRadioBtn 93 | // 94 | this.kitsuRadioBtn.AutoSize = true; 95 | this.kitsuRadioBtn.Location = new System.Drawing.Point(9, 66); 96 | this.kitsuRadioBtn.Name = "kitsuRadioBtn"; 97 | this.kitsuRadioBtn.Size = new System.Drawing.Size(50, 17); 98 | this.kitsuRadioBtn.TabIndex = 4; 99 | this.kitsuRadioBtn.Text = "Kitsu"; 100 | this.kitsuRadioBtn.UseVisualStyleBackColor = true; 101 | // 102 | // groupBox1 103 | // 104 | this.groupBox1.Controls.Add(this.label1); 105 | this.groupBox1.Controls.Add(this.kitsuRadioBtn); 106 | this.groupBox1.Controls.Add(this.usernameField); 107 | this.groupBox1.Controls.Add(this.anilistRadioBtn); 108 | this.groupBox1.Location = new System.Drawing.Point(12, 33); 109 | this.groupBox1.Name = "groupBox1"; 110 | this.groupBox1.Size = new System.Drawing.Size(244, 100); 111 | this.groupBox1.TabIndex = 5; 112 | this.groupBox1.TabStop = false; 113 | this.groupBox1.Text = "User Information"; 114 | // 115 | // groupBox2 116 | // 117 | this.groupBox2.Controls.Add(this.mangaRadioBtn); 118 | this.groupBox2.Controls.Add(this.animeRadioBtn); 119 | this.groupBox2.Location = new System.Drawing.Point(273, 33); 120 | this.groupBox2.Name = "groupBox2"; 121 | this.groupBox2.Size = new System.Drawing.Size(200, 100); 122 | this.groupBox2.TabIndex = 6; 123 | this.groupBox2.TabStop = false; 124 | this.groupBox2.Text = "List Type"; 125 | // 126 | // mangaRadioBtn 127 | // 128 | this.mangaRadioBtn.AutoSize = true; 129 | this.mangaRadioBtn.Location = new System.Drawing.Point(26, 44); 130 | this.mangaRadioBtn.Name = "mangaRadioBtn"; 131 | this.mangaRadioBtn.Size = new System.Drawing.Size(61, 17); 132 | this.mangaRadioBtn.TabIndex = 1; 133 | this.mangaRadioBtn.Text = "Manga"; 134 | this.mangaRadioBtn.UseVisualStyleBackColor = true; 135 | // 136 | // animeRadioBtn 137 | // 138 | this.animeRadioBtn.AutoSize = true; 139 | this.animeRadioBtn.Checked = true; 140 | this.animeRadioBtn.Location = new System.Drawing.Point(26, 20); 141 | this.animeRadioBtn.Name = "animeRadioBtn"; 142 | this.animeRadioBtn.Size = new System.Drawing.Size(57, 17); 143 | this.animeRadioBtn.TabIndex = 0; 144 | this.animeRadioBtn.TabStop = true; 145 | this.animeRadioBtn.Text = "Anime"; 146 | this.animeRadioBtn.UseVisualStyleBackColor = true; 147 | // 148 | // exportBtn 149 | // 150 | this.exportBtn.Location = new System.Drawing.Point(398, 143); 151 | this.exportBtn.Name = "exportBtn"; 152 | this.exportBtn.Size = new System.Drawing.Size(75, 23); 153 | this.exportBtn.TabIndex = 7; 154 | this.exportBtn.Text = "Export"; 155 | this.exportBtn.UseVisualStyleBackColor = true; 156 | this.exportBtn.Click += new System.EventHandler(this.exportBtn_Click); 157 | // 158 | // label2 159 | // 160 | this.label2.AutoSize = true; 161 | this.label2.Location = new System.Drawing.Point(13, 139); 162 | this.label2.Name = "label2"; 163 | this.label2.Size = new System.Drawing.Size(227, 13); 164 | this.label2.TabIndex = 8; 165 | this.label2.Text = "Find this utility useful? Consider donating."; 166 | // 167 | // linkLabel1 168 | // 169 | this.linkLabel1.AutoSize = true; 170 | this.linkLabel1.Location = new System.Drawing.Point(17, 156); 171 | this.linkLabel1.Name = "linkLabel1"; 172 | this.linkLabel1.Size = new System.Drawing.Size(45, 13); 173 | this.linkLabel1.TabIndex = 9; 174 | this.linkLabel1.TabStop = true; 175 | this.linkLabel1.Text = "Donate"; 176 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); 177 | // 178 | // menuStrip1 179 | // 180 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 181 | this.fileToolStripMenuItem}); 182 | this.menuStrip1.Location = new System.Drawing.Point(0, 0); 183 | this.menuStrip1.Name = "menuStrip1"; 184 | this.menuStrip1.Size = new System.Drawing.Size(485, 24); 185 | this.menuStrip1.TabIndex = 10; 186 | this.menuStrip1.Text = "menuStrip1"; 187 | // 188 | // fileToolStripMenuItem 189 | // 190 | this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { 191 | this.aboutNekomataToolStripMenuItem, 192 | this.checkForUpdatesToolStripMenuItem, 193 | this.settingsToolStripMenuItem, 194 | this.toolStripMenuItem1, 195 | this.exitToolStripMenuItem}); 196 | this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; 197 | this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); 198 | this.fileToolStripMenuItem.Text = "&File"; 199 | // 200 | // aboutNekomataToolStripMenuItem 201 | // 202 | this.aboutNekomataToolStripMenuItem.Name = "aboutNekomataToolStripMenuItem"; 203 | this.aboutNekomataToolStripMenuItem.Size = new System.Drawing.Size(180, 22); 204 | this.aboutNekomataToolStripMenuItem.Text = "About Nekomata"; 205 | this.aboutNekomataToolStripMenuItem.Click += new System.EventHandler(this.aboutNekomataToolStripMenuItem_Click); 206 | // 207 | // checkForUpdatesToolStripMenuItem 208 | // 209 | this.checkForUpdatesToolStripMenuItem.Name = "checkForUpdatesToolStripMenuItem"; 210 | this.checkForUpdatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); 211 | this.checkForUpdatesToolStripMenuItem.Text = "Check for Updates..."; 212 | this.checkForUpdatesToolStripMenuItem.Click += new System.EventHandler(this.checkForUpdatesToolStripMenuItem_Click); 213 | // 214 | // settingsToolStripMenuItem 215 | // 216 | this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; 217 | this.settingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); 218 | this.settingsToolStripMenuItem.Text = "Settings"; 219 | this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); 220 | // 221 | // toolStripMenuItem1 222 | // 223 | this.toolStripMenuItem1.Name = "toolStripMenuItem1"; 224 | this.toolStripMenuItem1.Size = new System.Drawing.Size(177, 6); 225 | // 226 | // exitToolStripMenuItem 227 | // 228 | this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; 229 | this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); 230 | this.exitToolStripMenuItem.Text = "&Exit"; 231 | this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); 232 | // 233 | // MainWindow 234 | // 235 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 236 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 237 | this.ClientSize = new System.Drawing.Size(485, 183); 238 | this.Controls.Add(this.linkLabel1); 239 | this.Controls.Add(this.label2); 240 | this.Controls.Add(this.exportBtn); 241 | this.Controls.Add(this.groupBox2); 242 | this.Controls.Add(this.groupBox1); 243 | this.Controls.Add(this.progressBar1); 244 | this.Controls.Add(this.menuStrip1); 245 | this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 246 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; 247 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 248 | this.MainMenuStrip = this.menuStrip1; 249 | this.MaximizeBox = false; 250 | this.Name = "MainWindow"; 251 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; 252 | this.Text = "Nekomata"; 253 | this.Load += new System.EventHandler(this.Form1_Load); 254 | this.groupBox1.ResumeLayout(false); 255 | this.groupBox1.PerformLayout(); 256 | this.groupBox2.ResumeLayout(false); 257 | this.groupBox2.PerformLayout(); 258 | this.menuStrip1.ResumeLayout(false); 259 | this.menuStrip1.PerformLayout(); 260 | this.ResumeLayout(false); 261 | this.PerformLayout(); 262 | 263 | } 264 | 265 | #endregion 266 | 267 | private System.Windows.Forms.ProgressBar progressBar1; 268 | private System.Windows.Forms.TextBox usernameField; 269 | private System.Windows.Forms.Label label1; 270 | private System.Windows.Forms.RadioButton anilistRadioBtn; 271 | private System.Windows.Forms.RadioButton kitsuRadioBtn; 272 | private System.Windows.Forms.GroupBox groupBox1; 273 | private System.Windows.Forms.GroupBox groupBox2; 274 | private System.Windows.Forms.RadioButton mangaRadioBtn; 275 | private System.Windows.Forms.RadioButton animeRadioBtn; 276 | private System.Windows.Forms.Button exportBtn; 277 | private System.Windows.Forms.Label label2; 278 | private System.Windows.Forms.LinkLabel linkLabel1; 279 | private System.Windows.Forms.MenuStrip menuStrip1; 280 | private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; 281 | private System.Windows.Forms.ToolStripMenuItem aboutNekomataToolStripMenuItem; 282 | private System.Windows.Forms.ToolStripMenuItem checkForUpdatesToolStripMenuItem; 283 | private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; 284 | private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; 285 | private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem; 286 | } 287 | } 288 | 289 | -------------------------------------------------------------------------------- /Nekomata/MainWindow.cs: -------------------------------------------------------------------------------- 1 | /* MainWindow.cs 2 | * This is the main application window. 3 | * 4 | * Copyright (c) 2018 MAL Updater OS X Group, a division of Moy IT Solutions 5 | * Licensed under MIT License 6 | */ 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Windows.Forms; 10 | using System.Threading; 11 | using System.IO; 12 | using NekomataCore; 13 | using System.Runtime.InteropServices; 14 | 15 | namespace Nekomata 16 | { 17 | public partial class MainWindow : Form 18 | { 19 | private AboutBox aboutbox; 20 | private Thread exportthread; 21 | private ListNormalizer listnormalizer; 22 | private NormalListToMALXML nltoMALXML; 23 | private TitleIDConverter titleidconverter; 24 | private Settingsdlg settings; 25 | [DllImport("user32")] 26 | private static extern int GetSystemMenu(IntPtr hWnd, bool bRevert); 27 | [DllImport("user32")] 28 | private static extern bool DeleteMenu(int hMenu, int uPosition, int uFlags); 29 | private int s_SystemMenuHandle = 0; 30 | 31 | public MainWindow() 32 | { 33 | InitializeComponent(); 34 | this.listnormalizer = new ListNormalizer(); 35 | this.nltoMALXML = new NormalListToMALXML(); 36 | this.titleidconverter = new TitleIDConverter(); 37 | this.listnormalizer.tconverter = this.titleidconverter; 38 | this.nltoMALXML.tconverter = this.titleidconverter; 39 | if (!this.titleidconverter.sqlliteinitalized) 40 | { 41 | DialogResult result = MessageBox.Show("Only one instance of Nekomata can run at a time. Nekomata will now exit.", "Error", MessageBoxButtons.OK); 42 | if (result == System.Windows.Forms.DialogResult.OK) 43 | { 44 | Environment.Exit(0); 45 | } 46 | } 47 | } 48 | 49 | private void Form1_Load(object sender, EventArgs e) 50 | { 51 | // Create window handle 52 | if (!this.IsHandleCreated) 53 | { 54 | this.CreateControl(); 55 | } 56 | WinSparkle.win_sparkle_set_appcast_url("https://updates.malupdaterosx.moe/nekomata/nekomata.xml"); 57 | //start automatic update checks. 58 | WinSparkle.win_sparkle_init(); 59 | 60 | } 61 | 62 | private void aboutNekomataToolStripMenuItem_Click(object sender, EventArgs e) 63 | { 64 | if (this.aboutbox == null || this.aboutbox.IsDisposed) 65 | { 66 | aboutbox = new AboutBox(); 67 | } 68 | aboutbox.ShowDialog(); 69 | } 70 | 71 | private void exportBtn_Click(object sender, EventArgs e) 72 | { 73 | if (usernameField.Text.Length > 0) 74 | { 75 | Service selectedservice = Service.Kitsu; 76 | if (anilistRadioBtn.Checked) 77 | { 78 | selectedservice = Service.AniList; 79 | } 80 | else if (kitsuRadioBtn.Checked) 81 | { 82 | selectedservice = Service.Kitsu; 83 | } 84 | EntryType selectedtype = EntryType.Anime; 85 | if (animeRadioBtn.Checked) 86 | { 87 | selectedtype = EntryType.Anime; 88 | } 89 | else 90 | { 91 | selectedtype = EntryType.Manga; 92 | } 93 | this.exportthread = new Thread(() => BeginExport(usernameField.Text, selectedservice, selectedtype)); 94 | this.exportthread.Start(); 95 | } 96 | else 97 | { 98 | MessageBox.Show("You did not specify a username. Please specify one and try again", "Export Failed"); 99 | } 100 | } 101 | 102 | private void BeginExport(string username, NekomataCore.Service listservice, NekomataCore.EntryType selectedtype) 103 | { 104 | // Create window handle 105 | if (!this.IsHandleCreated) 106 | { 107 | this.CreateControl(); 108 | } 109 | // Disable Export Button 110 | Utility.SafeInvoke(exportBtn, new Action(delegate { exportBtn.Enabled = false; }), false); 111 | Utility.SafeInvoke(this, new Action(delegate { this.disableclose(); exitToolStripMenuItem.Enabled = false; }), false); 112 | // Retrieve list 113 | Utility.SafeInvoke(progressBar1, new Action(delegate { progressBar1.Maximum = 3; progressBar1.Value = 0; }), false); 114 | List userlist; 115 | switch (listservice) 116 | { 117 | case Service.AniList: 118 | userlist = listnormalizer.RetrieveAniListList(selectedtype, username); 119 | break; 120 | case Service.Kitsu: 121 | userlist = listnormalizer.RetrieveKitsuList(selectedtype, username); 122 | break; 123 | default: 124 | ErrorOut("Invalid Service Selected. Please select a valid service and try again."); 125 | return; 126 | } 127 | if (!listnormalizer.erroredout) 128 | { 129 | Utility.SafeInvoke(progressBar1, new Action(delegate { progressBar1.Value = progressBar1.Value + 1; }), true); 130 | nltoMALXML.ConvertNormalizedListToMAL(userlist, selectedtype, username, listservice); 131 | if (nltoMALXML.InvalidEntriesExist()) 132 | { 133 | Utility.SafeInvoke(this, new Action(delegate 134 | { 135 | FailedWindow fdlg = new FailedWindow(nltoMALXML.faillist); 136 | if (fdlg.ShowDialog() == DialogResult.OK) 137 | { 138 | GenerateXMLandSave(); 139 | } 140 | }), true); 141 | } 142 | else 143 | { 144 | GenerateXMLandSave(); 145 | } 146 | } 147 | else 148 | { 149 | ErrorOut("Couldn't retrieve your list. Please check your username and try again"); 150 | listnormalizer.cleanup(); 151 | return; 152 | } 153 | } 154 | 155 | private void exitToolStripMenuItem_Click(object sender, EventArgs e) 156 | { 157 | Application.Exit(); 158 | } 159 | 160 | private void ErrorOut(string message) 161 | { 162 | Utility.SafeInvoke(exportBtn, new Action(delegate { exportBtn.Enabled = true; }), false); 163 | Utility.SafeInvoke(progressBar1, new Action(delegate { progressBar1.Value = 3; }), false); 164 | Utility.SafeInvoke(this, new Action(delegate { this.enableclose(); exitToolStripMenuItem.Enabled = true; }), false); 165 | MessageBox.Show(message, "Export Failed"); 166 | } 167 | 168 | private void GenerateXMLandSave() 169 | { 170 | this.setupdateonimport(); 171 | String XML = nltoMALXML.GenerateXML(); 172 | Utility.SafeInvoke(progressBar1, new Action(delegate { progressBar1.Value = progressBar1.Value + 1; }), false); 173 | Utility.SafeInvoke(this, new Action(delegate 174 | { 175 | SaveFileDialog savedialog = new SaveFileDialog(); 176 | savedialog.Filter = "Extended Markup Language file (*.xml)|*.xml"; 177 | savedialog.RestoreDirectory = true; 178 | if (savedialog.ShowDialog() == DialogResult.OK) 179 | { 180 | StreamWriter xmlfile = new StreamWriter(savedialog.OpenFile()); 181 | StringReader xmlReader = new StringReader(XML); 182 | if (xmlfile != null) 183 | { 184 | string line; 185 | while ((line = xmlReader.ReadLine()) != null) 186 | { 187 | xmlfile.WriteLine(line); 188 | } 189 | xmlfile.Close(); 190 | 191 | } 192 | this.showexportsuccess(); 193 | } 194 | nltoMALXML.cleanup(); 195 | listnormalizer.cleanup(); 196 | }), true); 197 | Utility.SafeInvoke(exportBtn, new Action(delegate { exportBtn.Enabled = true; }), false); 198 | Utility.SafeInvoke(progressBar1, new Action(delegate { progressBar1.Value = 3; }), false); 199 | Utility.SafeInvoke(this, new Action(delegate { this.enableclose(); exitToolStripMenuItem.Enabled = true; }), false); 200 | } 201 | 202 | private void checkForUpdatesToolStripMenuItem_Click(object sender, EventArgs e) 203 | { 204 | //System.Diagnostics.Process.Start("https://malupdaterosx.moe/nekomata/"); 205 | WinSparkle.win_sparkle_check_update_with_ui(); 206 | } 207 | 208 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 209 | { 210 | System.Diagnostics.Process.Start("https://malupdaterosx.moe/donate/"); 211 | } 212 | 213 | private void setupdateonimport() 214 | { 215 | nltoMALXML.updateonimportcurrent = Properties.Settings.Default.updateonimportcurrent; 216 | nltoMALXML.updateonimportcompleted = Properties.Settings.Default.updateonimportcompleted; 217 | nltoMALXML.updateonimportonhold = Properties.Settings.Default.updateonimportonhold; 218 | nltoMALXML.updateonimportdropped = Properties.Settings.Default.updateonimportdropped; 219 | nltoMALXML.updateonimportplanned = Properties.Settings.Default.updateonimportplanned; 220 | } 221 | 222 | private void settingsToolStripMenuItem_Click(object sender, EventArgs e) 223 | { 224 | if (this.settings == null || this.settings.IsDisposed) 225 | { 226 | this.settings = new Settingsdlg(); 227 | } 228 | this.settings.Show(); 229 | } 230 | 231 | private void showexportsuccess() 232 | { 233 | DialogResult result = MessageBox.Show("If you find this program helpful, please donate so we can continue developing it. Do you want to view the donation page now?", "Export Successful", MessageBoxButtons.YesNo); 234 | if (result == System.Windows.Forms.DialogResult.Yes) 235 | { 236 | System.Diagnostics.Process.Start("https://malupdaterosx.moe/donate/"); 237 | } 238 | } 239 | 240 | private void disableclose() 241 | { 242 | this.s_SystemMenuHandle = GetSystemMenu(this.Handle, false); 243 | DeleteMenu(this.s_SystemMenuHandle, 6, 1024); 244 | } 245 | private void enableclose() 246 | { 247 | this.s_SystemMenuHandle = GetSystemMenu(this.Handle, true); 248 | DeleteMenu(this.s_SystemMenuHandle, 6, 1024); 249 | } 250 | } 251 | public static class Utility 252 | { 253 | public static void SafeInvoke(this Control uiElement, Action updater, bool forceSynchronous) 254 | { 255 | if (uiElement == null) 256 | { 257 | throw new ArgumentNullException("uiElement"); 258 | } 259 | 260 | if (uiElement.InvokeRequired) 261 | { 262 | if (forceSynchronous) 263 | { 264 | uiElement.Invoke((Action)delegate { SafeInvoke(uiElement, updater, forceSynchronous); }); 265 | } 266 | else 267 | { 268 | uiElement.BeginInvoke((Action)delegate { SafeInvoke(uiElement, updater, forceSynchronous); }); 269 | } 270 | } 271 | else 272 | { 273 | if (uiElement.IsDisposed) 274 | { 275 | throw new ObjectDisposedException("Control is already disposed."); 276 | } 277 | 278 | updater(); 279 | } 280 | } 281 | } 282 | } 283 | -------------------------------------------------------------------------------- /Nekomata/Nekomata.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | {6ACCC2AB-224E-4214-A299-3563F6CDC9F8} 9 | WinExe 10 | Nekomata 11 | Nekomata 12 | v4.6.1 13 | 512 14 | true 15 | 16 | 17 | publish\ 18 | true 19 | Disk 20 | false 21 | Foreground 22 | 7 23 | Days 24 | false 25 | false 26 | true 27 | 0 28 | 0.0.1.%2a 29 | false 30 | false 31 | true 32 | 33 | 34 | x64 35 | true 36 | full 37 | false 38 | bin\Debug\ 39 | DEBUG;TRACE 40 | prompt 41 | 4 42 | false 43 | 44 | 45 | AnyCPU 46 | pdbonly 47 | true 48 | bin\Release\ 49 | TRACE 50 | prompt 51 | 4 52 | 53 | 54 | nekomata.ico 55 | 56 | 57 | 58 | ..\packages\CrashReporter.NET.Official.1.5.5\lib\net452\CrashReporter.NET.dll 59 | 60 | 61 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 62 | 63 | 64 | ..\packages\RestSharp.106.3.1\lib\net452\RestSharp.dll 65 | 66 | 67 | 68 | 69 | 70 | ..\packages\System.Data.SQLite.Core.1.0.108.0\lib\net46\System.Data.SQLite.dll 71 | 72 | 73 | ..\packages\System.Data.SQLite.EF6.1.0.108.0\lib\net46\System.Data.SQLite.EF6.dll 74 | 75 | 76 | ..\packages\System.Data.SQLite.Linq.1.0.108.0\lib\net46\System.Data.SQLite.Linq.dll 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | Form 91 | 92 | 93 | AboutBox.cs 94 | 95 | 96 | 97 | Form 98 | 99 | 100 | FailedWindow.cs 101 | 102 | 103 | Form 104 | 105 | 106 | MainWindow.cs 107 | 108 | 109 | 110 | 111 | Form 112 | 113 | 114 | Settingsdlg.cs 115 | 116 | 117 | AboutBox.cs 118 | 119 | 120 | FailedWindow.cs 121 | 122 | 123 | MainWindow.cs 124 | 125 | 126 | ResXFileCodeGenerator 127 | Resources.Designer.cs 128 | Designer 129 | 130 | 131 | True 132 | Resources.resx 133 | 134 | 135 | Settingsdlg.cs 136 | 137 | 138 | 139 | SettingsSingleFileGenerator 140 | Settings.Designer.cs 141 | 142 | 143 | True 144 | Settings.settings 145 | True 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | False 154 | Microsoft .NET Framework 4.6.1 %28x86 and x64%29 155 | true 156 | 157 | 158 | False 159 | .NET Framework 3.5 SP1 160 | false 161 | 162 | 163 | 164 | 165 | {19B00327-56CE-406F-AE63-5293E61680A9} 166 | NekomataCore 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 176 | 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /Nekomata/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using CrashReporterDotNET; 7 | 8 | namespace Nekomata 9 | { 10 | static class Program 11 | { 12 | /// 13 | /// The main entry point for the application. 14 | /// 15 | [STAThread] 16 | static void Main() 17 | { 18 | Application.ThreadException += ApplicationThreadException; 19 | 20 | AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; 21 | 22 | Application.EnableVisualStyles(); 23 | Application.SetCompatibleTextRenderingDefault(false); 24 | Application.Run(new MainWindow()); 25 | 26 | } 27 | 28 | private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) 29 | { 30 | SendReport((Exception)unhandledExceptionEventArgs.ExceptionObject); 31 | Environment.Exit(0); 32 | } 33 | 34 | private static void ApplicationThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) 35 | { 36 | SendReport(e.Exception); 37 | } 38 | 39 | public static void SendReport(Exception exception, string developerMessage = "") 40 | { 41 | var reportCrash = new ReportCrash("ateliershiori@moyit.pro") 42 | { 43 | DeveloperMessage = developerMessage 44 | }; 45 | 46 | reportCrash.Send(exception); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Nekomata/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Nekomata")] 9 | [assembly: AssemblyDescription("AniList and Kitsu to MyAnimeList XML Exporter")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("MAL Updater OS X Group")] 12 | [assembly: AssemblyProduct("Nekomata")] 13 | [assembly: AssemblyCopyright("Copyright © 2018 MAL Updater OS X Group")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(true)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6accc2ab-224e-4214-a299-3563f6cdc9f8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.1.0")] 36 | [assembly: AssemblyFileVersion("1.0.1.0")] 37 | -------------------------------------------------------------------------------- /Nekomata/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Nekomata.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Nekomata.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Nekomata/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Nekomata/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Nekomata.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 29 | public bool updateonimportcurrent { 30 | get { 31 | return ((bool)(this["updateonimportcurrent"])); 32 | } 33 | set { 34 | this["updateonimportcurrent"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 41 | public bool updateonimportcompleted { 42 | get { 43 | return ((bool)(this["updateonimportcompleted"])); 44 | } 45 | set { 46 | this["updateonimportcompleted"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 53 | public bool updateonimportonhold { 54 | get { 55 | return ((bool)(this["updateonimportonhold"])); 56 | } 57 | set { 58 | this["updateonimportonhold"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 65 | public bool updateonimportdropped { 66 | get { 67 | return ((bool)(this["updateonimportdropped"])); 68 | } 69 | set { 70 | this["updateonimportdropped"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 77 | public bool updateonimportplanned { 78 | get { 79 | return ((bool)(this["updateonimportplanned"])); 80 | } 81 | set { 82 | this["updateonimportplanned"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 89 | public bool Setting { 90 | get { 91 | return ((bool)(this["Setting"])); 92 | } 93 | set { 94 | this["Setting"] = value; 95 | } 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Nekomata/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | False 10 | 11 | 12 | False 13 | 14 | 15 | False 16 | 17 | 18 | False 19 | 20 | 21 | False 22 | 23 | 24 | -------------------------------------------------------------------------------- /Nekomata/Settingsdlg.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace Nekomata 2 | { 3 | partial class Settingsdlg 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 32 | this.planned = new System.Windows.Forms.CheckBox(); 33 | this.dropped = new System.Windows.Forms.CheckBox(); 34 | this.onhold = new System.Windows.Forms.CheckBox(); 35 | this.completed = new System.Windows.Forms.CheckBox(); 36 | this.current = new System.Windows.Forms.CheckBox(); 37 | this.label1 = new System.Windows.Forms.Label(); 38 | this.groupBox1.SuspendLayout(); 39 | this.SuspendLayout(); 40 | // 41 | // groupBox1 42 | // 43 | this.groupBox1.Controls.Add(this.planned); 44 | this.groupBox1.Controls.Add(this.dropped); 45 | this.groupBox1.Controls.Add(this.onhold); 46 | this.groupBox1.Controls.Add(this.completed); 47 | this.groupBox1.Controls.Add(this.current); 48 | this.groupBox1.Location = new System.Drawing.Point(18, 46); 49 | this.groupBox1.Name = "groupBox1"; 50 | this.groupBox1.Size = new System.Drawing.Size(200, 171); 51 | this.groupBox1.TabIndex = 0; 52 | this.groupBox1.TabStop = false; 53 | this.groupBox1.Text = "Set Update on Import"; 54 | // 55 | // planned 56 | // 57 | this.planned.AutoSize = true; 58 | this.planned.Checked = global::Nekomata.Properties.Settings.Default.updateonimportplanned; 59 | this.planned.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Nekomata.Properties.Settings.Default, "updateonimportplanned", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); 60 | this.planned.Location = new System.Drawing.Point(19, 113); 61 | this.planned.Name = "planned"; 62 | this.planned.Size = new System.Drawing.Size(123, 17); 63 | this.planned.TabIndex = 4; 64 | this.planned.Text = "Plan to watch/read"; 65 | this.planned.UseVisualStyleBackColor = true; 66 | this.planned.CheckedChanged += new System.EventHandler(this.planned_CheckedChanged); 67 | // 68 | // dropped 69 | // 70 | this.dropped.AutoSize = true; 71 | this.dropped.Checked = global::Nekomata.Properties.Settings.Default.updateonimportdropped; 72 | this.dropped.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Nekomata.Properties.Settings.Default, "updateonimportdropped", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); 73 | this.dropped.Location = new System.Drawing.Point(19, 91); 74 | this.dropped.Name = "dropped"; 75 | this.dropped.Size = new System.Drawing.Size(72, 17); 76 | this.dropped.TabIndex = 3; 77 | this.dropped.Text = "Dropped"; 78 | this.dropped.UseVisualStyleBackColor = true; 79 | this.dropped.CheckedChanged += new System.EventHandler(this.dropped_CheckedChanged); 80 | // 81 | // onhold 82 | // 83 | this.onhold.AutoSize = true; 84 | this.onhold.Checked = global::Nekomata.Properties.Settings.Default.updateonimportonhold; 85 | this.onhold.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Nekomata.Properties.Settings.Default, "updateonimportonhold", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); 86 | this.onhold.Location = new System.Drawing.Point(19, 67); 87 | this.onhold.Name = "onhold"; 88 | this.onhold.Size = new System.Drawing.Size(70, 17); 89 | this.onhold.TabIndex = 2; 90 | this.onhold.Text = "On-hold"; 91 | this.onhold.UseVisualStyleBackColor = true; 92 | this.onhold.CheckedChanged += new System.EventHandler(this.onhold_CheckedChanged); 93 | // 94 | // completed 95 | // 96 | this.completed.AutoSize = true; 97 | this.completed.Checked = global::Nekomata.Properties.Settings.Default.updateonimportcompleted; 98 | this.completed.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Nekomata.Properties.Settings.Default, "updateonimportcompleted", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); 99 | this.completed.Location = new System.Drawing.Point(19, 45); 100 | this.completed.Name = "completed"; 101 | this.completed.Size = new System.Drawing.Size(82, 17); 102 | this.completed.TabIndex = 1; 103 | this.completed.Text = "Completed"; 104 | this.completed.UseVisualStyleBackColor = true; 105 | this.completed.CheckedChanged += new System.EventHandler(this.completed_CheckedChanged); 106 | // 107 | // current 108 | // 109 | this.current.AutoSize = true; 110 | this.current.Checked = global::Nekomata.Properties.Settings.Default.updateonimportcurrent; 111 | this.current.CheckState = System.Windows.Forms.CheckState.Checked; 112 | this.current.DataBindings.Add(new System.Windows.Forms.Binding("Checked", global::Nekomata.Properties.Settings.Default, "updateonimportcurrent", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)); 113 | this.current.Location = new System.Drawing.Point(19, 22); 114 | this.current.Name = "current"; 115 | this.current.Size = new System.Drawing.Size(123, 17); 116 | this.current.TabIndex = 0; 117 | this.current.Text = "Watching/Reading"; 118 | this.current.UseVisualStyleBackColor = true; 119 | this.current.CheckedChanged += new System.EventHandler(this.current_CheckedChanged); 120 | // 121 | // label1 122 | // 123 | this.label1.AutoSize = true; 124 | this.label1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 125 | this.label1.Location = new System.Drawing.Point(12, 18); 126 | this.label1.Name = "label1"; 127 | this.label1.Size = new System.Drawing.Size(58, 13); 128 | this.label1.TabIndex = 1; 129 | this.label1.Text = "Exporting"; 130 | // 131 | // Settingsdlg 132 | // 133 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 134 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 135 | this.ClientSize = new System.Drawing.Size(289, 244); 136 | this.Controls.Add(this.label1); 137 | this.Controls.Add(this.groupBox1); 138 | this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 139 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 140 | this.MaximizeBox = false; 141 | this.MinimizeBox = false; 142 | this.Name = "Settingsdlg"; 143 | this.Text = "Settings"; 144 | this.Load += new System.EventHandler(this.Settings_Load); 145 | this.groupBox1.ResumeLayout(false); 146 | this.groupBox1.PerformLayout(); 147 | this.ResumeLayout(false); 148 | this.PerformLayout(); 149 | 150 | } 151 | 152 | #endregion 153 | 154 | private System.Windows.Forms.GroupBox groupBox1; 155 | private System.Windows.Forms.CheckBox planned; 156 | private System.Windows.Forms.CheckBox dropped; 157 | private System.Windows.Forms.CheckBox onhold; 158 | private System.Windows.Forms.CheckBox completed; 159 | private System.Windows.Forms.CheckBox current; 160 | private System.Windows.Forms.Label label1; 161 | } 162 | } -------------------------------------------------------------------------------- /Nekomata/Settingsdlg.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace Nekomata 12 | { 13 | public partial class Settingsdlg : Form 14 | { 15 | public Settingsdlg() 16 | { 17 | InitializeComponent(); 18 | } 19 | 20 | private void Settings_Load(object sender, EventArgs e) 21 | { 22 | 23 | } 24 | 25 | private void current_CheckedChanged(object sender, EventArgs e) 26 | { 27 | Properties.Settings.Default.updateonimportcurrent = current.Checked; 28 | Properties.Settings.Default.Save(); 29 | } 30 | 31 | private void completed_CheckedChanged(object sender, EventArgs e) 32 | { 33 | Properties.Settings.Default.updateonimportcompleted = completed.Checked; 34 | Properties.Settings.Default.Save(); 35 | } 36 | 37 | private void onhold_CheckedChanged(object sender, EventArgs e) 38 | { 39 | Properties.Settings.Default.updateonimportonhold = onhold.Checked; 40 | Properties.Settings.Default.Save(); 41 | } 42 | 43 | private void dropped_CheckedChanged(object sender, EventArgs e) 44 | { 45 | Properties.Settings.Default.updateonimportdropped = dropped.Checked; 46 | Properties.Settings.Default.Save(); 47 | } 48 | 49 | private void planned_CheckedChanged(object sender, EventArgs e) 50 | { 51 | Properties.Settings.Default.updateonimportplanned = planned.Checked; 52 | Properties.Settings.Default.Save(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Nekomata/Settingsdlg.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /Nekomata/WinSparkle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace Nekomata 5 | { 6 | 7 | class WinSparkle 8 | { 9 | // Note that some of these functions are not implemented by WinSparkle YET. 10 | [DllImport("WinSparkle.dll", CallingConvention = CallingConvention.Cdecl)] 11 | public static extern void win_sparkle_init(); 12 | [DllImport("WinSparkle.dll", CallingConvention = CallingConvention.Cdecl)] 13 | public static extern void win_sparkle_cleanup(); 14 | [DllImport("WinSparkle.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] 15 | public static extern void win_sparkle_set_appcast_url(String url); 16 | [DllImport("WinSparkle.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] 17 | public static extern void win_sparkle_set_app_details(String company_name, 18 | String app_name, 19 | String app_version); 20 | [DllImport("WinSparkle.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] 21 | public static extern void win_sparkle_set_registry_path(String path); 22 | [DllImport("WinSparkle.dll", CallingConvention = CallingConvention.Cdecl)] 23 | public static extern void win_sparkle_check_update_with_ui(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Nekomata/nekomata-windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MALUpdaterOSXArchive/Nekomata/6544f0df100d8723b6b3d0a2f51ffeee18ff247b/Nekomata/nekomata-windows.png -------------------------------------------------------------------------------- /Nekomata/nekomata.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MALUpdaterOSXArchive/Nekomata/6544f0df100d8723b6b3d0a2f51ffeee18ff247b/Nekomata/nekomata.ico -------------------------------------------------------------------------------- /Nekomata/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /NekomataCore/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /NekomataCore/GraphQLQuery.cs: -------------------------------------------------------------------------------- 1 | /* GraphQLQuery.cs 2 | * This class specifies the GraphQL Query object. 3 | * 4 | * Copyright (c) 2018 MAL Updater OS X Group, a division of Moy IT Solutions 5 | * Licensed under MIT License 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Text; 12 | using System.Threading.Tasks; 13 | 14 | namespace NekomataCore 15 | { 16 | public class GraphQLQuery 17 | { 18 | public string query { get; set; } 19 | public object variables { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /NekomataCore/ListEntry.cs: -------------------------------------------------------------------------------- 1 | /* ListEntry.cs 2 | * This class specifies the ListEntry object, which is a entry on an Anime or Manga List 3 | * 4 | * Copyright (c) 2018 MAL Updater OS X Group, a division of Moy IT Solutions 5 | * Licensed under MIT License 6 | */ 7 | 8 | using System; 9 | 10 | namespace NekomataCore 11 | { 12 | public enum EntryType 13 | { 14 | Anime = 0, 15 | Manga = 1 16 | } 17 | public enum EntryStatus 18 | { 19 | current = 11, 20 | completed = 12, 21 | dropped = 13, 22 | paused = 14, 23 | planning = 15 24 | } 25 | public class ListEntry 26 | { 27 | public int titleId; 28 | public EntryType type; 29 | public String title; 30 | public EntryStatus entryStatus; 31 | public int progress; 32 | public int progressVolumes; 33 | public bool repeating; 34 | public int repeatCount; 35 | public String startDate; 36 | public String endDate; 37 | public String personalComments; 38 | public int totalSegment; 39 | public int totalVolumes; 40 | public String mediaFormat; 41 | public int rating; 42 | 43 | public ListEntry (int etitleid, String etitle, EntryStatus estatus, int eprogress) 44 | { 45 | // This constructor creates an anime entry 46 | this.titleId = etitleid; 47 | this.type = EntryType.Anime; 48 | this.title = etitle; 49 | this.entryStatus = estatus; 50 | this.progress = eprogress; 51 | this.progressVolumes = 0; 52 | this.repeating = false; 53 | this.repeatCount = 0; 54 | this.startDate = ""; 55 | this.endDate = ""; 56 | this.personalComments = ""; 57 | this.rating = 0; 58 | } 59 | public ListEntry(int etitleid, String etitle, EntryStatus estatus, int eprogress, int eprogressvolumes) 60 | { 61 | // This constructor creates an manga entry 62 | this.titleId = etitleid; 63 | this.type = EntryType.Manga; 64 | this.title = etitle; 65 | this.entryStatus = estatus; 66 | this.progress = eprogress; 67 | this.progressVolumes = eprogressvolumes; 68 | this.repeating = false; 69 | this.repeatCount = 0; 70 | this.startDate = ""; 71 | this.endDate = ""; 72 | this.personalComments = ""; 73 | this.rating = 0; 74 | } 75 | 76 | public String getEntryStatusStringMAL() 77 | { 78 | // Converts Enum EntryStatus to MAL String Status 79 | if (this.type == EntryType.Anime) 80 | { 81 | switch (this.entryStatus) 82 | { 83 | case EntryStatus.current: 84 | return "Watching"; 85 | case EntryStatus.completed: 86 | return "Completed"; 87 | case EntryStatus.dropped: 88 | return "Dropped"; 89 | case EntryStatus.planning: 90 | return "Plan to Watch"; 91 | case EntryStatus.paused: 92 | return "On Hold"; 93 | default: 94 | return ""; 95 | } 96 | } 97 | else if (this.type == EntryType.Manga) 98 | { 99 | switch (this.entryStatus) 100 | { 101 | case EntryStatus.current: 102 | return "Reading"; 103 | case EntryStatus.completed: 104 | return "Completed"; 105 | case EntryStatus.dropped: 106 | return "Dropped"; 107 | case EntryStatus.planning: 108 | return "Plan to Read"; 109 | case EntryStatus.paused: 110 | return "On Hold"; 111 | default: 112 | return ""; 113 | } 114 | } 115 | return ""; 116 | } 117 | 118 | public void setRatingTwentytoStandardRating(int ratingTwenty) 119 | { 120 | // Converts Rating Twenty to a raw score 121 | double advrating = 0.0; 122 | switch (ratingTwenty) 123 | { 124 | case 2: 125 | advrating = 1.0; 126 | break; 127 | case 3: 128 | advrating = 1.5; 129 | break; 130 | case 4: 131 | advrating = 2.0; 132 | break; 133 | case 5: 134 | advrating = 2.5; 135 | break; 136 | case 6: 137 | advrating = 3.0; 138 | break; 139 | case 7: 140 | advrating = 3.5; 141 | break; 142 | case 8: 143 | advrating = 4.0; 144 | break; 145 | case 9: 146 | advrating = 4.5; 147 | break; 148 | case 10: 149 | advrating = 5.0; 150 | break; 151 | case 11: 152 | advrating = 5.5; 153 | break; 154 | case 12: 155 | advrating = 6.0; 156 | break; 157 | case 13: 158 | advrating = 6.5; 159 | break; 160 | case 14: 161 | advrating = 7.0; 162 | break; 163 | case 15: 164 | advrating = 7.5; 165 | break; 166 | case 16: 167 | advrating = 8.0; 168 | break; 169 | case 17: 170 | advrating = 8.5; 171 | break; 172 | case 18: 173 | advrating = 9.0; 174 | break; 175 | case 19: 176 | advrating = 9.5; 177 | break; 178 | case 20: 179 | advrating = 10.0; 180 | break; 181 | default: 182 | break; 183 | } 184 | // Convert to raw score 185 | this.rating = (int)(advrating * 100); 186 | } 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /NekomataCore/ListNormalizer.cs: -------------------------------------------------------------------------------- 1 | /* ListNormalizer.cs 2 | * This class retrieves lists and normalizes them. 3 | * 4 | * Copyright (c) 2018 MAL Updater OS X Group, a division of Moy IT Solutions 5 | * Licensed under MIT License 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Text; 12 | using System.Threading.Tasks; 13 | using RestSharp; 14 | using Newtonsoft.Json; 15 | using Newtonsoft.Json.Linq; 16 | using System.Threading; 17 | 18 | namespace NekomataCore 19 | { 20 | public class ListNormalizer 21 | { 22 | private List> tmplist; 23 | private List> attributes; 24 | RestClient krestclient; 25 | RestClient arestclient; 26 | private int currentuserid; 27 | private EntryType currenttype; 28 | public bool erroredout; 29 | public TitleIDConverter tconverter; 30 | 31 | public ListNormalizer() 32 | { 33 | arestclient = new RestClient("https://graphql.anilist.co"); 34 | krestclient = new RestClient("https://kitsu.io/api/edge"); 35 | tmplist = new List>(); 36 | attributes = new List>(); 37 | } 38 | 39 | public List RetrieveAniListList(EntryType type, String Username) 40 | { 41 | this.erroredout = false; 42 | this.currentuserid = this.GetAniListUserID(Username); 43 | if (this.currentuserid > 0) 44 | { 45 | this.currenttype = type; 46 | return this.PerformRetrieveAniListList(0); 47 | } 48 | else 49 | { 50 | this.erroredout = true; 51 | return new List(); 52 | } 53 | } 54 | 55 | private List PerformRetrieveAniListList(int page) 56 | { 57 | RestRequest request = new RestRequest("/", Method.POST); 58 | request.RequestFormat = DataFormat.Json; 59 | GraphQLQuery gquery = new GraphQLQuery(); 60 | switch (currenttype) 61 | { 62 | case EntryType.Anime: 63 | gquery.query = "query ($id : Int!, $page: Int) {\n AnimeList: Page (page: $page) {\n mediaList(userId: $id, type: ANIME) {\n id :media{id\n idMal}\n entryid: id\n title: media {title {\n title: userPreferred\n }}\n episodes: media{episodes}\n duration: media{duration}\n image_url: media{coverImage {\n large\n medium\n }}\n type: media{format}\n status: media{status}\n score: score(format: POINT_100)\n watched_episodes: progress\n watched_status: status\n rewatch_count: repeat\n private\n notes\n watching_start: startedAt {\n year\n month\n day\n }\n watching_end: completedAt {\n year\n month\n day\n }\n }\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n }\n}"; 64 | break; 65 | case EntryType.Manga: 66 | gquery.query = "query ($id : Int!, $page: Int) {\n MangaList: Page (page: $page) {\n mediaList(userId: $id, type: MANGA) {\n id :media{id\n idMal}\n entryid: id\n title: media {title {\n title: userPreferred\n }}\n chapters: media{chapters}\n volumes: media{volumes}\n image_url: media{coverImage {\n large\n medium\n }}\n type: media{format}\n status: media{status}\n score: score(format: POINT_100)\n read_chapters: progress\n read_volumes: progressVolumes\n read_status: status\n reread_count: repeat\n private\n notes\n read_start: startedAt {\n year\n month\n day\n }\n read_end: completedAt {\n year\n month\n day\n }\n }\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n }\n}"; 67 | break; 68 | default: 69 | return new List(); 70 | } 71 | gquery.variables = new Dictionary { { "id", currentuserid.ToString() }, { "page", page.ToString() } }; 72 | request.AddJsonBody(gquery); 73 | IRestResponse response = arestclient.Execute(request); 74 | Thread.Sleep(1000); 75 | if (response.StatusCode.GetHashCode() == 200) 76 | { 77 | Dictionary jsonData = JsonConvert.DeserializeObject>(response.Content); 78 | Dictionary list; 79 | switch (currenttype) 80 | { 81 | case EntryType.Anime: 82 | list = JObjectToDictionary((JObject)JObjectToDictionary((JObject)jsonData["data"])["AnimeList"]); 83 | break; 84 | case EntryType.Manga: 85 | list = JObjectToDictionary((JObject)JObjectToDictionary((JObject)jsonData["data"])["MangaList"]); 86 | break; 87 | default: 88 | return new List(); 89 | } 90 | Dictionary pageData = JObjectToDictionary((JObject)list["pageInfo"]); 91 | tmplist.AddRange(((JArray)list["mediaList"]).ToObject>>()); 92 | bool nextpage = (bool)pageData[@"hasNextPage"]; 93 | if (nextpage) 94 | { 95 | int newpage = page + 1; 96 | return this.PerformRetrieveAniListList(newpage); 97 | } 98 | else 99 | { 100 | // Convert List 101 | switch (currenttype) 102 | { 103 | case EntryType.Anime: 104 | return this.NormalizeAniListAnimeList(); 105 | case EntryType.Manga: 106 | return this.NormalizeAniListMangaList(); 107 | default: 108 | return new List(); 109 | } 110 | } 111 | } 112 | else 113 | { 114 | this.erroredout = true; 115 | return new List(); 116 | } 117 | } 118 | 119 | private List NormalizeAniListAnimeList() 120 | { 121 | // Create temp list 122 | List tmplistentries = new List(); 123 | 124 | foreach (Dictionary entry in this.tmplist) 125 | { 126 | int titleId = Convert.ToInt32((long)JObjectToDictionary((JObject)entry["id"])["id"]); 127 | int idMal = !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["id"])["idMal"]) ? Convert.ToInt32((long)JObjectToDictionary((JObject)entry["id"])["idMal"]) : -1; 128 | if (idMal > 0 && tconverter.RetreiveSavedMALIDFromServiceID(Service.AniList, titleId, EntryType.Anime) < 0) 129 | { 130 | tconverter.SaveIDtoDatabase(Service.AniList, idMal, titleId, EntryType.Anime); 131 | } 132 | String title = (String)(JObjectToDictionary((JObject)(JObjectToDictionary((JObject)entry["title"]))["title"]))["title"]; 133 | String tmpstatus = (String)entry["watched_status"]; 134 | bool reconsuming = false; 135 | EntryStatus eStatus; 136 | switch (tmpstatus) 137 | { 138 | case "PAUSED": 139 | eStatus = EntryStatus.paused; 140 | break; 141 | case "PLANNING": 142 | eStatus = EntryStatus.planning; 143 | break; 144 | case "CURRENT": 145 | eStatus = EntryStatus.current; 146 | break; 147 | case "REPEATING": 148 | reconsuming = true; 149 | eStatus = EntryStatus.current; 150 | break; 151 | case "COMPLETED": 152 | eStatus = EntryStatus.completed; 153 | break; 154 | case "DROPPED": 155 | eStatus = EntryStatus.dropped; 156 | break; 157 | default: 158 | eStatus = EntryStatus.current; 159 | break; 160 | } 161 | int progress = Convert.ToInt32((long)entry["watched_episodes"]); 162 | ListEntry newentry = new ListEntry(titleId, title, eStatus, progress); 163 | newentry.totalSegment = (!object.ReferenceEquals(null, (JObjectToDictionary((JObject)entry["episodes"]))["episodes"])) ? Convert.ToInt32((long)(JObjectToDictionary((JObject)entry["episodes"]))["episodes"]) : 0; 164 | newentry.mediaFormat = (String)(JObjectToDictionary((JObject)entry["type"]))["format"]; 165 | newentry.repeating = reconsuming; 166 | newentry.repeatCount = Convert.ToInt32((long)entry["rewatch_count"]); 167 | newentry.personalComments = (String)entry["notes"]; 168 | newentry.rating = Convert.ToInt32((long)entry["score"]); 169 | if (!object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["watching_start"])["year"]) && !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["watching_start"])["month"]) && !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["watching_start"])["day"])) 170 | { 171 | newentry.startDate = (long)JObjectToDictionary((JObject)entry["watching_start"])["year"] + "-" + ((long)JObjectToDictionary((JObject)entry["watching_start"])["month"] < 10 ? "0" + ((long)JObjectToDictionary((JObject)entry["watching_start"])["month"]).ToString() : ((long)JObjectToDictionary((JObject)entry["watching_start"])["month"]).ToString()) + "-" + ((long)JObjectToDictionary((JObject)entry["watching_start"])["day"] < 10 ? "0" + ((long)JObjectToDictionary((JObject)entry["watching_start"])["day"]).ToString() : ((long)JObjectToDictionary((JObject)entry["watching_start"])["day"]).ToString()); 172 | } 173 | else 174 | { 175 | newentry.startDate = "0000-00-00"; 176 | } 177 | if (!object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["watching_end"])["year"]) && !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["watching_end"])["month"]) && !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["watching_end"])["day"])) 178 | { 179 | newentry.endDate = (long)JObjectToDictionary((JObject)entry["watching_end"])["year"] + "-" + ((long)JObjectToDictionary((JObject)entry["watching_end"])["month"] < 10 ? "0" + ((long)JObjectToDictionary((JObject)entry["watching_end"])["month"]).ToString() : ((long)JObjectToDictionary((JObject)entry["watching_end"])["month"]).ToString()) + "-" + ((long)JObjectToDictionary((JObject)entry["watching_end"])["day"] < 10 ? "0" + ((long)JObjectToDictionary((JObject)entry["watching_end"])["day"]).ToString() : ((long)JObjectToDictionary((JObject)entry["watching_end"])["day"]).ToString()); 180 | } 181 | else 182 | { 183 | newentry.endDate = "0000-00-00"; 184 | } 185 | // Add entry 186 | tmplistentries.Add(newentry); 187 | } 188 | return tmplistentries; 189 | } 190 | 191 | private List NormalizeAniListMangaList() 192 | { 193 | // Create temp list 194 | List tmplistentries = new List(); 195 | 196 | foreach (Dictionary entry in this.tmplist) 197 | { 198 | int titleId = Convert.ToInt32((long)JObjectToDictionary((JObject)entry["id"])["id"]); 199 | int idMal = !(object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["id"])["idMal"])) ? Convert.ToInt32((long)JObjectToDictionary((JObject)entry["id"])["idMal"]) : -1; 200 | if (idMal > 0 && tconverter.RetreiveSavedMALIDFromServiceID(Service.AniList, titleId, EntryType.Manga) < 0) 201 | { 202 | tconverter.SaveIDtoDatabase(Service.AniList, idMal, titleId, EntryType.Manga); 203 | } 204 | String title = (String)(JObjectToDictionary((JObject)(JObjectToDictionary((JObject)entry["title"]))["title"]))["title"]; 205 | String tmpstatus = (String)entry["read_status"]; 206 | bool reconsuming = false; 207 | EntryStatus eStatus; 208 | switch (tmpstatus) 209 | { 210 | case "PAUSED": 211 | eStatus = EntryStatus.paused; 212 | break; 213 | case "PLANNING": 214 | eStatus = EntryStatus.planning; 215 | break; 216 | case "CURRENT": 217 | eStatus = EntryStatus.current; 218 | break; 219 | case "REPEATING": 220 | reconsuming = true; 221 | eStatus = EntryStatus.current; 222 | break; 223 | case "COMPLETED": 224 | eStatus = EntryStatus.completed; 225 | break; 226 | case "DROPPED": 227 | eStatus = EntryStatus.dropped; 228 | break; 229 | default: 230 | eStatus = EntryStatus.current; 231 | break; 232 | } 233 | int progress = Convert.ToInt32((long)entry["read_chapters"]); 234 | int progressVolumes = Convert.ToInt32((long)entry["read_volumes"]); 235 | ListEntry newentry = new ListEntry(titleId, title, eStatus, progress, progressVolumes); 236 | newentry.totalSegment = (!object.ReferenceEquals(null, (JObjectToDictionary((JObject)entry["chapters"]))["chapters"])) ? Convert.ToInt32((long)(JObjectToDictionary((JObject)entry["chapters"]))["chapters"]) : 0; 237 | newentry.totalVolumes = (!object.ReferenceEquals(null, (JObjectToDictionary((JObject)entry["volumes"]))["volumes"])) ? Convert.ToInt32((long)(JObjectToDictionary((JObject)entry["volumes"]))["volumes"]) : 0; 238 | newentry.mediaFormat = (String)(JObjectToDictionary((JObject)entry["type"]))["format"]; 239 | newentry.repeating = reconsuming; 240 | newentry.repeatCount = Convert.ToInt32((long)entry["reread_count"]); 241 | newentry.personalComments = (String)entry["notes"]; 242 | newentry.rating = Convert.ToInt32((long)entry["score"]); 243 | if (!object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["read_start"])["year"]) && !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["read_start"])["month"]) && !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["read_start"])["day"])) 244 | { 245 | newentry.startDate = (long)JObjectToDictionary((JObject)entry["read_start"])["year"] + "-" + ((long)JObjectToDictionary((JObject)entry["read_start"])["month"] < 10 ? "0" + ((long)JObjectToDictionary((JObject)entry["read_start"])["month"]).ToString() : ((long)JObjectToDictionary((JObject)entry["read_start"])["month"]).ToString()) + "-" + ((long)JObjectToDictionary((JObject)entry["read_start"])["day"] < 10 ? "0" + ((long)JObjectToDictionary((JObject)entry["read_start"])["day"]).ToString() : ((long)JObjectToDictionary((JObject)entry["read_start"])["day"]).ToString()); 246 | } 247 | else 248 | { 249 | newentry.startDate = "0000-00-00"; 250 | } 251 | if (!object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["read_end"])["year"]) && !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["read_end"])["month"]) && !object.ReferenceEquals(null, JObjectToDictionary((JObject)entry["read_end"])["day"])) 252 | { 253 | newentry.endDate = (long)JObjectToDictionary((JObject)entry["read_end"])["year"] + "-" + ((long)JObjectToDictionary((JObject)entry["read_end"])["month"] < 10 ? "0" + ((long)JObjectToDictionary((JObject)entry["read_end"])["month"]).ToString() : ((long)JObjectToDictionary((JObject)entry["read_end"])["month"]).ToString()) + "-" + ((long)JObjectToDictionary((JObject)entry["read_end"])["day"] < 10 ? "0" + ((long)JObjectToDictionary((JObject)entry["read_end"])["day"]).ToString() : ((long)JObjectToDictionary((JObject)entry["read_end"])["day"]).ToString()); 254 | } 255 | else 256 | { 257 | newentry.endDate = "0000-00-00"; 258 | } 259 | // Add entry 260 | tmplistentries.Add(newentry); 261 | } 262 | return tmplistentries; 263 | } 264 | /* 265 | * Kitsu 266 | */ 267 | 268 | public List RetrieveKitsuList(EntryType type, String Username) 269 | { 270 | this.erroredout = false; 271 | this.currentuserid = this.GetKitsuUserID(Username); 272 | if (this.currentuserid > 0) 273 | { 274 | this.currenttype = type; 275 | return this.PerformRetrieveKitsuList(0); 276 | } 277 | else 278 | { 279 | this.erroredout = true; 280 | return new List(); 281 | } 282 | } 283 | private List PerformRetrieveKitsuList(int page) 284 | { 285 | String listtype = ""; 286 | String includes = ""; 287 | switch (currenttype) 288 | { 289 | case EntryType.Anime: 290 | listtype = "anime"; 291 | includes = "canonicalTitle,episodeCount,episodeLength,showType,posterImage,status,mappings"; 292 | break; 293 | case EntryType.Manga: 294 | listtype = "manga"; 295 | includes = "canonicalTitle,chapterCount,volumeCount,mangaType,posterImage,status,mappings"; 296 | break; 297 | default: 298 | return new List(); 299 | } 300 | RestRequest request = new RestRequest("/library-entries?filter[userId]=" + this.currentuserid + "&filter[kind]=" + listtype + "&include=" + listtype + "," + listtype + ".mappings" + "&fields[" + listtype + "]=" + includes + "&fields[mappings]=externalSite,externalId&page[limit]=500&page[offset]=" + page, Method.GET); 301 | request.RequestFormat = DataFormat.Json; 302 | request.AddHeader("Accept", "application/vnd.api+json"); 303 | 304 | IRestResponse response = krestclient.Execute(request); 305 | if (response.StatusCode.GetHashCode() == 200) 306 | { 307 | Dictionary jsonData = JsonConvert.DeserializeObject>(response.Content); 308 | List> list; 309 | List> metadata; 310 | list = ((JArray)jsonData["data"]).ToObject>>(); 311 | if (!object.ReferenceEquals(null, jsonData["data"])) 312 | { 313 | metadata = ((JArray)jsonData["included"]).ToObject>>(); 314 | attributes.AddRange(metadata); 315 | } 316 | tmplist.AddRange(list); 317 | Dictionary links = ((JObject)jsonData["links"]).ToObject>(); 318 | bool nextpage = links.ContainsKey("next"); 319 | if (nextpage) 320 | { 321 | int newpage = page + 500; 322 | return this.PerformRetrieveKitsuList(newpage); 323 | } 324 | else 325 | { 326 | // Convert List 327 | switch (currenttype) 328 | { 329 | case EntryType.Anime: 330 | return this.NormalizeKitsuAnimeList(); 331 | case EntryType.Manga: 332 | return this.NormalizeKitsuMangaList(); 333 | default: 334 | return new List(); 335 | } 336 | } 337 | } 338 | else 339 | { 340 | this.erroredout = true; 341 | return new List(); 342 | } 343 | } 344 | 345 | private List NormalizeKitsuAnimeList() 346 | { 347 | // Create temp list 348 | List tmplistentries = new List(); 349 | 350 | foreach (Dictionary entry in this.tmplist) 351 | { 352 | int entryId = int.Parse((string)entry["id"]); 353 | int titleId = int.Parse((string)((JObject)((JObject)(((JObject)entry["relationships"]).ToObject>()["anime"])).ToObject>()["data"]).ToObject>()["id"]); 354 | Dictionary eattributes = ((JObject)entry["attributes"]).ToObject>(); 355 | Dictionary attributes = JObjectToDictionary((JObject)FindMetaData(titleId, EntryType.Anime)["attributes"]); 356 | RecordMappingIds(titleId, EntryType.Anime); 357 | String title = (String)attributes["canonicalTitle"]; 358 | String tmpstatus = (String)eattributes["status"]; 359 | bool reconsuming = (bool)eattributes["reconsuming"]; 360 | EntryStatus eStatus; 361 | switch (tmpstatus) 362 | { 363 | case "on_hold": 364 | eStatus = EntryStatus.paused; 365 | break; 366 | case "planned": 367 | eStatus = EntryStatus.planning; 368 | break; 369 | case "current": 370 | eStatus = EntryStatus.current; 371 | break; 372 | case "completed": 373 | eStatus = EntryStatus.completed; 374 | break; 375 | case "dropped": 376 | eStatus = EntryStatus.dropped; 377 | break; 378 | default: 379 | eStatus = EntryStatus.current; 380 | break; 381 | } 382 | int progress = Convert.ToInt32((long)eattributes["progress"]); 383 | ListEntry newentry = new ListEntry(titleId, title, eStatus, progress); 384 | newentry.totalSegment = !(object.ReferenceEquals(null, (attributes["episodeCount"]))) ? Convert.ToInt32((long)attributes["episodeCount"]) : 0; 385 | newentry.mediaFormat = (String)attributes["showType"]; 386 | newentry.repeating = reconsuming; 387 | newentry.repeatCount = Convert.ToInt32((long)eattributes["reconsumeCount"]); 388 | newentry.personalComments = (String)eattributes["notes"]; 389 | newentry.rating = !object.ReferenceEquals(null, eattributes["ratingTwenty"]) ? ConvertRatingTwentyToRawScore(Convert.ToInt32((long)eattributes["ratingTwenty"])) : 0; 390 | if (!object.ReferenceEquals(null, eattributes["startedAt"]) && eattributes["startedAt"].GetType() == typeof(DateTime)) 391 | { 392 | DateTime startDate = (DateTime)eattributes["startedAt"]; 393 | newentry.startDate = startDate.Year + "-" + (startDate.Month < 10 ? "0" + startDate.Month.ToString() : startDate.Month.ToString()) + "-" + (startDate.Day < 10 ? "0" + startDate.Day.ToString() : startDate.Day.ToString()); 394 | } 395 | else 396 | { 397 | newentry.startDate = "0000-00-00"; 398 | } 399 | if (!object.ReferenceEquals(null, eattributes["finishedAt"]) && eattributes["finishedAt"].GetType() == typeof(DateTime)) 400 | { 401 | DateTime finishDate = (DateTime)eattributes["finishedAt"]; 402 | newentry.endDate = finishDate.Year + "-" + (finishDate.Month < 10 ? "0" + finishDate.Month.ToString() : finishDate.Month.ToString()) + "-" + (finishDate.Day < 10 ? "0" + finishDate.Day.ToString() : finishDate.Day.ToString()); 403 | } 404 | else 405 | { 406 | newentry.endDate = "0000-00-00"; 407 | } 408 | // Add entry 409 | tmplistentries.Add(newentry); 410 | } 411 | return tmplistentries; 412 | } 413 | 414 | private List NormalizeKitsuMangaList() 415 | { 416 | // Create temp list 417 | List tmplistentries = new List(); 418 | 419 | foreach (Dictionary entry in this.tmplist) 420 | { 421 | int entryId = int.Parse((string)entry["id"]); 422 | int titleId = int.Parse((string)((JObject)((JObject)(((JObject)entry["relationships"]).ToObject>()["manga"])).ToObject>()["data"]).ToObject>()["id"]); 423 | Dictionary eattributes = ((JObject)entry["attributes"]).ToObject>(); 424 | Dictionary attributes = JObjectToDictionary((JObject)FindMetaData(titleId, EntryType.Manga)["attributes"]); 425 | RecordMappingIds(titleId, EntryType.Manga); 426 | String title = (String)attributes["canonicalTitle"]; 427 | String tmpstatus = (String)eattributes["status"]; 428 | bool reconsuming = (bool)eattributes["reconsuming"]; 429 | EntryStatus eStatus; 430 | switch (tmpstatus) 431 | { 432 | case "on_hold": 433 | eStatus = EntryStatus.paused; 434 | break; 435 | case "planned": 436 | eStatus = EntryStatus.planning; 437 | break; 438 | case "current": 439 | eStatus = EntryStatus.current; 440 | break; 441 | case "completed": 442 | eStatus = EntryStatus.completed; 443 | break; 444 | case "dropped": 445 | eStatus = EntryStatus.dropped; 446 | break; 447 | default: 448 | eStatus = EntryStatus.current; 449 | break; 450 | } 451 | int progress = Convert.ToInt32((long)eattributes["progress"]); 452 | int progressVolumes = Convert.ToInt32((long)eattributes["volumesOwned"]); 453 | ListEntry newentry = new ListEntry(titleId, title, eStatus, progress, progressVolumes); 454 | newentry.totalSegment = !(object.ReferenceEquals(null, (attributes["chapterCount"]))) ? Convert.ToInt32((long)attributes["chapterCount"]) : 0; 455 | newentry.totalVolumes = !(object.ReferenceEquals(null, (attributes["volumeCount"]))) ? Convert.ToInt32((long)attributes["volumeCount"]) : 0; 456 | newentry.mediaFormat = (String)attributes["mangaType"]; 457 | newentry.repeating = reconsuming; 458 | newentry.repeatCount = Convert.ToInt32((long)eattributes["reconsumeCount"]); 459 | newentry.personalComments = (String)eattributes["notes"]; 460 | newentry.rating = !object.ReferenceEquals(null, eattributes["ratingTwenty"]) ? ConvertRatingTwentyToRawScore(Convert.ToInt32((long)eattributes["ratingTwenty"])) : 0; 461 | if (!object.ReferenceEquals(null, eattributes["startedAt"]) && eattributes["startedAt"].GetType() == typeof(DateTime)) 462 | { 463 | DateTime startDate = (DateTime)eattributes["startedAt"]; 464 | newentry.startDate = startDate.Year + "-" + (startDate.Month < 10 ? "0" + startDate.Month.ToString() : startDate.Month.ToString()) + "-" + (startDate.Day < 10 ? "0" + startDate.Day.ToString() : startDate.Day.ToString()); 465 | } 466 | else 467 | { 468 | newentry.startDate = "0000-00-00"; 469 | } 470 | if (!object.ReferenceEquals(null, eattributes["finishedAt"]) && eattributes["finishedAt"].GetType() == typeof(DateTime)) 471 | { 472 | DateTime finishDate = (DateTime)eattributes["finishedAt"]; 473 | newentry.endDate = finishDate.Year + "-" + (finishDate.Month < 10 ? "0" + finishDate.Month.ToString() : finishDate.Month.ToString()) + "-" + (finishDate.Day < 10 ? "0" + finishDate.Day.ToString() : finishDate.Day.ToString()); 474 | } 475 | else 476 | { 477 | newentry.endDate = "0000-00-00"; 478 | } 479 | // Add entry 480 | tmplistentries.Add(newentry); 481 | } 482 | return tmplistentries; 483 | } 484 | 485 | /* 486 | * Helpers 487 | */ 488 | private int GetAniListUserID(String username) 489 | { 490 | // This methods find a user id associated with a username 491 | RestRequest request = new RestRequest("/", Method.POST); 492 | request.RequestFormat = DataFormat.Json; 493 | GraphQLQuery query = new GraphQLQuery(); 494 | query.query = "query ($name: String) {\n User (name: $name) {\n id\n name\n mediaListOptions {\n scoreFormat\n }\n }\n}"; 495 | query.variables = new Dictionary { { "name", username } }; 496 | request.AddJsonBody(query); 497 | IRestResponse response = arestclient.Execute(request); 498 | if (response.StatusCode.GetHashCode() == 200) 499 | { 500 | Dictionary jsonData = JsonConvert.DeserializeObject>(response.Content); 501 | Dictionary data = JObjectToDictionary((JObject)jsonData["data"]); 502 | int userid = Convert.ToInt32((long)JObjectToDictionary((JObject)data["User"])["id"]); 503 | return userid; 504 | } 505 | else 506 | { 507 | return -1; 508 | } 509 | } 510 | 511 | private int GetKitsuUserID(String username) 512 | { 513 | // This methods find a user id associated with a username 514 | RestRequest request = new RestRequest("/users?filter[slug]=" + username, Method.GET); 515 | request.RequestFormat = DataFormat.Json; 516 | request.AddHeader("Accept", "application/vnd.api+json"); 517 | IRestResponse response = krestclient.Execute(request); 518 | if (response.StatusCode.GetHashCode() == 200) 519 | { 520 | Dictionary jsonData = JsonConvert.DeserializeObject>(response.Content); 521 | List> data = ((JArray)jsonData["data"]).ToObject>>(); 522 | if (data.Count > 0) { 523 | Dictionary user = data[0]; 524 | int userid = int.Parse(((string)user["id"])); 525 | return userid; 526 | } 527 | else 528 | { 529 | return -1; 530 | } 531 | 532 | } 533 | else 534 | { 535 | return -1; 536 | } 537 | } 538 | 539 | private Dictionary FindMetaData(int titleid, EntryType type) 540 | { 541 | // This methods finds the metadata that is associated with a title id 542 | String typestring = ""; 543 | switch (type) 544 | { 545 | case EntryType.Anime: 546 | typestring = "anime"; 547 | break; 548 | case EntryType.Manga: 549 | typestring = "manga"; 550 | break; 551 | } 552 | Dictionary searchpattern = new Dictionary(); 553 | searchpattern["id"] = titleid.ToString(); 554 | searchpattern["type"] = typestring; 555 | return attributes.FirstOrDefault(x => searchpattern.All(x.Contains)); 556 | } 557 | private Dictionary FindMapping(int mappingid) 558 | { 559 | // This methods finds the metadata that is associated with a title id 560 | Dictionary searchpattern = new Dictionary(); 561 | searchpattern["id"] = mappingid.ToString(); 562 | return attributes.FirstOrDefault(x => searchpattern.All(x.Contains)); 563 | } 564 | private void RecordMappingIds(int titleid, EntryType type) 565 | { 566 | List> attributes = ((JArray)JObjectToDictionary((JObject)JObjectToDictionary((JObject)FindMetaData(titleid, type)["relationships"])["mappings"])["data"]).ToObject>>(); 567 | foreach (Dictionary mapping in attributes) 568 | { 569 | int mappingid = int.Parse((string)mapping["id"]); 570 | Dictionary titleidmap = FindMapping(mappingid); 571 | Dictionary mapattributes = ((JObject)titleidmap["attributes"]).ToObject>(); 572 | if (mapattributes.ContainsKey("externalSite")) 573 | { 574 | if ((string)mapattributes["externalSite"] == "myanimelist/" + (type == EntryType.Anime ? "anime" : "manga")) 575 | { 576 | int mtitleid = int.Parse((string)mapattributes["externalId"]); 577 | if (tconverter.RetreiveSavedMALIDFromServiceID(Service.Kitsu, titleid, type) < 0) 578 | { 579 | tconverter.SaveIDtoDatabase(Service.Kitsu, mtitleid, titleid, type); 580 | } 581 | } 582 | } 583 | } 584 | } 585 | private int ConvertRatingTwentyToRawScore(int ratingTwenty) 586 | { 587 | double advrating = 0.0; 588 | switch (ratingTwenty) 589 | { 590 | case 2: 591 | advrating = 1.0; 592 | break; 593 | case 3: 594 | advrating = 1.5; 595 | break; 596 | case 4: 597 | advrating = 2.0; 598 | break; 599 | case 5: 600 | advrating = 2.5; 601 | break; 602 | case 6: 603 | advrating = 3.0; 604 | break; 605 | case 7: 606 | advrating = 3.5; 607 | break; 608 | case 8: 609 | advrating = 4.0; 610 | break; 611 | case 9: 612 | advrating = 4.5; 613 | break; 614 | case 10: 615 | advrating = 5.0; 616 | break; 617 | case 11: 618 | advrating = 5.5; 619 | break; 620 | case 12: 621 | advrating = 6.0; 622 | break; 623 | case 13: 624 | advrating = 6.5; 625 | break; 626 | case 14: 627 | advrating = 7.0; 628 | break; 629 | case 15: 630 | advrating = 7.5; 631 | break; 632 | case 16: 633 | advrating = 8.0; 634 | break; 635 | case 17: 636 | advrating = 8.5; 637 | break; 638 | case 18: 639 | advrating = 9.0; 640 | break; 641 | case 19: 642 | advrating = 9.5; 643 | break; 644 | case 20: 645 | advrating = 10.0; 646 | break; 647 | default: 648 | break; 649 | } 650 | return (int)(advrating * 10); 651 | } 652 | private Dictionary JObjectToDictionary(JObject jobject) 653 | { 654 | return jobject.ToObject>(); 655 | } 656 | public void cleanup() 657 | { 658 | tmplist = new List>(); 659 | attributes = new List>(); 660 | } 661 | } 662 | } 663 | -------------------------------------------------------------------------------- /NekomataCore/NekomataCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {19B00327-56CE-406F-AE63-5293E61680A9} 8 | Library 9 | NekomataCore 10 | NekomataCore 11 | v4.6.1 12 | 13 | 14 | true 15 | full 16 | false 17 | bin\Debug 18 | DEBUG; 19 | prompt 20 | 4 21 | false 22 | 23 | 24 | true 25 | bin\Release 26 | prompt 27 | 4 28 | false 29 | 30 | 31 | 32 | 33 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 34 | 35 | 36 | ..\packages\RestSharp.106.3.1\lib\net452\RestSharp.dll 37 | 38 | 39 | 40 | ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll 41 | 42 | 43 | ..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll 44 | 45 | 46 | 47 | ..\packages\System.Data.SQLite.Core.1.0.108.0\lib\net46\System.Data.SQLite.dll 48 | 49 | 50 | ..\packages\System.Data.SQLite.EF6.1.0.108.0\lib\net46\System.Data.SQLite.EF6.dll 51 | 52 | 53 | ..\packages\System.Data.SQLite.Linq.1.0.108.0\lib\net46\System.Data.SQLite.Linq.dll 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /NekomataCore/NormalListToMALXML.cs: -------------------------------------------------------------------------------- 1 | /* NormalListToMALXML.cs 2 | * This class converts a normalized list to MAL XML format. 3 | * 4 | * Copyright (c) 2018 MAL Updater OS X Group, a division of Moy IT Solutions 5 | * Licensed under MIT License 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Text; 12 | using System.Threading.Tasks; 13 | 14 | namespace NekomataCore 15 | { 16 | public class NormalListToMALXML 17 | { 18 | private List list; 19 | private List validlist; 20 | public List faillist; 21 | private EntryType listtype; 22 | private string Username; 23 | private Service currentservice; 24 | public TitleIDConverter tconverter; 25 | 26 | // Update on import 27 | public bool updateonimportcurrent; 28 | public bool updateonimportcompleted; 29 | public bool updateonimportonhold; 30 | public bool updateonimportdropped; 31 | public bool updateonimportplanned; 32 | 33 | private const String headerstring = "\n\t \n\n\t"; 34 | private const String footerstring = "\n\n\t"; 35 | private const String animepretag = "\n\n\t\t"; 36 | private const String animeendtag = "\n\t\t"; 37 | private const String mangapretag = "\n\n\t\t"; 38 | private const String mangaendtag = "\n\t\t"; 39 | private const String tabformatting = "\n\t\t\t"; 40 | 41 | public NormalListToMALXML() 42 | { 43 | 44 | } 45 | 46 | public void ConvertNormalizedListToMAL(List list, EntryType type, String username, Service listservice) 47 | { 48 | this.Username = username; 49 | this.listtype = type; 50 | this.list = list; 51 | this.currentservice = listservice; 52 | this.validlist = new List(); 53 | this.faillist = new List(); 54 | ProcessList(); 55 | } 56 | public string GenerateXML() 57 | { 58 | switch (listtype) 59 | { 60 | case EntryType.Anime: 61 | return GenerateAnimeXML(); 62 | case EntryType.Manga: 63 | return GenerateMangaXML(); 64 | default: 65 | return ""; 66 | } 67 | } 68 | public bool InvalidEntriesExist() 69 | { 70 | return (faillist.Count > 0); 71 | } 72 | private void ProcessList() 73 | { 74 | foreach (ListEntry entry in list) 75 | { 76 | int convertedtitleid = GetConvertedTitleID(entry.titleId); 77 | if (convertedtitleid > 0) 78 | { 79 | entry.titleId = convertedtitleid; 80 | entry.rating = entry.rating / 10; 81 | validlist.Add(entry); 82 | } 83 | else 84 | { 85 | faillist.Add(entry); 86 | } 87 | } 88 | } 89 | private string GenerateAnimeXML() 90 | { 91 | StringBuilder sb = new StringBuilder(); 92 | sb.Append(headerstring); 93 | sb.Append("\n\n\t"); 94 | sb.Append(tabformatting + "" + this.Username + ""); 95 | sb.Append(tabformatting + "1"); 96 | sb.Append("\n\t"); 97 | foreach (ListEntry entry in validlist) 98 | { 99 | sb.Append(animepretag); 100 | sb.Append(tabformatting + "" + entry.titleId + ""); 101 | sb.Append(tabformatting + ""); 102 | sb.Append(tabformatting + "" + entry.mediaFormat + ""); 103 | sb.Append(tabformatting + "" + entry.totalSegment + ""); 104 | sb.Append(tabformatting + "0"); 105 | sb.Append(tabformatting + "" + entry.progress + ""); 106 | sb.Append(tabformatting + "" + entry.startDate + ""); 107 | sb.Append(tabformatting + "" + entry.endDate + ""); 108 | sb.Append(tabformatting + ""); 109 | sb.Append(tabformatting + "" + entry.rating + ""); 110 | sb.Append(tabformatting + ""); 111 | sb.Append(tabformatting + ""); 112 | sb.Append(tabformatting + "" + ConvertNormalizedStatus(entry.entryStatus) + ""); 113 | sb.Append(tabformatting + ""); 114 | sb.Append(tabformatting + "" + entry.repeatCount + ""); 115 | sb.Append(tabformatting + ""); 116 | sb.Append(tabformatting + ""); 117 | sb.Append(tabformatting + "" + (entry.repeating ? "1" : "0") + ""); 118 | sb.Append(tabformatting + "0"); 119 | sb.Append(tabformatting + "" + this.getUpdateonimport(entry.entryStatus) + ""); 120 | sb.Append(animeendtag); 121 | } 122 | sb.Append(footerstring); 123 | return sb.ToString(); 124 | 125 | } 126 | private string GenerateMangaXML() 127 | { 128 | StringBuilder sb = new StringBuilder(); 129 | sb.Append(headerstring); 130 | sb.Append("\n\n\t"); 131 | sb.Append(tabformatting + "" + this.Username + ""); 132 | sb.Append(tabformatting + "2"); 133 | sb.Append("\n\t"); 134 | foreach (ListEntry entry in validlist) 135 | { 136 | sb.Append(mangapretag); 137 | sb.Append(tabformatting + "" + entry.titleId + ""); 138 | sb.Append(tabformatting + ""); 139 | sb.Append(tabformatting + "" + entry.totalVolumes + ""); 140 | sb.Append(tabformatting + "" + entry.totalSegment + ""); 141 | sb.Append(tabformatting + "0"); 142 | sb.Append(tabformatting + "" + entry.progressVolumes + ""); 143 | sb.Append(tabformatting + "" + entry.progress + ""); 144 | sb.Append(tabformatting + "" + entry.startDate + ""); 145 | sb.Append(tabformatting + "" + entry.endDate + ""); 146 | sb.Append(tabformatting + ""); 147 | sb.Append(tabformatting + "" + entry.rating + ""); 148 | sb.Append(tabformatting + ""); 149 | sb.Append(tabformatting + "" + ConvertNormalizedStatus(entry.entryStatus) + ""); 150 | sb.Append(tabformatting + ""); 151 | sb.Append(tabformatting + "" + entry.repeatCount + ""); 152 | sb.Append(tabformatting + ""); 153 | sb.Append(tabformatting + ""); 154 | sb.Append(tabformatting + "" + this.getUpdateonimport(entry.entryStatus) + ""); 155 | sb.Append(mangaendtag); 156 | } 157 | sb.Append(footerstring); 158 | return sb.ToString(); 159 | } 160 | private int GetConvertedTitleID(int titleid) 161 | { 162 | switch (currentservice) 163 | { 164 | case Service.AniList: 165 | return tconverter.GetMALIDFromAniListID(titleid, listtype); 166 | case Service.Kitsu: 167 | return tconverter.GetMALIDFromKitsuID(titleid, listtype); 168 | default: 169 | return -1; 170 | } 171 | } 172 | private string ConvertNormalizedStatus(EntryStatus status) 173 | { 174 | switch (listtype) 175 | { 176 | case EntryType.Anime: 177 | { 178 | switch (status) 179 | { 180 | case EntryStatus.current: 181 | return "Watching"; 182 | case EntryStatus.completed: 183 | return "Completed"; 184 | case EntryStatus.dropped: 185 | return "Dropped"; 186 | case EntryStatus.paused: 187 | return "On-Hold"; 188 | case EntryStatus.planning: 189 | return "Plan to Watch"; 190 | default: 191 | return ""; 192 | } 193 | } 194 | case EntryType.Manga: 195 | { 196 | switch (status) 197 | { 198 | case EntryStatus.current: 199 | return "Reading"; 200 | case EntryStatus.completed: 201 | return "Completed"; 202 | case EntryStatus.dropped: 203 | return "Dropped"; 204 | case EntryStatus.paused: 205 | return "On-Hold"; 206 | case EntryStatus.planning: 207 | return "Plan to Read"; 208 | default: 209 | return ""; 210 | } 211 | } 212 | default: 213 | return ""; 214 | } 215 | } 216 | public void cleanup() 217 | { 218 | this.list.Clear(); 219 | this.validlist.Clear(); 220 | this.faillist.Clear(); 221 | } 222 | private int getUpdateonimport(EntryStatus status) 223 | { 224 | switch (status) 225 | { 226 | case EntryStatus.current: 227 | return this.updateonimportcurrent ? 1 : 0; 228 | case EntryStatus.completed: 229 | return this.updateonimportcompleted ? 1 : 0; 230 | case EntryStatus.dropped: 231 | return this.updateonimportdropped ? 1 : 0; 232 | case EntryStatus.paused: 233 | return this.updateonimportonhold ? 1 : 0; 234 | case EntryStatus.planning: 235 | return this.updateonimportplanned ? 1 : 0; 236 | default: 237 | return 0; 238 | } 239 | } 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /NekomataCore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("NekomataCore")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /NekomataCore/TitleIDConverter.cs: -------------------------------------------------------------------------------- 1 | /* TitleIDConverter.cs 2 | * This class converts one title id from one service to another. 3 | * 4 | * Copyright (c) 2018 MAL Updater OS X Group, a division of Moy IT Solutions 5 | * Licensed under MIT License 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.IO; 11 | using System.Threading; 12 | using RestSharp; 13 | using Newtonsoft.Json; 14 | using System.Data.SQLite; 15 | using Newtonsoft.Json.Linq; 16 | 17 | namespace NekomataCore 18 | { 19 | public enum Service 20 | { 21 | Kitsu = 1, 22 | AniList = 2 23 | } 24 | 25 | public class TitleIDConverter 26 | { 27 | RestClient raclient; 28 | RestClient rkclient; 29 | SQLiteConnection sqlitecon; 30 | public bool sqlliteinitalized; 31 | 32 | public TitleIDConverter() 33 | { 34 | raclient = new RestClient("https://graphql.anilist.co"); 35 | rkclient = new RestClient("https://kitsu.io/api/edge"); 36 | this.initalizeDatabase(); 37 | } 38 | public int GetMALIDFromKitsuID(int kitsuid, EntryType type) 39 | { 40 | int titleid = this.RetreiveSavedMALIDFromServiceID(Service.Kitsu, kitsuid, type); 41 | if (titleid > -1) 42 | { 43 | return titleid; 44 | } 45 | String typestr = ""; 46 | switch (type) 47 | { 48 | case EntryType.Anime: 49 | typestr = "anime"; 50 | break; 51 | case EntryType.Manga: 52 | typestr = "manga"; 53 | break; 54 | default: 55 | break; 56 | } 57 | 58 | String filterstr = "myanimelist/" + typestr; 59 | 60 | RestRequest request = new RestRequest( "/" + typestr + "/" + kitsuid.ToString() + "?include=mappings&fields[anime]=id", Method.GET); 61 | request.RequestFormat = DataFormat.Json; 62 | request.AddHeader("Accept", "application/vnd.api+json"); 63 | 64 | IRestResponse response = rkclient.Execute(request); 65 | Thread.Sleep(1000); 66 | if (response.StatusCode.GetHashCode() == 200) 67 | { 68 | Dictionary jsonData = JsonConvert.DeserializeObject>(response.Content); 69 | if (jsonData.ContainsKey("included")) 70 | { 71 | List> included = ((JArray)jsonData["included"]).ToObject>>(); 72 | foreach (Dictionary map in included) 73 | { 74 | Dictionary attr = JObjectToDictionary((JObject)map["attributes"]); 75 | if (String.Equals(((String)attr["externalSite"]), "myanimelist/" + typestr, StringComparison.OrdinalIgnoreCase)) 76 | { 77 | int malid = int.Parse((string)attr["externalId"]); 78 | this.SaveIDtoDatabase(Service.Kitsu, malid, kitsuid, type); 79 | return malid; 80 | } 81 | } 82 | } 83 | return -1; 84 | } 85 | else 86 | { 87 | return -1; 88 | } 89 | 90 | } 91 | 92 | public int GetMALIDFromAniListID(int anilistid, EntryType type) 93 | { 94 | int titleid = this.RetreiveSavedMALIDFromServiceID(Service.AniList, anilistid, type); 95 | if (titleid > -1) 96 | { 97 | return titleid; 98 | } 99 | String typestr = ""; 100 | switch (type) 101 | { 102 | case EntryType.Anime: 103 | typestr = "ANIME"; 104 | break; 105 | case EntryType.Manga: 106 | typestr = "MANGA"; 107 | break; 108 | default: 109 | break; 110 | } 111 | 112 | RestRequest request = new RestRequest("/", Method.POST); 113 | request.RequestFormat = DataFormat.Json; 114 | GraphQLQuery gquery = new GraphQLQuery(); 115 | gquery.query = "query ($id: Int!, $type: MediaType) {\n Media(id: $id, type: $type) {\n id\n idMal\n }\n}"; 116 | gquery.variables = new Dictionary { { "id" , anilistid.ToString() }, { "type", typestr } }; 117 | request.AddJsonBody(gquery); 118 | IRestResponse response = raclient.Execute(request); 119 | Thread.Sleep(2000); 120 | if (response.StatusCode.GetHashCode() == 200) 121 | { 122 | Dictionary jsonData = JsonConvert.DeserializeObject>(response.Content); 123 | Dictionary data = JObjectToDictionary((JObject)jsonData["data"]); 124 | Dictionary media = JObjectToDictionary((JObject)data["Media"]); 125 | int malid = !object.ReferenceEquals(null, media["idMal"]) ? Convert.ToInt32((long)media["idMal"]) : -1; 126 | if (malid > 0) 127 | { 128 | this.SaveIDtoDatabase(Service.AniList, malid, anilistid, type); 129 | Thread.Sleep(2000); 130 | return malid; 131 | } 132 | else 133 | { 134 | return -1; 135 | } 136 | } 137 | else 138 | { 139 | return -1; 140 | } 141 | 142 | } 143 | 144 | public int RetreiveSavedMALIDFromServiceID(Service listService, int titleid, EntryType type) 145 | { 146 | String sql = ""; 147 | int mediatype = type == EntryType.Anime ? 0 : 1; 148 | switch (listService) 149 | { 150 | case Service.AniList: 151 | sql = "SELECT malid FROM titleids WHERE anilist_id = " + titleid.ToString() + " AND mediatype = " + mediatype.GetHashCode(); 152 | break; 153 | case Service.Kitsu: 154 | sql = "SELECT malid FROM titleids WHERE kitsu_id = " + titleid.ToString() + " AND mediatype = " + mediatype.GetHashCode(); 155 | break; 156 | default: 157 | break; 158 | } 159 | SQLiteCommand cmd = new SQLiteCommand(sql, sqlitecon); 160 | SQLiteDataReader reader = cmd.ExecuteReader(); 161 | while (reader.Read()) 162 | { 163 | return (int)reader[@"malid"]; 164 | } 165 | 166 | return -1; 167 | } 168 | 169 | public void SaveIDtoDatabase(Service listservice, int malid, int servicetitleid, EntryType type) 170 | { 171 | if (this.CheckIfEntryExists(malid,type)) 172 | { 173 | // Update entry 174 | String sql = ""; 175 | int mediatype = type == EntryType.Anime ? 0 : 1; 176 | switch (listservice) 177 | { 178 | case Service.AniList: 179 | sql = "UPDATE titleids SET anilist_id = " + servicetitleid.ToString() + " WHERE mediatype = " + mediatype.GetHashCode() + " AND malid = " + malid.ToString(); 180 | break; 181 | case Service.Kitsu: 182 | sql = "UPDATE titleids SET kitsu_id = " + servicetitleid.ToString() + " WHERE mediatype = " + mediatype.GetHashCode() + " AND malid = " + malid.ToString(); 183 | break; 184 | default: 185 | return; 186 | } 187 | SQLiteCommand cmd = new SQLiteCommand(sql, sqlitecon); 188 | cmd.ExecuteNonQuery(); 189 | } 190 | else 191 | { 192 | // Insert entry 193 | this.InsertIDtoDatabase(listservice, malid, servicetitleid, type); 194 | } 195 | 196 | } 197 | 198 | private void InsertIDtoDatabase(Service listservice, int malid, int servicetitleid, EntryType type) 199 | { 200 | String sql = ""; 201 | int mediatype = type == EntryType.Anime ? 0 : 1; 202 | switch (listservice) 203 | { 204 | case Service.AniList: 205 | sql = "INSERT INTO titleids (malid,anilist_id,mediatype) VALUES (" + malid.ToString() + "," + servicetitleid.ToString() + "," + type.GetHashCode() + ")"; 206 | break; 207 | case Service.Kitsu: 208 | sql = "INSERT INTO titleids (malid,kitsu_id,mediatype) VALUES (" + malid.ToString() + "," + servicetitleid.ToString() + "," + type.GetHashCode() + ")"; 209 | break; 210 | default: 211 | return; 212 | } 213 | SQLiteCommand cmd = new SQLiteCommand(sql, sqlitecon); 214 | cmd.ExecuteNonQuery(); 215 | 216 | } 217 | 218 | private bool CheckIfEntryExists(int malid, EntryType type) 219 | { 220 | int mediatype = type == EntryType.Anime ? 0 : 1; 221 | String sql = "SELECT malid FROM titleids WHERE malid = " + malid.ToString() + " AND mediatype = " + mediatype.GetHashCode(); 222 | 223 | SQLiteCommand cmd = new SQLiteCommand(sql, sqlitecon); 224 | SQLiteDataReader reader = cmd.ExecuteReader(); 225 | while (reader.Read()) 226 | { 227 | return true; 228 | } 229 | 230 | return false; 231 | } 232 | 233 | private void initalizeDatabase() 234 | { 235 | try 236 | { 237 | string directory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/Nekomata"; 238 | if (!Directory.Exists(directory)) 239 | { 240 | Directory.CreateDirectory(directory); 241 | } 242 | if (File.Exists(directory + "Nekomata.sqlite")) 243 | { 244 | sqlitecon = new SQLiteConnection("Data Source=" + directory + "\\Nekomata.sqlite;Version=3;"); 245 | sqlitecon.Open(); 246 | } 247 | else 248 | { 249 | // Create database and tables 250 | SQLiteConnection.CreateFile(directory + "\\Nekomata.sqlite"); 251 | sqlitecon = new SQLiteConnection("Data Source=" + directory + "\\Nekomata.sqlite;Version=3;"); 252 | sqlitecon.Open(); 253 | SQLiteCommand createtable = new SQLiteCommand("CREATE TABLE titleids (anidb_id INT, anilist_id INT, kitsu_id INT, malid INT, animeplanet_id VARCHAR(50), mediatype INT)"); 254 | createtable.Connection = this.sqlitecon; 255 | createtable.ExecuteNonQuery(); 256 | } 257 | sqlliteinitalized = true; 258 | } 259 | catch (Exception e) 260 | { 261 | sqlliteinitalized = false; 262 | } 263 | } 264 | 265 | private Dictionary JObjectToDictionary(JObject jobject) 266 | { 267 | return jobject.ToObject>(); 268 | } 269 | } 270 | } 271 | -------------------------------------------------------------------------------- /NekomataCore/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Nekomata 2 | Nekomata is a crossplatform .NET program that allows users to export their AniList and Kitsu lists to MyAnimeList XML format to import to any list service or use as a local backup. 3 | 4 | Nekomata is written in C# and will work on Windows and eventually Linux. No macOS version is planned since Shukofukurou have these functions built in. 5 | 6 | Nekomata (猫又) means a forked tail cat in Japanese folklore. 7 | 8 | # How it works 9 | First, you enter your username, select the service to convert the list from, select the type of list and click export. Nekomata will look up MyAnimeList Title IDs that corresponds to the title on AniList or Kitsu. 10 | 11 | Note that not all titles are on MyAnimeList and Nekomata will show a list of titles that it couldn't find a MyAnimeList title id on before giving you the opertunity to save the converted XML list. 12 | 13 | # Limitations 14 | Nekomata only exports public entries for now since the application obtains the list without an OAuth2 token. Since MyAnimeList doesn't have an option for private entries, I decided to leave out all of these entries. 15 | 16 | Also, advanced scoring is not supported. Scores are converted to a 1-10 scale with 0 indicating no rating. 17 | 18 | Option for a universal format will come at a later date (with the ability to import these lists) along with Anime-Planet support. 19 | 20 | # Donate 21 | Nekomata is open source freeware. If you find this piece of software useful and want to see further development, feel free to leave a donation. Every bit helps! 22 | 23 | [Donate](https://malupdaterosx.moe/donate/) 24 | 25 | # License 26 | Nekomata is licensed under the MIT License. -------------------------------------------------------------------------------- /nekomata.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MALUpdaterOSXArchive/Nekomata/6544f0df100d8723b6b3d0a2f51ffeee18ff247b/nekomata.ico --------------------------------------------------------------------------------