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

Allow to browse the folder tree #142

Closed
atenart opened this issue Jan 21, 2020 · 21 comments · Fixed by #212
Closed

Allow to browse the folder tree #142

atenart opened this issue Jan 21, 2020 · 21 comments · Fixed by #212
Labels
3. to review Waiting for reviews discussion Being discussed enhancement New feature or request

Comments

@atenart
Copy link

atenart commented Jan 21, 2020

Hello,

I think we could benefit from having an option (like adding a category on the left) to allow users to browse their photos directly using the folder tree of their data. I understand having an intelligent sorting and abstracting the actual locations of photos is nice for some, but there are cases were accessing the real files tree is more usable; for example when having a shared directory between nextcloud and other apps, which is manually or automatically sorted by year / month… In such case I end up with far too many albums, of which many are named the same: it's difficult to know which one I should open, and it's also not easy to find the album in the (huge) list.

One other option could be to allow to launch the photo app from a directory in the files browsing.

Thanks!

@skjnldsv skjnldsv added 0. Needs triage Pending approval or rejection. This issue is pending approval. enhancement New feature or request labels Jan 21, 2020
@skjnldsv
Copy link
Member

@jancborchardt thoughts?

@jancborchardt
Copy link
Member

One other option could be to allow to launch the photo app from a directory in the files browsing.

This cross-linking is key – that way we don’t have to duplicate stuff. In the 3-dot menu next to the title / share icon in the Albums view, we could have an entry saying "Open in Files".

@nemihome
Copy link

It does not make sense to show folder names without a chance to rename them or showing the tree in album view. In my case I have a hierarchy like
year - destination (first folder level) and then in every folder 3 subfolders gpx / info / pictures. That results on every folder has the name in the photos app because they are all subfolders with the same name That does not help and a tree view or a chance to use tag view where I can tag the folders would help a lot.

@adi2k5
Copy link

adi2k5 commented Jan 28, 2020

There definitely should be an option to browse gallery with folder tree like it was in old Gallery. I just migrated to NC18, and realized, that browsing my albums now is a tragedy. I have several hudred of photo folders from last over 15 years, and on top of that, new Gallery, beside all folders with photos, picked also another several dozen of folders from other folders than my photos (mostly folders with some icons etc). This way, when I'm going now to Album view, I'm immediately killing my browser tab at least for several minutes, sometimes killing it completely. This is happening most likely because of generating previews, even with preview generator enabled, From last ~10 tries to view any albums, only two ended up with success after waiting several minutes, for others I had to restart tab (firefox) or whole tab group with nextcloud (vivaldi) as they simply crashed. Thus option to browse folder structure and include/exclude locations proposed in some other thread would be really very welcomed for bigger galleries like mine (almost 2 TB of photos).

@skjnldsv
Copy link
Member

with folder tree like it was in old Gallery

was it though? I don't think you could, you were only able to browse folders that had images, and this is what we do :)

@adi2k5
Copy link

adi2k5 commented Jan 28, 2020

Well, I wouldn't say it anyhow compares with the old behaviour. In old one, the structure of browsing folders was following:

/root_folder
   |_Photos
       |_2010
       |      |_Album1
       |      |       |_SomeOtherFolderBelow_Album1
       |      |...
       |      |_AlbumN
       |_2011
       |      |_Album1
       |      |...
       |      |_AlbumN
       | ...
       |_2020
             |_Album1
             |...
             |_AlbumN

Righ now, when I'm going to Photos I have this:

/root_foder
    |_Photos
    |      |_Album1
    |      |_Album2
    |      |...
    |      |_AlbumN
    |_Folder_with_icons1
    |_Folder_with_icons2
    | ...
    |_Folder_N

which would be fine if I would have some tens of folders, but not in case of having 1200+ folders with photos (not counting the ones that are not real folders with photos, but only with some icons and so on!). With that amount of folders, browsing anything is really pain in a*** (and as wrote above - for me crashing more often than not). From that perspective, it was much better to allow to go through each level of folders (even if it could be changed by toggle switch in settings), instead of putting all of them into one single huge, I'd say, mess (although sorted mess! ;) ). With the latter, gallery for me become pretty unusable for now due to this loading issue.

Edit. Sorry, my bad. It indeed allows to somehow browse the photos, but all folders below level 2 are put into one folder into 'Photos', without possibility to go through each year, as well as all folders with any image from /root_folder are put into main Album view (fixed graphs above to reflect that), which generally makes browsing pretty hard for me anyway.

@skjnldsv
Copy link
Member

Ah, so it was bundling the folders that contained multiple folders with photos even if the said folder did not had any photo in it?

@adi2k5
Copy link

adi2k5 commented Jan 28, 2020

No, maybe I choosed wrong words, but I didn't meant to say that they don't contain any photo - they do, but they do contain photos that shouldn't be shown in gallery, look at the screenshot below:

albums.jpg

There is one folder with photos (Fotki) that indeed contain my all photos, and rest of folders are taken from some game installation files. There are much more, from game saves, other apps, and so on, which I haven't saw in old gallery. I don't recall now, but maybe old gallery has had an option to pick default location for photos and that's why it was much better in my case. And that is why I wrote previously that include/exclude option would be nice to have (or possibility to choose photos location).

Second thing is, that when I'm going now to my main photo folder (Fotki) - I have all albums below that folder thrown into that single folder, while real folder structure is Photos, then subfolder named with year, and below year are albums from that given year. And for 1200+ albums in single folder, it's really problematic to view the gallery (even if it would not freeze the browser most of the time). To solve this, it would be good to either have possibility to go through whole folder structure (but then 'Albums' category would probaly loose it's sense), or there could be different category created in the left panel named "Folders" that would allow to browse whole folder structure as in previous gallery.
I hope now it's more clear :)

@skjnldsv
Copy link
Member

or there could be different category created in the left panel named "Folders" that would allow to browse whole folder structure as in previous gallery.

This is basically the files app, so we would indeed lose the concept of the gallery.

What I don't understand (sorry again, I really want to get your issue 😉), is how is that different from how the gallery was working.
The gallery was only displaying the folders who contained photos in it.
And this is exactly what we're doing, right?

So we're only talking about how to improve the photos app, not how we regressed from the gallery app?

@adi2k5
Copy link

adi2k5 commented Jan 28, 2020

Well, as i wrote above, old behaviour was, that when I went to Gallery, to view photos from a single album I had to go through folders: Photos (main folder) → YearXXXX → Album. That is how I have my Photos sorted on the disk, that is how it was in old Gallery. So in any time, under single folder there were not more than a hundred of subfolders.
In current Gallery, there's no 'Year'. After going to main folder Photos, I don't have as next level 'Year' subfolders, but I'm seeing every subfolders from all years in that main folder 'Photos'. In my case of 1200+ folders this is causing browsers (firefox and vivaldi) to hang. Which implies that I can't browse my photos, and that obviously is a regression.

What I observed just now is, that through browser address bar, I can go to folder with specific year (ie. h**ps://my.cloud/index.php/apps/photos/albums/Photos/Year2019), but then all folders and their subfolders from that year are shown in that main folder. Ie, I'm going to folder named Year2019. Under that folder I have subfolders Album1, Album2 and Album3. Album3 has it's own subfolders - Subfolder1 and Subfolder2, which should be visible only after going into Album3 folder. But they are visible from the very main folder 'Year2019', which causes mess. So now it seems more like some bug in gallery logic, that puts all folders with their subfolders into main folder instead of keeping folder structure.

@skjnldsv
Copy link
Member

In current Gallery, there's no 'Year'. After going to main folder Photos, I don't have as next level 'Year' subfolders, but I'm seeing every subfolders from all years in that main folder 'Photos'. In my case of 1200+ folders this is causing browsers (firefox and vivaldi) to hang. Which implies that I can't browse my photos, and that obviously is a regression.

Ah, I get it now, we indeed shorten all the middle Folders if they don't contain photos, while the gallery was only doing the first root->folder shortcut, then left all the inbetween folders.

Let's add a filter-out function like #141 and see from there :)
Also, some relevant reading #74

@BenBenna
Copy link

well @adi2k5 , you should probably not use the Photo app at all, but the File app view instead. This is allmost precisely what you are looking for. Sorry for interfering in this discussion, but I'm following the exchange of ideas closely, as many of the new features in Photo are indeed very surprising.
But - the Photo app needs to honor the .noimage tag/file!!

@skjnldsv
Copy link
Member

the Photo app needs to honor the .noimage tag/file!!

this have been integrated here: #159 and will be here on the next upcoming version ;)

@ArnaudD-FR
Copy link

I'm migrating to nextcloud 18 and switching to "photos" change a lot of things... As many ones, all my photos are sorted by folders and sub folders like years --> months --> events --> places.

When going to "your albums" it is just killing my web browser by creating preview for each sub folder and doing do it kills also the initial tree sort by mixing everything together...

So for the moment, to respect my tree layout I've updated AlbumsController::scanCurrentFolder and replaced

yield from $this->scanFolder($node, 0, $shared);

by

yield $node;

Complete function:

private function scanCurrentFolder(Folder $folder, bool $shared): iterable  {
    $nodes = $folder->getDirectoryListing();

    // add current folder to iterable set
    yield $folder;

    foreach ($nodes as $node) {
        if ($node instanceof Folder) {
            yield $node;
            // yield from $this->scanFolder($node, 0, $shared);
        } elseif ($node instanceof File) {
            if ($this->validFile($node, $shared)) {
                yield $node;
            }
        }
    }
}

So adding an option to respect a tree layout could be a good point!

@skjnldsv
Copy link
Member

@ArnaudD-FR could you provide a pull request for this fix? :)

@ArnaudD-FR
Copy link

@skjnldsv,

My fix does not include an option to switch from tree to flat layout. Pushing this will force tree layout, is it OK?

I've also an issue, maybe this is not an issue. When a folder contains only sub folders then no photo preview is shown in "folder" image.

@skjnldsv
Copy link
Member

It should still only display the folders that contains images, right?
You just removed the part where the script discard folders not directly containing pictures?

@ArnaudD-FR
Copy link

ArnaudD-FR commented Feb 24, 2020

My patch displays folders that contains images or sub folders, respecting tree layout, even if sub folders does not include images.

My point was about adding image's previews in folder "icon"

@skjnldsv
Copy link
Member

even if sub folders does not include images.

No, this would just be a files app clone :p
The goal is to display the root folders if they have at least one image in them or a inside folder

@skjnldsv
Copy link
Member

Kind of duplicate of #197
Fixed by #212

@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. labels Feb 28, 2020
@skjnldsv skjnldsv linked a pull request Feb 28, 2020 that will close this issue
@jospoortvliet
Copy link
Member

FYI, we are trying to fix this and other regressions asap. This was an oversight we just didn't catch - sorry for that, lucky news is that you can get involved in testing to help avoid these issues next time!

See https://help.nextcloud.com/t/new-photo-app-in-nextcloud-18/69949/32 for a more complete response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews discussion Being discussed enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants