diff --git a/PSPSync/FTPClient.cs b/PSPSync/FTPClient.cs index 0c82535..c5a65cb 100644 --- a/PSPSync/FTPClient.cs +++ b/PSPSync/FTPClient.cs @@ -373,7 +373,7 @@ public string[] DirectoryListSimple(string directory) } } - catch (WebException) { Console.WriteLine(directory);/*Console.WriteLine(ex.ToString());*/ } + catch (WebException) { /*Console.WriteLine(directory);Console.WriteLine(ex.ToString());*/ } /* Return an Empty string Array if an Exception Occurs */ return new string[0]; } @@ -392,7 +392,7 @@ public bool ServerAvailable() { } catch (WebException e) { - Console.WriteLine(e.Message); + //Console.WriteLine(e.Message); return false; } diff --git a/PSPSync/MTPDevice.cs b/PSPSync/MTPDevice.cs index 3ac16f8..e2b606e 100644 --- a/PSPSync/MTPDevice.cs +++ b/PSPSync/MTPDevice.cs @@ -16,7 +16,7 @@ public MTPDevice(MediaDevice dev) { device.Connect(); try { - Console.WriteLine(device.FriendlyName); + //Console.WriteLine("Connecting to " + device.FriendlyName); if (!device.FriendlyName.EndsWith(":\\")) //that means it's already mounted as a drive. don't trust it. { foreach (string a in device.GetDirectories("/")) diff --git a/PSPSync/MainWindow.xaml.cs b/PSPSync/MainWindow.xaml.cs index 4045637..d6079ba 100644 --- a/PSPSync/MainWindow.xaml.cs +++ b/PSPSync/MainWindow.xaml.cs @@ -297,7 +297,6 @@ public void SetMgrEnabled(bool enabled) { public void CopySave(SaveMeta srcMeta, SaveMeta otherMeta, NamedStream[] files, IStorageDevice dest, int updateDevice) { SetMgrEnabled(false); string id = GetGameID(srcMeta.directory); - Console.WriteLine(dest.HasSave(id) + " " + id); if (dest.HasSave(id)) { if (otherMeta == null) diff --git a/PSPSync/SDs/FTPSaveDir.cs b/PSPSync/SDs/FTPSaveDir.cs index 5a781b6..d737106 100644 --- a/PSPSync/SDs/FTPSaveDir.cs +++ b/PSPSync/SDs/FTPSaveDir.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using System.IO; using System.Windows.Media.Animation; +using System.Windows.Media; namespace PSPSync { @@ -63,7 +64,7 @@ public NamedStream[] ReadSave(string directory) } } MemoryStream file = client.Download(directory + "/" + files[x]); - Console.WriteLine(directory + "/" + files[x]); + //Console.WriteLine(directory + "/" + files[x]); file.Position = 0; ret[x] = new NamedStream(file, filename); } @@ -81,7 +82,7 @@ public List ScanSaves() foreach (string dr2 in ss) { string a = mainDir + dr2; - if (!client.FileExists(a + "/PARAM.SFO") || !client.FileExists(a + "/ICON0.PNG")) + if (!client.FileExists(a + "/PARAM.SFO")) { continue; } @@ -102,11 +103,16 @@ public List ScanSaves() title = Encoding.UTF8.GetString(reader); b.Close(); - MemoryStream imageStream = client.Download(a + "/ICON0.PNG"); - Console.WriteLine(a); - imageStream.Position = 0; - saves.Add(new SaveMeta(title, info, info2, a, MTPSaveDir.BitmapFromStream(imageStream), new System.DateTime(0))); + ImageSource thumbnailImg = null; + if (client.FileExists(a + "/ICON0.PNG")) + { + MemoryStream imageStream = client.Download(a + "/ICON0.PNG"); + imageStream.Position = 0; + thumbnailImg = MTPSaveDir.BitmapFromStream(imageStream); + } + + saves.Add(new SaveMeta(title, info, info2, a, thumbnailImg, new System.DateTime(0))); } return saves; } @@ -122,7 +128,6 @@ public void WriteSave(string directoryName, NamedStream[] files) { client.Upload(dr + "/" + stm.name, stm.stream); } - Console.WriteLine("done holy shit"); } public GeneralDeviceSpeed GetDeviceSpeed() { diff --git a/PSPSync/SDs/MTPSaveDir.cs b/PSPSync/SDs/MTPSaveDir.cs index 8ac1bf6..4e0955c 100644 --- a/PSPSync/SDs/MTPSaveDir.cs +++ b/PSPSync/SDs/MTPSaveDir.cs @@ -136,7 +136,6 @@ public void WriteSave(string directoryName, NamedStream[] files) { parent.device.UploadFile(stm.stream, dr + "/" + stm.name); } - Console.WriteLine("done holy shit"); } public GeneralDeviceSpeed GetDeviceSpeed() diff --git a/PSPSync/SDs/PSPSaveDir.cs b/PSPSync/SDs/PSPSaveDir.cs index 852bcff..0ff1475 100644 --- a/PSPSync/SDs/PSPSaveDir.cs +++ b/PSPSync/SDs/PSPSaveDir.cs @@ -62,7 +62,7 @@ public List ScanSaves() b.Seek(0x12B0, SeekOrigin.Begin); b.Read(reader, 0, 128); title = Encoding.UTF8.GetString(reader); - saves.Add(new SaveMeta(title, info, info2, a, BitmapFromUri(new Uri(a + "/ICON0.PNG")), File.GetLastWriteTime(a + "/PARAM.SFO"))); + saves.Add(new SaveMeta(title, info, info2, a, (File.Exists(a+"/ICON0.PNG") ? BitmapFromUri(new Uri(a + "/ICON0.PNG")) : null), File.GetLastWriteTime(a + "/PARAM.SFO"))); b.Close(); } return saves; @@ -119,7 +119,6 @@ public void WriteSave(string directoryName, NamedStream[] files) } a.Close(); } - Console.WriteLine("done holy shit"); } public GeneralDeviceSpeed GetDeviceSpeed() diff --git a/PSPSync/SaveListItem.xaml b/PSPSync/SaveListItem.xaml index 466762c..79fe696 100644 --- a/PSPSync/SaveListItem.xaml +++ b/PSPSync/SaveListItem.xaml @@ -7,6 +7,7 @@ mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> +