Refactor of file handling to allow auto-rollout of thumbnail graphics changes#352
Open
kenbot wants to merge 57 commits intonstlaurent:developmentfrom
Open
Refactor of file handling to allow auto-rollout of thumbnail graphics changes#352kenbot wants to merge 57 commits intonstlaurent:developmentfrom
kenbot wants to merge 57 commits intonstlaurent:developmentfrom
Conversation
b7486e8 to
52c43d7
Compare
d4dd067 to
16cec3b
Compare
GameID column is INTEGER, it won't work. Ripping it out New GameFiles columns for IntendedGame and IsSyncNeeded, basic sync capability IntendedGame IsSyncNeeded column control auto-syncing, page by page as viewed Autosync works for Grid view too Improved IWadInfo class, IntendedGame is now a typesafe IWadInfo field. Also some improved IntendedGame sync Fixed broken tests Refactored TextFileGameFileFragment to be more testable, added tests. Improved quality of sync data Finds title in GAMEINFO if it can Syncing now respects IntendedGame if it can Renamed GameFileFragments to SyncActions Resolving minor merge conflict Fixed line ending to LF Completed rename on new test file Some concurrency protection for syncing Shouldn't return null here Fixed messed-up rebase Final rebase cleanup Backup game capability Sync respects backup game When launching the game, it will validate and correct the IWAD Added better backup games, eg so that Tech Gone Bad defaults to regular DOOM instead of DOOM1 GameConfSyncAction changes IntendedGame rather than IWadID Get IntendedGame from GAMEINFO Some more corner cases for GAMEINFO Repairing rebase
… logic from ScreenshotHandler
…ses FileHandler to do most of the work
…umn, added DerivedFromFileID column
…ough PreviewImage functionality is broken
…sertFromMemory to InsertAndSave, deleting TileImageHandler
…ty for DbDataSourceAdapter to update inserted entities with the inserted id
…mageHandler returns IFiledata now instead of full path strings
…s of tests. Removed unused FileData.OriginalFilePath property. FileHandler adds OriginalFileName automatically
cede72e to
e461875
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is built on top of #333, which should be merged before this one.
Feature: Syncing will properly rebuild thumbnails when we change how graphics are generated
GameFileTile.ImageHeightto 16:9 or whatever else, and runningupdate GameFiles set IsSyncNeeded = 1;in SQLite. It will all automatically change back next time you run DoomLauncher.FileTypeand live in their own directory. The titlepic no longer appears in the screenshots list. I believe this is better UX, because titlepics are not screenshots, and are disposable derived images, instead of irreplaceable user data.Refactor
I have restructured the code that handles FileTypes/FileData, which was complex and untested. There is now an abstraction called
IFileHandlerthat handles all the coordinated manipulation of files & DB records, and applies common business rules:DemoHandler,GameFileImageHandler,SaveGameHandlerIFileHandlerFullFileNameto returned recordsDataSourceAdapter,System.IO.FileTileImageFileData objects can now be saved to the DB, which means the choosing logic doesn't need to be repeated until the next sync. (This includes the choice of DefaultImage).FileTypenow has aIsFixedContentproperty, which returns true forFileType.TileImage.FileHandleruses this to guarantee that tile image files can't be deleted.TitlePicis a separateFileTypenowGameFileImageHandlerrolls up thumbnails, screenshots, titlepics and tile images, and the logic that controls them. This gets rid ofScreenshotHandlerandThumbnailManager. It offers a greatly simplified interface to the UI, which can just callGetMainImageLargeorGetMainImageSmall. "Thumbnail", "TileImage" and "DefaultImage" are now internal concepts to GFIH, and the UI mostly does not need to worry about this.SourcePortIDcolumn inFilesexclusively contains actual SourcePort IDs now, and allows null. There is a new columnDerivedFromFileIDwhich is used to track which screenshot or titlepic thumbnails have been created from.FileManagerautomatically cascades deletes to derived files.GameFileImageHandler,DemoHandlerandSaveGameHandlerall useFileHandlerto get work done, and do not have direct access to theDataSourceAdapteror config.DataSourceAdapterto return the newly created ID in inserted records. I have only applied this toGameFile,File,IWadandSourcePort, but it's easy for us to apply it to the rest too.BasicFileViewscreens mostly alone - it would have been too much work, and I think bigger changes will be needed to those screens down the track.