mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-26 08:54:42 +01:00
Fix file preview url
This commit is contained in:
parent
afa143cf10
commit
6dc0f62d23
1 changed files with 13 additions and 12 deletions
|
@ -42,24 +42,25 @@ String getFilePreviewUrlRelative(
|
|||
required bool isKeepAspectRatio,
|
||||
}) {
|
||||
String url;
|
||||
if (file_util.isTrash(account, file)) {
|
||||
// trashbin does not support preview.png endpoint
|
||||
url = "index.php/apps/files_trashbin/preview?fileId=${file.fdId}";
|
||||
} else if (file_util.isNcAlbumFile(account, file)) {
|
||||
if (file_util.isNcAlbumFile(account, file)) {
|
||||
// We can't use the generic file preview url because collaborative albums do
|
||||
// not create a file share for photos not belonging to you, that means you
|
||||
// can only access the file view the Photos API
|
||||
url = "apps/photos/api/v1/preview/${file.fdId}?x=$width&y=$height";
|
||||
} else {
|
||||
url = "index.php/core/preview?fileId=${file.fdId}";
|
||||
if (file_util.isTrash(account, file)) {
|
||||
// trashbin does not support preview.png endpoint
|
||||
url = "index.php/apps/files_trashbin/preview?fileId=${file.fdId}";
|
||||
} else {
|
||||
url = "index.php/core/preview?fileId=${file.fdId}";
|
||||
}
|
||||
url = "$url&x=$width&y=$height";
|
||||
if (mode != null) {
|
||||
url = "$url&mode=$mode";
|
||||
}
|
||||
// keep this here to use cache from older version
|
||||
url = "$url&a=${isKeepAspectRatio ? 1 : 0}";
|
||||
}
|
||||
|
||||
url = "$url&x=$width&y=$height";
|
||||
if (mode != null) {
|
||||
url = "$url&mode=$mode";
|
||||
}
|
||||
// keep this here to use cache from older version
|
||||
url = "$url&a=${isKeepAspectRatio ? 1 : 0}";
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue