mathflair Posted September 18, 2015 Share Posted September 18, 2015 @Jason Carr Oops, I had forgot that I had added some other libraries that are not standard, and so your program is probably closing for that reason. I'll build an installer or self-contained exe and make sure that works before posting anything. Thanks for noticing that, spending too much time in VS :) Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 18, 2015 Share Posted September 18, 2015 I've uploaded a zip with all the files needed to run the program. Can someone do a little testing to make sure it runs on their machine before I make a thread dedicated to this app? Quote Link to comment Share on other sites More sharing options...
sylandro Posted September 19, 2015 Author Share Posted September 19, 2015 Wow, you work fast! Thanks for the INI support. Unfortunately, these days I'm having very little spare time to try this out. Here's a little feedback I can give so far: - When pressing the Update under the Update Meta from Filename tab I don't get any progress bar, the first time I tried the application I thought it wasn't working. - After I loaded nes.ini, my Launchbox xml wouldn't load (perhaps a backup feature could be implemented in the future-- luckily I knew how to fix what happened). Here's the stacktrace (my OS in in spanish): System.FormatException: No se puede reconocer la cadena como valor DateTime válido. en System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) en LaunchBox.Data.DataItem.LoadFromDataRow(DataRow row) en LaunchBox.Data.DataManager.Load() en LaunchBox.Data.DataManager..ctor(Boolean bare) en LaunchBox.Program.Main(String[] args) The problem is that the Released field in the ini is a little inconsistent, sometimes it only contains the year, sometimes it only contains the format "Month, Year" and sometimes "Month Day, Year". A proper DateTime should be written on the ReleaseDate tag by specifying the input format and defaulting to January 01 if the month or day is missing. Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 21, 2015 Share Posted September 21, 2015 So this problem happens because I didn't realize that LaunchBox expects ReleaseDate to be a properly formatted datetime string. The INIs seem to just have a year for release date. How would you prefer it to be handled? (1) I could ignore the release date field. (2) I could create a custom release year field. (3) I could put release date as year-01-01 format so it gets parsed. Quote Link to comment Share on other sites More sharing options...
sylandro Posted September 21, 2015 Author Share Posted September 21, 2015 I think parsing the date as year-01-01 for incomplete dates (3) is the best approach, since it fills the as much data as it can on the original field. Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 21, 2015 Share Posted September 21, 2015 OK, I've updated the program to be able to better handle these partial dates. I have it working and tested it on my own NES files and it seems to be working. As for the progress bar not animating, that is an issue with the library I am using. I don't really want to write a good WPF progress dialog, but if you know of a good one, let me know and I can see if I can migrate to it. Thanks for helping me test this a little. I do test myself, but it is easy to miss all edge cases. Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted September 22, 2015 Share Posted September 22, 2015 Hi @mathflair, the app looks great. I'm confused by "Premium" in the app though; what does that mean? Quote Link to comment Share on other sites More sharing options...
sylandro Posted September 22, 2015 Author Share Posted September 22, 2015 Hi @mathflair, I tested the new executable and it seems that other dates need parsing as well. I checked the xml and some dates are being saved in the following format: 1/09/1991 12:00:00 a. m. While the expected format is something like this: 1990-01-01T00:00:00-05:00 Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 22, 2015 Share Posted September 22, 2015 @Jason Carr That refers to the fact that they are using custom fields. If you don't have the premium version of LaunchBox and do anything that causes the xml file to change, then all of your custom fields will be deleted. I didn't want users without the premium version to rely on certain features, so I marked them as premium only. @sylandro Are you still getting parsing errors? It works for me. I did just check the repo though (not on dev machine right now), and it does look like I some how dropped the format string. Still, I tested it myself and had no problem loading the xml file anymore, so let me know if you are still running into problems. Quote Link to comment Share on other sites More sharing options...
sylandro Posted September 22, 2015 Author Share Posted September 22, 2015 I tested it with the attached executable, and I still have parsing problems (I described the problem in the above post). For example, for the game Zombie Nation (USA), my ReleaseDate field has the following value: 1/09/1991 12:00:00 a. m. I have the "replace existing fields" checkbox checked in the application. Perhaps that has something to do? Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 22, 2015 Share Posted September 22, 2015 @sylandro My guess is that the problem was that he have different default regions, so the result of ToString on my machine is correctly parsed by LaunchBox, but not on your machine. Regardless, here is a new version that tries to match LaunchBox's value. I don't know if I have the right format string, as I can't check LaunchBox's code, but it does parse for me. Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted September 22, 2015 Share Posted September 22, 2015 Ah, thanks @mathflair. I just didn't make the connection to custom fields. Typically the way you solve the date issues is to use DateTime.Parse(CultureInfo.CurrentCulture, value). Hopefully that helps. Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 22, 2015 Share Posted September 22, 2015 @Jason Carr The problem isn't parsing the date times, the problem is writing them out in a format that LaunchBox parses correctly. I don't know what the format string you use is, so I can't be sure I have matched it. Quote Link to comment Share on other sites More sharing options...
sylandro Posted September 22, 2015 Author Share Posted September 22, 2015 @mathflair That worked! The ReleaseDate now has the correct format (1991-09-01T00:00:00-05:00). Now I'm getting another Exception, except this time I think it doesn't have anything related to the date: (Input string not in the correct format) System.FormatException: La cadena de entrada no tiene el formato correcto. en System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) en System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) en LaunchBox.Data.DataItem.LoadFromDataRow(DataRow row) en LaunchBox.Data.DataManager.Load() en LaunchBox.Data.DataManager..ctor(Boolean bare) en LaunchBox.Program.Main(String[] args) I don't have any clue what could be wrong this time... it's very hard to find which is the game with the incorrect value. Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 22, 2015 Share Posted September 22, 2015 Any clue what field it is that causes that? I don't have access to LaunchBoxes code, so it is reverse engineering on my part to figure out these errors. Maybe PM me your XML file and INI file so I can test those. I have done it just fine with the NES.INI and my own files. Quote Link to comment Share on other sites More sharing options...
sylandro Posted September 22, 2015 Author Share Posted September 22, 2015 @mathflair Never mind, I restored an old xml backup and started from scratch and now it's working fine. :) So far so good, I'll be gradually importing the rest of my collections and let you know if something comes up. Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted September 23, 2015 Share Posted September 23, 2015 Looks like I'm reading and writing dates in LaunchBox.xml with CultureInfo.InvariantCulture. So if you use that when you write them out, that should do the trick. Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 23, 2015 Share Posted September 23, 2015 Jason, using the following code releaseDate.ToString(CultureInfo.InvariantCulture.DateTimeFormat) I get an output of something that looks like "10/01/1985 00:00:00". When I look at the XML value though I see something of the form "1985-10-01T00:00:00-06:00". I am mimicking this value using releaseDate.ToString("yyyy-MM-ddT00:00:00K", CultureInfo.InvariantCulture.DateTimeFormat). I know you mention you use the InvariantCulture, but is the format string (i.e., "yyyy-MM-ddThh:mm:ssK") the same as what you are using? Quote Link to comment Share on other sites More sharing options...
sylandro Posted September 23, 2015 Author Share Posted September 23, 2015 @mathflair About the SIFT files, I don't think it's neccesary anymore for your application to read these files. One can use the SIFT tool to alter the INIs and rename its game titles to match a specific datfile. That said, I think the INI feature is pretty much complete. I'll let you know if I find any issues. ------- E D I T ----------- I found a small issue: I've discovered that when using the ROM importer, Launchbox automatically changes the " - " strings for ": " (for example, a ROM named "1943 - The Battle for Midway" will be added as "1943: The Battle for Midway". While I think that's a great feature, I think LaunchboxAnnotator should do the same when matching the INI titles to the Launchbox titles. Some of my games are not having metadata added from the ini just because my ini has the " - " in its game title, and it never matches. Quote Link to comment Share on other sites More sharing options...
mathflair Posted September 24, 2015 Share Posted September 24, 2015 Heh, good point. I make that change a bunch of other places, but not when matching names. Let me make that change and I'll post a new version in a little. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.