mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +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 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) {
|
||||
return "${account.url}/${getFileUrlRelative(file)}";
|
||||
}
|
||||
|
|
|
@ -64,12 +64,11 @@ class CollectionNcAlbumProvider
|
|||
if (album.lastPhoto == null) {
|
||||
return null;
|
||||
} else {
|
||||
return api_util.getFilePreviewUrlByFileId(
|
||||
return api_util.getPhotosApiFilePreviewUrlByFileId(
|
||||
account,
|
||||
album.lastPhoto!,
|
||||
width: width,
|
||||
height: height,
|
||||
isKeepAspectRatio: isKeepAspectRatio ?? false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue