mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-25 08:24:43 +01:00
Fix cover not displaying for NcAlbum if the file is shared
This commit is contained in:
parent
4762ad02bd
commit
6b3600625b
2 changed files with 11 additions and 2 deletions
|
@ -81,6 +81,16 @@ String getFilePreviewUrlByFileId(
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return the preview image URL for [fileId], using the new Photos API in
|
||||||
|
/// Nextcloud 25
|
||||||
|
String getPhotosApiFilePreviewUrlByFileId(
|
||||||
|
Account account,
|
||||||
|
int fileId, {
|
||||||
|
required int width,
|
||||||
|
required int height,
|
||||||
|
}) =>
|
||||||
|
"${account.url}/apps/photos/api/v1/preview/$fileId?x=$width&y=$height";
|
||||||
|
|
||||||
String getFileUrl(Account account, FileDescriptor file) {
|
String getFileUrl(Account account, FileDescriptor file) {
|
||||||
return "${account.url}/${getFileUrlRelative(file)}";
|
return "${account.url}/${getFileUrlRelative(file)}";
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,12 +64,11 @@ class CollectionNcAlbumProvider
|
||||||
if (album.lastPhoto == null) {
|
if (album.lastPhoto == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return api_util.getFilePreviewUrlByFileId(
|
return api_util.getPhotosApiFilePreviewUrlByFileId(
|
||||||
account,
|
account,
|
||||||
album.lastPhoto!,
|
album.lastPhoto!,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
isKeepAspectRatio: isKeepAspectRatio ?? false,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue