Skip to content

Commit

Permalink
Merge branch 'master' into pulsejet/ncvue8
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Mar 19, 2024
2 parents 8b51d6d + 4f1f7d6 commit ce1dbb5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/components/frame/Cluster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ export default defineComponent({
photo: {
fileid: fileid,
etag: etag.toString(),
flag: 0,
dayid: 0,
},
} as IPhoto,
sqsize: 512,
});
Expand Down
29 changes: 21 additions & 8 deletions src/components/modal/AlbumsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@click="click($event, album)"
>
<template #icon>
<XImg v-if="album.last_added_photo !== -1" class="album__image" :src="toCoverUrl(album)" />
<XImg v-if="toCoverUrl(album)" class="album__image" :src="toCoverUrl(album)" />
<div v-else class="album__image album__image--placeholder">
<ImageMultipleIcon :size="32" />
</div>
Expand Down Expand Up @@ -84,13 +84,26 @@ export default defineComponent({
};
},
toCoverUrl(album: IAlbum) {
return utils.getPreviewUrl({
photo: {
fileid: Number(album.last_added_photo),
} as IPhoto,
sqsize: 256,
});
toCoverUrl(album: IAlbum): string | null {
// See Cluster.vue for the original implementation
const preview = (fileid: number, etag: string | number) =>
utils.getPreviewUrl({
photo: {
fileid: fileid,
etag: etag.toString(),
} as IPhoto,
sqsize: 512,
});
if (album.cover && album.cover_etag) {
return preview(album.cover, album.cover_etag);
}
if (album.last_added_photo && album.last_added_photo !== -1) {
return preview(album.last_added_photo, album.last_added_photo_etag ?? album.album_id);
}
return null;
},
getSubtitle(album: IAlbum) {
Expand Down

0 comments on commit ce1dbb5

Please sign in to comment.