diff --git a/.gitignore b/.gitignore index 3c4efe2..eed88f5 100644 --- a/.gitignore +++ b/.gitignore @@ -258,4 +258,15 @@ paket-files/ # Python Tools for Visual Studio (PTVS) __pycache__/ -*.pyc \ No newline at end of file +*.pyc +cache +allgames.html +index.html +missing.html +SBM_Local.html +SBM_NSP_Local.html +allgames.xml +missinggames.xml +nswdb.xml +SBM_Local.xml +SBM_NSP_Local.xml diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..d3314f4 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,29 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Run XSL transformers", + "type": "shell", + "command": "./transform.sh", + "windows": { + "command": ".\\transform.ps1" + }, + "args": [ + "y" + ], + "options": { + "cwd": "${workspaceRoot}" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "new" + } + } + ] +} \ No newline at end of file diff --git a/Switch Backup Manager/FileData.cs b/Switch Backup Manager/FileData.cs index d848e5f..4e4f8b8 100644 --- a/Switch Backup Manager/FileData.cs +++ b/Switch Backup Manager/FileData.cs @@ -45,6 +45,7 @@ public FileData () //Default constructor this.Description = ""; this.Publisher = ""; this.ReleaseDate = ""; + this.ImportedDate = ""; this.NumberOfPlayers = ""; this.Categories = new List(); this.ESRB = 0; @@ -58,6 +59,7 @@ public FileData(string FilePath, string FileName, string FileNameWithExt, string string DistributionType, int IdScene, string ContentType, string Version, bool HasExtendedInfo, string Description, string Publisher, string ReleaseDate, string NumberOfPlayers, List Categories, int ESRB) { + this.ImportedDate = ""; this.FilePath = FilePath; this.FileName = FileName; this.FileNameWithExt = FileNameWithExt; @@ -97,6 +99,7 @@ public FileData(string FilePath, string FileName, string FileNameWithExt, string this.ESRB = ESRB; } + public string ImportedDate { get; set; } public string FilePath { get; set; } public string FileName { get; set; } public string FileNameWithExt { get; set; } diff --git a/Switch Backup Manager/Form1.Designer.cs b/Switch Backup Manager/Form1.Designer.cs index 26cd0b3..653f35e 100644 --- a/Switch Backup Manager/Form1.Designer.cs +++ b/Switch Backup Manager/Form1.Designer.cs @@ -68,6 +68,7 @@ private void InitializeComponent() this.olvColumnReleaseDateLocal = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnNumberOfPlayersLocal = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnCategoriesLocal = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.olvColumnImportedDateLocal = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.contextMenuLocalList = new System.Windows.Forms.ContextMenuStrip(this.components); this.showInExplorerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem20 = new System.Windows.Forms.ToolStripSeparator(); @@ -321,6 +322,7 @@ private void InitializeComponent() this.olvColumnNumberOfPlayersEshop = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnCategoriesEShop = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvColumnContentTypeEShop = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); + this.olvColumnImportedDateEShop = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.contextMenuEShopList = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripMenuItemEShopShowInExplorer = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemEShopUpdateInfo = new System.Windows.Forms.ToolStripMenuItem(); @@ -756,6 +758,7 @@ private void InitializeComponent() this.OLVLocalFiles.AllColumns.Add(this.olvColumnReleaseDateLocal); this.OLVLocalFiles.AllColumns.Add(this.olvColumnNumberOfPlayersLocal); this.OLVLocalFiles.AllColumns.Add(this.olvColumnCategoriesLocal); + this.OLVLocalFiles.AllColumns.Add(this.olvColumnImportedDateLocal); this.OLVLocalFiles.CellEditUseWholeCell = false; this.OLVLocalFiles.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.olvColumnTitleIDLocal, @@ -775,7 +778,8 @@ private void InitializeComponent() this.olvColumnSDKVersionLocal, this.olvColumnReleaseDateLocal, this.olvColumnNumberOfPlayersLocal, - this.olvColumnCategoriesLocal}); + this.olvColumnCategoriesLocal, + this.olvColumnImportedDateLocal}); this.OLVLocalFiles.ContextMenuStrip = this.contextMenuLocalList; this.OLVLocalFiles.Cursor = System.Windows.Forms.Cursors.Default; this.OLVLocalFiles.Dock = System.Windows.Forms.DockStyle.Fill; @@ -911,6 +915,13 @@ private void InitializeComponent() this.olvColumnCategoriesLocal.AspectName = "Categories"; this.olvColumnCategoriesLocal.Text = "Category"; // + // olvColumnImportedDateLocal + // + this.olvColumnImportedDateLocal.AspectName = "ImportedDate"; + this.olvColumnImportedDateLocal.IsEditable = false; + this.olvColumnImportedDateLocal.Text = "Imported Date"; + this.olvColumnImportedDateLocal.Width = 200; + // // contextMenuLocalList // this.contextMenuLocalList.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -2838,7 +2849,7 @@ private void InitializeComponent() this.tabPage4.Location = new System.Drawing.Point(4, 22); this.tabPage4.Name = "tabPage4"; this.tabPage4.Padding = new System.Windows.Forms.Padding(3); - this.tabPage4.Size = new System.Drawing.Size(1517, 490); + this.tabPage4.Size = new System.Drawing.Size(1519, 492); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "E-shop files"; this.tabPage4.UseVisualStyleBackColor = true; @@ -2849,7 +2860,7 @@ private void InitializeComponent() this.panel10.Dock = System.Windows.Forms.DockStyle.Fill; this.panel10.Location = new System.Drawing.Point(3, 31); this.panel10.Name = "panel10"; - this.panel10.Size = new System.Drawing.Size(1511, 456); + this.panel10.Size = new System.Drawing.Size(1513, 458); this.panel10.TabIndex = 11; // // OLVEshop @@ -2870,6 +2881,7 @@ private void InitializeComponent() this.OLVEshop.AllColumns.Add(this.olvColumnNumberOfPlayersEshop); this.OLVEshop.AllColumns.Add(this.olvColumnCategoriesEShop); this.OLVEshop.AllColumns.Add(this.olvColumnContentTypeEShop); + this.OLVEshop.AllColumns.Add(this.olvColumnImportedDateEShop); this.OLVEshop.CellEditUseWholeCell = false; this.OLVEshop.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.olvColumnTitleIDEShop, @@ -2887,7 +2899,8 @@ private void InitializeComponent() this.olvColumnReleaseDateEshop, this.olvColumnNumberOfPlayersEshop, this.olvColumnCategoriesEShop, - this.olvColumnContentTypeEShop}); + this.olvColumnContentTypeEShop, + this.olvColumnImportedDateEShop}); this.OLVEshop.ContextMenuStrip = this.contextMenuEShopList; this.OLVEshop.Cursor = System.Windows.Forms.Cursors.Default; this.OLVEshop.Dock = System.Windows.Forms.DockStyle.Fill; @@ -2896,7 +2909,7 @@ private void InitializeComponent() this.OLVEshop.Location = new System.Drawing.Point(0, 0); this.OLVEshop.Name = "OLVEshop"; this.OLVEshop.ShowGroups = false; - this.OLVEshop.Size = new System.Drawing.Size(1511, 456); + this.OLVEshop.Size = new System.Drawing.Size(1513, 458); this.OLVEshop.TabIndex = 3; this.OLVEshop.UseCellFormatEvents = true; this.OLVEshop.UseCompatibleStateImageBehavior = false; @@ -2911,7 +2924,7 @@ private void InitializeComponent() // this.olvColumnTitleIDEShop.AspectName = "TitleID"; this.olvColumnTitleIDEShop.Text = "Title ID"; - this.olvColumnTitleIDEShop.Width = 118; + this.olvColumnTitleIDEShop.Width = 200; // // olvColumnGameNameEShop // @@ -3005,6 +3018,12 @@ private void InitializeComponent() this.olvColumnContentTypeEShop.AspectName = "ContentType"; this.olvColumnContentTypeEShop.Text = "Content Type"; // + // olvColumnImportedDateEShop + // + this.olvColumnImportedDateEShop.AspectName = "ImportedDate"; + this.olvColumnImportedDateEShop.IsEditable = false; + this.olvColumnImportedDateEShop.Text = "Imported Date"; + // // contextMenuEShopList // this.contextMenuEShopList.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -3126,7 +3145,7 @@ private void InitializeComponent() this.panel11.Dock = System.Windows.Forms.DockStyle.Top; this.panel11.Location = new System.Drawing.Point(3, 3); this.panel11.Name = "panel11"; - this.panel11.Size = new System.Drawing.Size(1511, 28); + this.panel11.Size = new System.Drawing.Size(1513, 28); this.panel11.TabIndex = 10; // // panel13 @@ -3139,7 +3158,7 @@ private void InitializeComponent() this.panel13.Controls.Add(this.label5); this.panel13.Controls.Add(this.cbxFilterEshop); this.panel13.Dock = System.Windows.Forms.DockStyle.Right; - this.panel13.Location = new System.Drawing.Point(798, 0); + this.panel13.Location = new System.Drawing.Point(800, 0); this.panel13.Name = "panel13"; this.panel13.Size = new System.Drawing.Size(713, 28); this.panel13.TabIndex = 1; @@ -4515,6 +4534,8 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel4; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel5; + private BrightIdeasSoftware.OLVColumn olvColumnImportedDateLocal; + private BrightIdeasSoftware.OLVColumn olvColumnImportedDateEShop; } } diff --git a/Switch Backup Manager/Form1.cs b/Switch Backup Manager/Form1.cs index 567eaa6..1d344e4 100644 --- a/Switch Backup Manager/Form1.cs +++ b/Switch Backup Manager/Form1.cs @@ -2909,6 +2909,9 @@ private void textBoxFilterLocal_TextChanged(object sender, EventArgs e) case "Category": filterText.Columns = new[] { olvColumnCategoriesLocal }; break; + case "Imported Date": + filterText.Columns = new[] { olvColumnImportedDateLocal }; + break; default: filterText = null; break; @@ -3517,6 +3520,9 @@ private void textBoxFilterEShop_TextChanged(object sender, EventArgs e) case "Category": filterText.Columns = new[] { olvColumnCategoriesEShop }; break; + case "Imported Date": + filterText.Columns = new[] { olvColumnImportedDateEShop}; + break; default: filterText = null; break; diff --git a/Switch Backup Manager/Util.cs b/Switch Backup Manager/Util.cs index a78eb48..7153aea 100644 --- a/Switch Backup Manager/Util.cs +++ b/Switch Backup Manager/Util.cs @@ -992,6 +992,7 @@ public static bool WriteFileDataToXML(FileData data, string xml) new XElement("ReleaseDate", data.ReleaseDate), new XElement("NumberOfPlayers", data.NumberOfPlayers), new XElement("ESRB", data.ESRB), + new XElement("ImportedDate", data.ImportedDate), new XElement("Categories", categories) ); if (xml == LOCAL_FILES_DB) @@ -1770,7 +1771,7 @@ public static bool CheckXCI(string file) public static FileData GetFileDataNSP(string file) { FileData data = new FileData(); - + data.ImportedDate = DateTime.UtcNow.ToString("yyyyMMddHHmmss"); data.FilePath = file; data.FileName = Path.GetFileNameWithoutExtension(file); data.FileNameWithExt = Path.GetFileName(file); @@ -2239,6 +2240,7 @@ where x.Length > 1 public static FileData GetFileData(string filepath) { FileData result = new FileData(); + result.ImportedDate = DateTime.UtcNow.ToString("yyyyMMddHHmmss"); //Basic Info result.FilePath = filepath; result.FileName = Path.GetFileNameWithoutExtension(filepath); @@ -2694,6 +2696,10 @@ public static FileData GetFileData(XElement xe) try { result.TitleID = xe.Attribute("TitleID").Value; + if (xe.Element("ImportedDate") != null) + { + result.ImportedDate = xe.Element("ImportedDate").Value; + } if (xe.Element("TitleIDBaseGame") != null) { result.TitleIDBaseGame = xe.Element("TitleIDBaseGame").Value; diff --git a/allgames.xslt b/allgames.xslt new file mode 100644 index 0000000..4ce6da3 --- /dev/null +++ b/allgames.xslt @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + xci + + + + + + + nsp + + + + + + + + diff --git a/games.xslt b/games.xslt new file mode 100644 index 0000000..0762e18 --- /dev/null +++ b/games.xslt @@ -0,0 +1,180 @@ + + + + + + + + + +

Back

+

games listed.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + icon + + + icon + + +
+ + + +
+
+ diff --git a/index.html b/index.html new file mode 100644 index 0000000..c06b2af --- /dev/null +++ b/index.html @@ -0,0 +1,10 @@ + + +

My Switch Games

+

XCI cartridge backups

+

NSP eShop downloads

+

All games

+

Missing games (from scene release list)

+ + + \ No newline at end of file diff --git a/missinggames.xslt b/missinggames.xslt new file mode 100644 index 0000000..c3b7b7f --- /dev/null +++ b/missinggames.xslt @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/searchicon.png b/searchicon.png new file mode 100644 index 0000000..71f06af Binary files /dev/null and b/searchicon.png differ diff --git a/transform.ps1 b/transform.ps1 new file mode 100644 index 0000000..3ad0bd1 --- /dev/null +++ b/transform.ps1 @@ -0,0 +1,30 @@ +param ( + [string]$openResult = "n" +) +try +{ + write-output $openResult + $XsltSettings = New-Object System.Xml.Xsl.XsltSettings($true, $false); + $XslPath = New-Object System.Xml.Xsl.XslCompiledTransform + $XslPath.Load("allgames.xslt",$XsltSettings, $null) + $XslPath.Transform("nswdb.xml", "allgames.xml") + $XslPath = New-Object System.Xml.Xsl.XslCompiledTransform + $XslPath.Load("missinggames.xslt",$XsltSettings, $null) + $XslPath.Transform("nswdb.xml", "missinggames.xml") + $XslPath = New-Object System.Xml.Xsl.XslCompiledTransform + $XslPath.Load("games.xslt") + $XslPath.Transform("SBM_Local.xml", "SBM_Local.html") + $XslPath.Transform("SBM_NSP_Local.xml", "SBM_NSP_Local.html") + $XslPath.Transform("missinggames.xml", "missing.html") + $XslPath.Transform("allgames.xml", "allgames.html") + + Write-Host "Done !" + + if ($openResult -eq "y") { + ./index.html + } +} +catch +{ + Write-Host $_.Exception -ForegroundColor Red +} \ No newline at end of file