mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-22 23:19:21 +01:00
Use file id to get preview if available
This commit is contained in:
parent
ff091d495d
commit
c4b53983fa
1 changed files with 8 additions and 2 deletions
|
@ -29,8 +29,14 @@ String getFilePreviewUrlRelative(
|
||||||
String mode,
|
String mode,
|
||||||
bool a,
|
bool a,
|
||||||
}) {
|
}) {
|
||||||
|
String url;
|
||||||
|
if (file.fileId != null) {
|
||||||
|
url = "index.php/core/preview?fileId=${file.fileId}";
|
||||||
|
} else {
|
||||||
final filePath = Uri.encodeQueryComponent(file.strippedPath);
|
final filePath = Uri.encodeQueryComponent(file.strippedPath);
|
||||||
var url = "index.php/core/preview.png?file=$filePath&x=$width&y=$height";
|
url = "index.php/core/preview.png?file=$filePath";
|
||||||
|
}
|
||||||
|
url = "$url&x=$width&y=$height";
|
||||||
if (mode != null) {
|
if (mode != null) {
|
||||||
url = "$url&mode=$mode";
|
url = "$url&mode=$mode";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue