-
-
Notifications
You must be signed in to change notification settings - Fork 840
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
File storage rewrite #2676
File storage rewrite #2676
Conversation
d94fa76
to
f17be31
Compare
25363b9
to
ecead78
Compare
More testing using latest binary after 76fffa5 and still the same Identify with stashdb as the source is broken
Deleting a scene removes the scene from the database but not the associated files. That means that in the next scan the scene wont be recreated because the files are already present in the database and so the user as it is now has no way from the UI to fix this. (deleting the files directly from the files table using sqlite and rescanning is needed atm). More of a TODO than a bug probably I am getting a few warnings while browsing some images from a zip gallery
Everything seems working though, the images seem to be displayed fine |
f17be31
to
29f5979
Compare
2b9e1c3
to
ed8818e
Compare
Thanks for the continued testing.
The scan options resetting appears to be a regression in the |
That was exactly my thought. It is a lot easier to just delete for now and leave the proper implementation for when the UI can handle the file entries. I will check the changes and update when i test using an existing database. |
804d8fe
to
386f935
Compare
29f5979
to
4f3fa86
Compare
4f3fa86
to
e86a65f
Compare
a2c496b
to
84c32be
Compare
7cc806d
to
d8b8697
Compare
* Refactor and separate image model * Refactor image query builder * Handle relationships in image query builder * Remove relationship management methods * Refactor gallery model/query builder * Add scenes to gallery model * Convert scene model * Refactor scene models * Remove unused methods * Add unit tests for gallery * Add image tests * Add scene tests * Convert unnecessary scene value pointers to values * Convert unnecessary pointer values to values * Refactor scene partial * Add scene partial tests * Refactor ImagePartial * Add image partial tests * Refactor gallery partial update * Add partial gallery update tests * Use zero/null package for null values
2fd2713
to
8036afe
Compare
Merging to Please report bugs to #2737. |
* Restructure data layer part 2 (#2599) * Refactor and separate image model * Refactor image query builder * Handle relationships in image query builder * Remove relationship management methods * Refactor gallery model/query builder * Add scenes to gallery model * Convert scene model * Refactor scene models * Remove unused methods * Add unit tests for gallery * Add image tests * Add scene tests * Convert unnecessary scene value pointers to values * Convert unnecessary pointer values to values * Refactor scene partial * Add scene partial tests * Refactor ImagePartial * Add image partial tests * Refactor gallery partial update * Add partial gallery update tests * Use zero/null package for null values * Add files and scan system * Add sqlite implementation for files/folders * Add unit tests for files/folders * Image refactors * Update image data layer * Refactor gallery model and creation * Refactor scene model * Refactor scenes * Don't set title from filename * Allow galleries to freely add/remove images * Add multiple scene file support to graphql and UI * Add multiple file support for images in graphql/UI * Add multiple file for galleries in graphql/UI * Remove use of some deprecated fields * Remove scene path usage * Remove gallery path usage * Remove path from image * Move funscript to video file * Refactor caption detection * Migrate existing data * Add post commit/rollback hook system * Lint. Comment out import/export tests * Add WithDatabase read only wrapper * Prepend tasks to list * Add 32 pre-migration * Add warnings in release and migration notes
* Restructure data layer part 2 (#2599) * Refactor and separate image model * Refactor image query builder * Handle relationships in image query builder * Remove relationship management methods * Refactor gallery model/query builder * Add scenes to gallery model * Convert scene model * Refactor scene models * Remove unused methods * Add unit tests for gallery * Add image tests * Add scene tests * Convert unnecessary scene value pointers to values * Convert unnecessary pointer values to values * Refactor scene partial * Add scene partial tests * Refactor ImagePartial * Add image partial tests * Refactor gallery partial update * Add partial gallery update tests * Use zero/null package for null values * Add files and scan system * Add sqlite implementation for files/folders * Add unit tests for files/folders * Image refactors * Update image data layer * Refactor gallery model and creation * Refactor scene model * Refactor scenes * Don't set title from filename * Allow galleries to freely add/remove images * Add multiple scene file support to graphql and UI * Add multiple file support for images in graphql/UI * Add multiple file for galleries in graphql/UI * Remove use of some deprecated fields * Remove scene path usage * Remove gallery path usage * Remove path from image * Move funscript to video file * Refactor caption detection * Migrate existing data * Add post commit/rollback hook system * Lint. Comment out import/export tests * Add WithDatabase read only wrapper * Prepend tasks to list * Add 32 pre-migration * Add warnings in release and migration notes
* Restructure data layer part 2 (#2599) * Refactor and separate image model * Refactor image query builder * Handle relationships in image query builder * Remove relationship management methods * Refactor gallery model/query builder * Add scenes to gallery model * Convert scene model * Refactor scene models * Remove unused methods * Add unit tests for gallery * Add image tests * Add scene tests * Convert unnecessary scene value pointers to values * Convert unnecessary pointer values to values * Refactor scene partial * Add scene partial tests * Refactor ImagePartial * Add image partial tests * Refactor gallery partial update * Add partial gallery update tests * Use zero/null package for null values * Add files and scan system * Add sqlite implementation for files/folders * Add unit tests for files/folders * Image refactors * Update image data layer * Refactor gallery model and creation * Refactor scene model * Refactor scenes * Don't set title from filename * Allow galleries to freely add/remove images * Add multiple scene file support to graphql and UI * Add multiple file support for images in graphql/UI * Add multiple file for galleries in graphql/UI * Remove use of some deprecated fields * Remove scene path usage * Remove gallery path usage * Remove path from image * Move funscript to video file * Refactor caption detection * Migrate existing data * Add post commit/rollback hook system * Lint. Comment out import/export tests * Add WithDatabase read only wrapper * Prepend tasks to list * Add 32 pre-migration * Add warnings in release and migration notes
$100 bounty placed (contribution no. 603395) |
This PR targets the
files-refactor
branch, but it represents the culmination of all the previous work.This PR is a significant rewrite of the underlying object model for scenes, images and galleries.
A simplified view of the object model is as follows:
File-specific fields have been removed or deprecated from scenes, images and galleries, replaced with relationships to files and folders. There is still a significant amount of code that assumes that these objects have one single file. In most cases, this is replaced with a call to
PrimaryFile
, which returns the primary file for the object, ornil
if it doesn't have one.The only major user-visible change as a result of this is handling of duplicate files. When a file is added, a scene/gallery/image will be added linking to the new file. If a scene/gallery/image linked to a file with the same primary fingerprint as the new file, then the new file will be added to the existing scene/gallery/image. If multiple files are attached to a single scene/gallery/image, then this will be reflected in the file info tab for the object:
The accordion view shows the details for each of the files.
Viewing the file always defaults to the primary file. The primary file cannot currently be changed to another linked file, but this functionality will be added in a future PR.
Known issues:
This PR is likely to have many regressions and will need extensive testing. This branch will be rebased when necessary to remain up to date against the
develop
branch.This PR will allow future support for the following functionality:
Note: please exercise caution when testing this PR, especially against existing systems.
Note also that this requires a rescan after migrating an existing system.