1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2026-05-16 09:21:12 +02:00

Improve missing cache handling

This commit is contained in:
Patrik J. Braun
2025-12-29 16:51:16 +01:00
parent c930e399f6
commit 9f041345e8
3 changed files with 3 additions and 3 deletions
@@ -16,7 +16,7 @@
<!--Info box -->
<div class="info rounded-bottom">
{{album.name}} ({{album.cache.itemCount}})
{{album.name}} ({{album.cache?.itemCount}})
<ng-icon *ngIf="CanUpdate && !album.locked"
(click)="deleteAlbum($event)"
class="info-button delete float-end"
@@ -62,7 +62,7 @@ export class AlbumComponent implements OnInit, OnDestroy {
ngOnInit(): void {
if (this.album?.cache?.cover) {
this.thumbnail = this.thumbnailService.getThumbnail(
new Media(this.album.cache.cover, this.size, this.size)
new Media(this.album.cache?.cover, this.size, this.size)
);
}
}
@@ -263,7 +263,7 @@ export class GallerySortingService {
Config.Gallery.enableDirectorySortingByDate === true
) {
c.directories.sort(
(a, b) => (a.cache.oldestMedia || a.lastModified) - (b.cache.oldestMedia || b.lastModified)
(a, b) => (a.cache?.oldestMedia || a.lastModified) - (b.cache?.oldestMedia || b.lastModified)
);
break;
}