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 into test folder, wait for 1 min
- Move the
new folder into test 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 of old, meaning new 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 the new folder will be move behind the old folder, which is incorrect since the new 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:
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
Note: Please always try reproducing the issue on the
:edgebuild. 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:
testunder Galleryoldfolder intotestfolder, wait for 1 minnewfolder intotestfoldertest, set the sorting order to "By date - descending"testgallery, the order of the folders should be correct (newis in front ofold, meaningnewis newer ). Both folder have no cover since the folder is not indexed.newfolder so the folder will be indexed.testGallery and refresh the page. We'll notice that thenewfolder will be move behind theoldfolder, which is incorrect since thenewfolder 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 -ltcommand. For example, if the result is:Then the order of the folders in Gallery should be:
Photo/video (optional) that causes the bug
N/A
Screenshots (optional)
N/A
Server logs (optional)
N/A
Environment (please complete the following information):
Used app version:
Using the docker image from here.
Version: V2.0.0
Commit: 4dc431f