-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Improve previews #1741
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
Improve previews #1741
Conversation
|
@rullzer, thanks for your PR! By analyzing the history of the files in this pull request, we identified @LukasReschke, @nickvergessen and @icewind1991 to be potential reviewers. |
lib/private/Preview2.php
Outdated
| @@ -0,0 +1,338 @@ | |||
| <?php | |||
|
|
|||
| namespace OC; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please namespace (we have a Preview namespace) then you can also get rid of the 2
header missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah well actually the old preview should go. But yeah lets move it.
| /** @var IAppData */ | ||
| private $appData; | ||
|
|
||
| public function __construct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs
5c30d19 to
adf6b5c
Compare
|
File_sharing (public previews) is moved over. Awesome side effect is that we now (thanks to the FileDisplayResponse) get preview client side caching for free! |
Current coverage is 58.03% (diff: 66.92%)@@ master #1741 diff @@
==========================================
Files 1088 1092 +4
Lines 62156 62424 +268
Methods 6938 6978 +40
Messages 0 0
Branches 0 0
==========================================
+ Hits 35901 36227 +326
+ Misses 26255 26197 -58
Partials 0 0
|
f234df8 to
d2dfa2b
Compare
|
Ok all is looking good from my POV. Any ideas? @oparoz @MorrisJobke @nickvergessen ? |
|
Maybe don't move old previews over but allow reading the old preview when there is none in the new location, then when a file is changed delete the old ones while generating the new ones |
|
@icewind1991 mmm could work. But that would still mean that currently wrong previews would still be displayed wrong (so for shared files etc) |
|
or just delete the previews in the old location when first generating a preview with the new logic. unlinking around 5-10 (I guess that's how many there might be) files shouldn't take to long. Not migrating old preview would create extra load on big installs though, since all previews need to be regenerated. |
|
Ok after some more thinking I think just deleting all previews and starting over is the easiest and cleanest way forward.
So I vote for just killing all preview folders. And have the previews be regenerated. In most cases this should be significantly less previews since the previews are now shared. |
|
This will require some good communication. Last time this happened, everybody complained that Pictures/Gallery was slow, because the initial load would take minutes. Now at least we show something in the first few seconds, but I'm just saying that it won't be great for people will large photo collections. Maybe it's time to resurrect the occ thumbnail generator. It can take hours for the process to complete, but it's better than having to wait when using the GUI imo. |
|
@oparoz yes I agree. Good communication is key here. We have a nice list of improvements. But gettings this properly is key. I would not mind the thumbnail generator resurrection. But I also have been thinking about a listner that injects new/edited files. So we can say generate those in the background. But that is a discussion for another time. I'll see if the thumbnail generator is easy to resurrect. Because that seems like the fastest solution. |
|
See https://github.com/rullzer/PreviewGenerator for my ultra simple cli preview generator. It isn't smart. Just looks over all files and if it can generate previews. It doesn't do anything fancy. because of the caching previews if a preview exists it just returns the file. |
|
Ok I will update the previewgenerator app with a command to also delete the old previews. That seems the most sensible solution IMO. So review time. |
|
Code looks good and also works 👍 |
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Only connect the watcher once the instance is properly setup else AppData fails hard. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* PreviewController test * PublicPreview test * Versions Preview test * Trash Preview test Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
|
Cool about the changelog. We'll have to test a few apps I guess and communicate heavily if things break so that people can fix their app for launch. |
|
So 1 more thumbs up plz :) |
|
LGTM |
This PR improves the preview system:
Todo:
FYI @oparoz