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

Make it possible to ignore folders #58

Closed
oparoz opened this issue Mar 4, 2015 · 15 comments
Closed

Make it possible to ignore folders #58

oparoz opened this issue Mar 4, 2015 · 15 comments
Assignees
Milestone

Comments

@oparoz
Copy link
Contributor

oparoz commented Mar 4, 2015

After reading this: #10 (comment) , I thought it would be a nice feature to have.

  1. It adds some privacy
  2. It can help installations which have recurrent problems with some folders

Implementation

  • Adding a .nomedia file to a folder will prevent the app from adding the folder to the list of possible locations for media files
  • Check parent folders for a .nomedia file and return an empty file set if we're in a private folder
@oparoz oparoz self-assigned this Mar 4, 2015
@oparoz oparoz added this to the 2.0.5 milestone Mar 4, 2015
oparoz added a commit that referenced this issue Mar 4, 2015
@oparoz
Copy link
Contributor Author

oparoz commented Mar 4, 2015

Waiting for people to test this

@jsalatiel - Let me know if this works for you.

oparoz added a commit that referenced this issue Mar 4, 2015
That's useful for shared albums.
For #58
@oparoz
Copy link
Contributor Author

oparoz commented Mar 4, 2015

I think I need to add some sort of security check to make it more safe and convenient, hoping it won't hurt performance too much.
Check all parent folders up to the root to see if the user is allowed to browse the current one.

@oparoz
Copy link
Contributor Author

oparoz commented Mar 4, 2015

OK, the recursive permission check is in place.

@jsalatiel
Copy link

Sorry the delay, i was on a trip.
How can i test it ? I am still using owncloud 7.0.4.
Can i just git clone the gallery master ?

@oparoz
Copy link
Contributor Author

oparoz commented Mar 6, 2015

@jsalatiel - Unfortunately, this can only work on oC8 as it's the first version which works folder by folder as opposed to loading a list of all your media files in memory.
8.0.1 should be made public soon and it will probably be good enough to use in production.

@deMattin
Copy link

deMattin commented Mar 6, 2015

I tested it and it works as expected:

  1. the folder isn't shown in gallery+
  2. if the folder is a source for the parent folder 2x2 thumbnail, the thumbnail changes to pictures of existing folders
  3. works for the folder with ".nomedia" file and for all sub folders
  4. if you change from folder view to gallery+ view in a sub-sub folder with .nomedia in parent-parent folder, the pictures are not displayed (message: no pictures found)
  5. If you have an explicit "shared" folder (named "/_shared" in my case), where all files shared by others are located and as of server configuration placed by default there, it is also possible to exclude this folder from gallery. (to explan: this folder is empty on server and is used as some kind of "mountpoint" for the shared ressources). This way I am able to define not to view foreign shared pictures in gallery in a very simple way

Great thing - I like it!

Remark:
It is a problem to define a ".nomedia" file in Windows Explorer - but you can do it in webinterface of ownCloud. Perhaps in far future it may be an idea to give an option in userinterface of gallery+ to set this ".nomedia" file.
But this surely has no priority.

Edit:
And I like this approach to not show folders in gallery with the ".nomedia" file more than defining this somewhere in configuration or with a folder property in database set by a GUI.
This way you can easyly search ".nomedia" files to see, if and which folder you have excluded!

@oparoz
Copy link
Contributor Author

oparoz commented Mar 6, 2015

@deMattin - Awesome! :) And you're right about Windows Explorer... I didn't think about that. There is a trick to use, but that will surely annoy people who don't know about it...

@deMattin
Copy link

deMattin commented Mar 6, 2015

It's no problem because you can set it in OC web GUI.
I know the "trick" and you also can copy-paste a once created .nomedia file in windows.
But for simplicity it should be documented like this: "Windows user have to set the .nomedia file in the OC web GUI".

And Windows or NTFS itself has no problem with this sort of files.
FYI: I have in a way a "strange" OC configuration - A debian Webserver in a virtual maschine running with ext4 on a Windows Server and my data folder for owncloud is a mounted NTFS volume.
No problem with this configuration but some advantages regarding backup and my knowledge ... 😉

@oparoz
Copy link
Contributor Author

oparoz commented Mar 7, 2015

I need to start adding some documentation...
And it's good that you have a different configuration. It can help with testing as the app relies on oC working well.

@oparoz oparoz closed this as completed Mar 7, 2015
@jsalatiel
Copy link

I couldn't wait and just upgraded to 8.0.1RC1 :)
This feature is great, thanks oparoz!
btw, will gallery+ eventually become the default gallery app ?
in 8.0, is gallery+ able to handle 10.000 pictures ? 👍

@jsalatiel
Copy link

My girlfriend just get a "No pictures found! If you upload pictures in the files app, they will be displayed here." and she has lots of pictures :/

Log shows :

{"reqId":"b1f5e09f6d7878a9bb58b9260681909a","remoteAddr":"192.168.254.2","app":"index","message":"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(220): OCA\GalleryPlus\Service\InfoService->searchFolder(Object(OC\Files\Node\Folder), 6)\n#3 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\GalleryPlus\Service\InfoService->searchSubFolders(Array, 0, 5)\n#4 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(220): OCA\GalleryPlus\Service\InfoService->searchFolder(Object(OC\Files\Node\Folder), 5)\n#5 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\GalleryPlus\Service\InfoService->searchSubFolders(Array, 0, 4)\n#6 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(220): OCA\GalleryPlus\Service\InfoService->searchFolder(Object(OC\Files\Node\Folder), 4)\n#7 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\GalleryPlus\Service\InfoService->searchSubFolders(Array, 0, 3)\n#8 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(220): OCA\GalleryPlus\Service\InfoService->searchFolder(Object(OC\Files\Node\Folder), 3)\n#9 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\GalleryPlus\Service\InfoService->searchSubFolders(Array, 0, 2)\n#10 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(220): OCA\GalleryPlus\Service\InfoService->searchFolder(Object(OC\Files\Node\Folder), 2)\n#11 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\GalleryPlus\Service\InfoService->searchSubFolders(Array, 0, 1)\n#12 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(220): OCA\GalleryPlus\Service\InfoService->searchFolder(Object(OC\Files\Node\Folder), 1)\n#13 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(178): OCA\GalleryPlus\Service\InfoService->searchSubFolders(Array, 0, 0)\n#14 \/var\/www\/owncloud\/apps\/galleryplus\/service\/infoservice.php(139): OCA\GalleryPlus\Service\InfoService->searchFolder(Object(OC\Files\Node\Folder))\n#15 \/var\/www\/owncloud\/apps\/galleryplus\/controller\/servicecontroller.php(169): OCA\GalleryPlus\Service\InfoService->getImages(Array)\n#16 [internal function]: OCA\GalleryPlus\Controller\ServiceController->getImages()\n#17 \/var\/www\/owncloud\/lib\/private\/appframework\/http\/dispatcher.php(158): call_user_func_array(Array, Array)\n#18 \/var\/www\/owncloud\/lib\/private\/appframework\/http\/dispatcher.php(86): OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\GalleryPlus\Controller\ServiceController), 'getImages')\n#19 \/var\/www\/owncloud\/lib\/private\/appframework\/app.php(97): OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\GalleryPlus\Controller\ServiceController), 'getImages')\n#20 \/var\/www\/owncloud\/lib\/private\/appframework\/routing\/routeactionhandler.php(44): OC\AppFramework\App::main('ServiceControll...', 'getImages', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)\n#21 [internal function]: OC\AppFramework\routing\RouteActionHandler->__invoke(Array)\n#22 \/var\/www\/owncloud\/lib\/private\/route\/router.php(250): call_user_func(Object(OC\AppFramework\routing\RouteActionHandler), Array)\n#23 \/var\/www\/owncloud\/lib\/base.php(767): OC\Route\Router->match('\/apps\/gallerypl...')\n#24 \/var\/www\/owncloud\/index.php(36): OC::handleRequest()\n#25 {main}","File":"\/var\/www\/owncloud\/lib\/private\/files\/node\/node.php","Line":65}","level":4,"time":"2015-03-07T19:34:11-03:00"}

@oparoz
Copy link
Contributor Author

oparoz commented Mar 7, 2015

@jsalatiel - Yes, it's the goal to make this the official app, see this: #151 . The main problem is that this has started as a rewrite to support the AppFramework, on top of which I've added full media support, tons of code documentation and all the PRs. Now, I've made some changes, like the ones to improve performance, but it doesn't get properly reviewed, so I hope this is added quickly to ownCloud so that the people behind the original app can help with the code and the decision making. This has to be maintainable for a long time, by anybody.

As for whether this can handle a large amount of pictures, it should, at least at the top levels. I need to push one change for the preloading routine to try and make it work for more people, at the cost of making more HTTP requests. See this for the full programme: #43

@jsalatiel
Copy link

My girl can enter the gallery+ by entering in the correct folder in file, and clicking the 'tile' icon, but if from there she tries to go up to the top level dir, she gets '"No pictures found! If you upload pictures in the files app, they will be displayed here."'

@oparoz
Copy link
Contributor Author

oparoz commented Mar 7, 2015

Could you open a separate ticket for that? I think it might be an encoding issue (folders with unusual characters)

@jsalatiel
Copy link

done. #69

@oparoz oparoz removed the QA-testing label Jul 13, 2015
butonic added a commit that referenced this issue Jul 25, 2015
…e_loading_error

use notification to show template loading error, refs #1282
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

4 participants