Skip to content
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

Do not generate previews if storage is external/slow #13

Closed
oparoz opened this issue Jan 22, 2015 · 11 comments
Closed

Do not generate previews if storage is external/slow #13

oparoz opened this issue Jan 22, 2015 · 11 comments

Comments

@oparoz
Copy link
Contributor

oparoz commented Jan 22, 2015

Current situation

We want to avoid loading images from slow storage, because it will make it seem like the app has frozen and can take minutes to generate a handful of thumbnails.

I've found 2 methods which can help but they can't be used as is.
See this ticket for a description of the problem

So I've designed a custom method, in place since 2.0.10, based on isMounted(), but which excludes federated clouds.

The problem is that the app "External storage" mounts folders locally, so it's more difficult to exclude them.

The future

Hopefully, there will be new methods included in core which will help with this.

At some point, there should be a way to configure external storage:
owncloud/core#5917, part of owncloud/core#12216

And hopefully the same thing will be available for shares.

@oparoz
Copy link
Contributor Author

oparoz commented Feb 28, 2015

A first step via a295b03

@flipsa
Copy link

flipsa commented Mar 11, 2015

What does qualify as 'external' in this regard? Are directories outside of the OC root folder which are soft-linked (e.g. /owncloud/data/USER/files/SOFT-LINK_TO_SOME_FOLDER_ON_SAME_MACHINE) considered external?

The problem I'm seeing is that as soon as there's a softlink in the OC doc-root, galleryplus does not show any files at all (after loading for a while), not even pictures that are directly in the OC root (e.g. /owncloud/data/USER/files/PIC.JPG) . As soon as I delete all soft-links, these pics show just fine.

However, if I first navigate into on of these linked directories (from the file browser) and then click the galleryplus icon, or if manually change the URL to one of the soft-linked folders (e.g. https://SERVER/owncloud/galleryplus/SOFT-LINK_TO_SOME_FOLDER_ON_SAME_MACHINE), everything works fine, i.e. thumbnails are being generated and I can navigate into subfolders within the soft-linked folders. As soon as I navigate back to the top folder (the virtual "Pictures" folder), I get the "no files..." message. Also, the breadcrumb menu is not showing when in the top folder (except for the icon for the file browser), but shows just fine when in a linked subfolder.

Is this expected behaviour?

This is the fatal error I'm seeing in the logs when navigating to the doc root (i.e. the virtual "Pictures" folder) in gallerplus (https://SERVER/owncloud/galleryplus/#):

Exception: {"Message":"","Code":0,"Trace":"#0 \/var\/www\/owncloud\/lib\/private\/files\/node\/node.php(321): OC\\Files\\Node\\Node->getFileInfo()\n#1 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(165): OC\\Files\\Node\\Node->getType()\n#2 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(222): OCA\\GalleryPlus\\Service\\InfoService->searchFolder(Object(OC\\Files\\Node\\Folder), 4)\n#3 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\\GalleryPlus\\Service\\InfoService->searchSubFolders(Array, 0, 3)\n#4 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(222): OCA\\GalleryPlus\\Service\\InfoService->searchFolder(Object(OC\\Files\\Node\\Folder), 3)\n#5 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\\GalleryPlus\\Service\\InfoService->searchSubFolders(Array, 0, 2)\n#6 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(222): OCA\\GalleryPlus\\Service\\InfoService->searchFolder(Object(OC\\Files\\Node\\Folder), 2)\n#7 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\\GalleryPlus\\Service\\InfoService->searchSubFolders(Array, 0, 1)\n#8 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(222): OCA\\GalleryPlus\\Service\\InfoService->searchFolder(Object(OC\\Files\\Node\\Folder), 1)\n#9 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\\GalleryPlus\\Service\\InfoService->searchSubFolders(Array, 0, 0)\n#10 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(139): OCA\\GalleryPlus\\Service\\InfoService->searchFolder(Object(OC\\Files\\Node\\Folder))\n#11 \/var\/www\/owncloud\/apps\/galleryplus\/controller\/servicecontroller.php(169): OCA\\GalleryPlus\\Service\\InfoService->getImages(Array)\n#12 [internal function]: OCA\\GalleryPlus\\Controller\\ServiceController->getImages()\n#13 \/var\/www\/owncloud\/lib\/private\/appframework\/http\/dispatcher.php(158): call_user_func_array(Array, Array)\n#14 \/var\/www\/owncloud\/lib\/private\/appframework\/http\/dispatcher.php(86): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\GalleryPlus\\Controller\\ServiceController), 'getImages')\n#15 \/var\/www\/owncloud\/lib\/private\/appframework\/app.php(97): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\GalleryPlus\\Controller\\ServiceController), 'getImages')\n#16 \/var\/www\/owncloud\/lib\/private\/appframework\/routing\/routeactionhandler.php(44): OC\\AppFramework\\App::main('ServiceControll...', 'getImages', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#17 [internal function]: OC\\AppFramework\\routing\\RouteActionHandler->__invoke(Array)\n#18 \/var\/www\/owncloud\/lib\/private\/route\/router.php(250): call_user_func(Object(OC\\AppFramework\\routing\\RouteActionHandler), Array)\n#19 \/var\/www\/owncloud\/lib\/base.php(767): OC\\Route\\Router->match('\/apps\/gallerypl...')\n#20 \/var\/www\/owncloud\/index.php(36): OC::handleRequest()\n#21 {main}","File":"\/var\/www\/owncloud\/lib\/private\/files\/node\/node.php","Line":65}

@oparoz
Copy link
Contributor Author

oparoz commented Mar 11, 2015

Could you tell me which version you're using?
It seems you were affected by #69 , which has been fixed in master.

@flipsa
Copy link

flipsa commented Mar 11, 2015

OC 8.0.1
Galleryplus 2.0.5

@oparoz
Copy link
Contributor Author

oparoz commented Mar 11, 2015

OK, so you could just test this: https://github.com/interfasys/galleryplus/archive/master.zip
or
wait for 2.0.6

@flipsa
Copy link

flipsa commented Mar 11, 2015

Awesome, this fixed it!

@oparoz
Copy link
Contributor Author

oparoz commented Mar 11, 2015

:)

@oparoz oparoz changed the title Do not generate previews if storage is external Do not generate previews if storage is mounted Mar 11, 2015
@oparoz
Copy link
Contributor Author

oparoz commented Mar 18, 2015

External is currently everything which is not "local", "home" or "shared"

Maybe there should be an exception for "smb" and maybe S2S shares should be filtered out since they are too slow to be usable as storage for a gallery.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 18, 2015

Switched to $file->getStorage()->isLocal()
a444c2d

@oparoz oparoz changed the title Do not generate previews if storage is mounted Do not generate previews if storage is external/slow Apr 12, 2015
@oparoz
Copy link
Contributor Author

oparoz commented Apr 20, 2015

Switched to a custom method from 2.0.10

oparoz added a commit that referenced this issue Apr 21, 2015
@oparoz
Copy link
Contributor Author

oparoz commented Apr 21, 2015

I'm closing this as the has now been solved on 8.1

  • The admin can decide if previews should be generated for locally mounted external storage
  • Users can decide if they want to show slow server 2 server shares.

@oparoz oparoz closed this as completed Apr 21, 2015
oparoz added a commit that referenced this issue Apr 22, 2015
oparoz added a commit that referenced this issue Apr 28, 2015
oparoz added a commit that referenced this issue May 11, 2015
oparoz added a commit that referenced this issue May 11, 2015
oparoz added a commit that referenced this issue May 12, 2015
oparoz added a commit that referenced this issue Jun 1, 2015
oparoz added a commit that referenced this issue Jun 22, 2015
oparoz added a commit that referenced this issue Jun 25, 2015
oparoz added a commit that referenced this issue Jun 25, 2015
oparoz added a commit that referenced this issue Jun 26, 2015
oparoz added a commit that referenced this issue Jun 26, 2015
oparoz added a commit that referenced this issue Jun 26, 2015
oparoz added a commit that referenced this issue Jun 26, 2015
oparoz added a commit that referenced this issue Jun 28, 2015
oparoz added a commit that referenced this issue Jul 3, 2015
oparoz added a commit that referenced this issue Jul 3, 2015
oparoz added a commit that referenced this issue Jul 8, 2015
oparoz added a commit that referenced this issue Jul 10, 2015
oparoz added a commit that referenced this issue Jul 11, 2015
icewind1991 added a commit that referenced this issue Jul 25, 2015
oparoz added a commit that referenced this issue Jul 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants