FossifyOrg / Gallery

Browse your memories without any interruptions with this photo and video gallery
https://www.fossify.org
GNU General Public License v3.0
1.34k stars 41 forks source link

Nested folder view: some folders are incorrectly shown at top level #150

Open ErdlingProductions opened 4 months ago

ErdlingProductions commented 4 months ago

Checklist

Affected app version

1.1.1

Affected Android/Custom ROM version

Android 12 / Stock Firmware

Affected device model

Samsung Galaxy Note 10+ (Exynos)

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

  1. In the top bar, set to folder view
  2. Under settings/view, activate "Group direct subfolders"
  3. Navigate to the top level of the directory tree

Expected behavior

At the top level, either the single toplevel folder should be seen (storage/emulated/0/) or the contents thereof.

Actual behavior

This is my file structure, I highlighted the folders, that are shown at the top level of the gallery (4 + 1 total).

└── storage
    └── emulated
        └── 0
            ├── Android
            │   └── media
            │       └── com.whatsapp
            │           └── WhatsApp
            │               └── Media
            │                   └── WhatsApp Video - SHOWN AT TOP LEVEL
            ├── DCIM
            │   └── several_folders_with_photos_and_videos
            ├── Documents
            │   ├── folder_with_photos_and_videos - SHOWN AT TOP LEVEL
            │   └── folder_with_videos - SHOWN AT TOP LEVEL
            │       ├── videos_1
            │       └── videos_2
            │           └── 15-more-folders-with-videos
            ├── Download
            │   ├── folder_with_pictures_1
            │   └── folder_with_pictures_2
            └── Pictures
                └── Whatsapp - SHOWN AT TOP LEVEL

Additionally to the highlighted folders that are shown, the folder Internal with the path /storage/emulated/ is shown, which contains the folders that are in storage/emulated/0/, in this case DCIM and Download. Maybe the folder 0 is represented as Internal? The folders that are incorrectly shown at the top level do not reoccur in the Internal folder. Note that Documents is not shown in Internal even though only its sub folders are shown at the top level.

I am not sure what's going on here. In my understanding, the top level of the gallery should either be the folder storage/emulated/0 or the contents thereof.

I am happy to provide further information, please request if necessary.

Best regards!

Edit: I moved the two folders in Documents into DCIM. The folder without subfolders is now no longer visible in the top level. However the folder with subfolders is still visible at the top level.

Hargan2 commented 3 months ago

I think the issue I was about to report is related to this, hopefully the following information is useful: Folders that have no media, which contain a subfolder that also has no media, which contains another subfolder that does have media, results in only the subfolder(s) with media getting displayed at top level.

For example, on my S21 Ultra I have a folder tree that looks like this:

storage/emulated/0/photos/ ├─ Subfolder A/ │ ├─ Subfolder A1/ │ │ ├─ media │ ├─ Subfolder A2/ │ │ ├─ media │ ├─ Subfolder A3/ │ │ ├─ media

Subfolders A1, A2, and A3 all display at the top level, bypassing the "photos" and "Subfolder A" folders entirely, resulting in a disorganised mess where all albums are displayed instead of being neatly placed in one folder with subfolders. Placing all media in subfolder A does fix this, allowing for the "photos" album to show up with "subfolder A" as the direct subfolder but that defeats the point. It seems like the app only checks for literal direct subfolders, going exactly one folder deep, and if it doesn't find any media, it sort of skips until it does and displays the folders with media at the top level regardless of how far down the folder tree they are.