-
Notifications
You must be signed in to change notification settings - Fork 234
Description
Note: Please always try reproducing the issue on the :edge
build. There is a chance that it was already fixed. If it's an UI issue, you can try reporducing it on the demo page.
Describe the bug
This issue happens when I was testing the release of V2.0.0 ( commit 4dc431f ). In the Gallery, if we set the sorting order to "By date - descending", the order of directory will be incorrect after indexing a folder.
To reproduce the issue:
- Create a folder called
test
under Gallery - Prepare two folders in a tmp folder with the following structure:
> tree ./tmp
.
├── new
│ └── new_in
│ └── new.PNG # can be a random picture
└── old
└── old_in
└── old.PNG # can be a random picture
- Move the
old
folder intotest
folder, wait for 1 min - Move the
new
folder intotest
folder - Goto the Gallery page of
test
, set the sorting order to "By date - descending" - Now inside the
test
gallery, the order of the folders should be correct (new
is in front ofold
, meaningnew
is newer ). Both folder have no cover since the folder is not indexed. - Now click the
new
folder so the folder will be indexed. - Go back to
test
Gallery and refresh the page. We'll notice that thenew
folder will be move behind theold
folder, which is incorrect since thenew
folder should be the first folder in the gallery.
The above is just a simple example to demonstrate the issue. In my case ( a Gallery with lots of folder ), this issue messed up the order of lots of folder -- most of them will be "shifted" to the last order ( meaning pigallery2 think it's the oldest even though it's not ) after being indexed.
As for expected behavior: the order of the folders should follow the result of the ls -lt
command. For example, if the result is:
new # latest
|
v
...
old # oldest
Then the order of the folders in Gallery should be:
new ->... old
Photo/video (optional) that causes the bug
N/A
Screenshots (optional)
N/A
Server logs (optional)
N/A
Environment (please complete the following information):
- OS: Server runs on Linux, browser on Windows.
- Browser: Brave
Used app version:
Using the docker image from here.
Version: V2.0.0
Commit: 4dc431f