urgent: fix day backref

old-stable24
Varun Patil 2022-10-23 11:53:00 -07:00
parent 0c5a093998
commit 6827a60277
2 changed files with 11 additions and 11 deletions

View File

@ -796,16 +796,15 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
this.loadedDays.add(dayId);
this.sizedDays.add(dayId);
// Filter out items we don't want to show at all
// Note: flags are not converted yet
if (!this.config_showHidden) {
// Hidden folders
data = data.filter((p) => !(p.isfolder && (<IFolder>p).name.startsWith('.')));
}
// Convert server flags to bitflags
data.forEach(utils.convertFlags);
// Filter out items we don't want to show at all
if (!this.config_showHidden) {
// Hidden folders
data = data.filter((p) => !((p.flag & this.c.FLAG_IS_FOLDER) && (<IFolder>p).name.startsWith('.')));
}
// Set and make reactive
day.count = data.length;
day.detail = data;
@ -895,10 +894,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
// Add the photo to the row
const photo = data[dataIdx];
if (typeof photo.flag === "undefined") {
photo.flag = 0; // flags
photo.d = day; // backref to day
}
photo.d = day; // backref to day
// Get aspect ratio
const setPos = () => {

View File

@ -149,6 +149,10 @@ export function randomSubarray(arr: any[], size: number) {
* @param photo Photo to process
*/
export function convertFlags(photo: IPhoto) {
if (typeof photo.flag === "undefined") {
photo.flag = 0; // flags
}
if (photo.isvideo) {
photo.flag |= constants.c.FLAG_IS_VIDEO;
delete photo.isvideo;