Don't generate direct download links when PreviewLink is checked

See issue: https://github.com/ShareX/ShareX/issues/3868
Not adding either /preview or /download to URL generates links that show a preview of a file. /preview only works for images (showing literally only the image in the browser). This change makes sure the logic is right.

Note: The logic is right so it should work. But I'm not sure if the syntax is right.
This commit is contained in:
Quint van Dijk 2019-01-08 23:24:54 +01:00 committed by GitHub
parent 407c644f1f
commit 087b6118fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,7 +183,7 @@ public string ShareFile(string path)
string link = data.url;
if (PreviewLink)
{
link += Helpers.IsImageFile(path) ? "/preview" : "/download";
link += Helpers.IsImageFile(path) ? "/preview" : (IsCompatibility81 ? "/" : "&") + "download";
}
else if (DirectLink)
{
@ -226,4 +226,4 @@ public class OwnCloudShareResponseData
public string token { get; set; }
}
}
}
}