-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB Backend PR #12
base: db-backend
Are you sure you want to change the base?
DB Backend PR #12
Conversation
Can convert XML into database and back again. DOES NOT CURRENTLY WORK WITH THE PROGRAM. The metadata member variable on FileData needs to be replaced. FileData might get completely rewritten in favor of a solution that lets us use SQL queries to get file lists.
Removed ScraperCmdLine.h/.cpp, since it was never used anyway.
Also wrote a short and simple SQLite C++ wrapper that uses exceptions and RAII, which makes the code much cleaner.
…enever MetaData.cpp's gameDecls array changes).
FileData now basically works as a key in the GamelistDB "files" table. Still not quite done (lots of places marked TODO), but semi-functional. Removed Boost.Regex dependency, didn't need it after all.
Fixed launching games causing a crash. (because the filetype column in GamelistDB used to be isfolder, so the enum was just tested as a boolean).
Fixed "IMPORT XML" option not updating gamelist views. DetailedGameListView now repopulates instead of recreating itself when changes occur.
Conflicts: es-app/src/SystemData.cpp
Conflicts: es-app/src/guis/GuiGamelistOptions.cpp
…eared on a change, and use that metadata cache for getting a filter's params
…rldy zoomed/faded
…nter the SVGs so those half stars look a bit better
I've been busy with other things, but this pull request shouldn't cause much trouble if you make sure the database path respects the new config folders. The XML import Aloshi wrote appears to work fine, but I haven't tested this feature extensively. If you want to revert the menu restructuring I did while keeping the new menu features, most of it should be fairly straight forward on just cut-pasting the code that builds the menus, being sure to also move over any needed helper functions/closures. The easy-to-overlook changes are the edits to the HelpPrompts and input handlers for the menus, since I changed the behavior start vs. select. Don't forget the input handler in the View Controller either. (The restructuring was done for an arcade machine setting, and might not suit your purposes.) I've been thinking of changing the database schema away from what upstream had, since it puts strange constraints on the metadata for filters. If I do so, I'll be sure to write code to pull the information out of the old schema, since it might actually have users now. |
hey @jgeumlek - thanks a ton. I'm trying to work through this to figure out how we can merge into the branch. Fixing the library scale issues is a major priority for me. I've started a design doc that covers what I'm trying to accomplish, but want feedback from others. So that I don't have to go through all the commits and reverse engineer your changes, can you help me with documenting the following things from this PR?
I'm trying to accomplish several requests by generalizing any metadata changes, so I want to take our time merging this in. |
The biggest improvement this would bring is to allow dynamic listing (filtering) based on all game properties, not just system-type. |
Sorry, my life has gotten busy again. Here's an info dump about the questions above. DB layout:
One column is
Files have a Due to this simple one table schema, filters had to abuse some existing columns. There is an additional table, Aloshi had built some automagic to handle updating the table should a new metadata column be added or removed. New DB Layout Filtering here is still limited to just the UI Changes I also added new menu items, like manually scanning the filesystem for files to put in the database or remove missing files, as well as adding or removing tags. You'll likely want to revert these changes: The two menus (start/select) are now one menu (select) with (start) used to start games. My previous comment goes into this more. The other change is putting system volume at the root of this menu. Performance Obviously a user could write a complicated filter than takes time to compute. Putting this power in the user's hand seems fair. I have an install with about 60k file entries due to some cruft from importing/duplicate files (this happened back on the XML version, and I haven't bothered to clean it up), and it handles well on a desktop. Having a dense amount of tags may slow down every tag search though. But for modest tagging, I have not seen anything. Loading images for display seems to be the only performance hiccup I've noticed. The biggest killer on ES start up time is scanning the filesystem. Auto refreshing the game lists is nice, but this does not seem to be the appropriate price to pay. Making the database refresh a manual action is a large savings, as this likely happens rarely compared to starting ES. It's possible SSDs negate this, I wouldn't know. Design document comments It does not really make managing metadata any easier. Since it is a sqlite tables, I have been using There is a function in the DB class to return the tags of a file, but no code actually retrieves them to display. This would require somehow changing the theme structure to make a place to show tags... (Or perhaps just tack them onto the description?) You'll probably want to leave the old theme structure behind and move to a setup where a text item has an attribute declaring which bit of metadata it wishes to show. Known Bugs and comments These aren't showstoppers, just that the ordering/filtering of the gamelist and the metadata like last-played may be stale. Any listing can be refreshed by changing the sorting, or entering/leaving a folder. Writing this requires handling the case where the gamelist is empty, which was asserted to never happen in the upstream. I've caught quite a few cases where this assert might happen, but there might still be a few lurking around. It leads to a crash with a clear message about asserting the list size is greater than 0, so these are generally easy to fix. |
Thanks @jgeumlek!