uploads: enable multi-file uploads when uploading from source.
Make the upload page automatically detect when a source URL has multiple images and let the user choose which images to post. For example, when uploading a Twitter or Pixiv post with more than one image, we direct the user to a page showing a thumbnail for each image and letting them choose which ones to post. This is similar to the batch upload page, except we actually download each image in the background, instead of just hotlinking or proxying the thumbnails through our servers. This avoids various problems with proxying and makes new features possible, like showing which images in the batch have already been posted.
This commit is contained in:
@@ -96,12 +96,12 @@ export default class FileUploadComponent {
|
||||
this.$component.find("progress").removeClass("hidden");
|
||||
this.$component.find("input").attr("disabled", "disabled");
|
||||
|
||||
while (upload.status === "pending" || upload.status === "processing") {
|
||||
while (upload.media_asset_count <= 1 && upload.status !== "completed" && upload.status !== "error") {
|
||||
await Utility.delay(500);
|
||||
upload = await $.get(`/uploads/${upload.id}.json`);
|
||||
}
|
||||
|
||||
if (upload.status === "completed") {
|
||||
if (upload.media_asset_count > 0) {
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
let isBookmarklet = params.has("url");
|
||||
params.delete("url");
|
||||
|
||||
Reference in New Issue
Block a user