mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
support multi-form data for camera upload
This commit is contained in:
parent
b0fffc9249
commit
63b62e5f40
@ -1,4 +1,6 @@
|
||||
using MediaBrowser.Controller.Devices;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Controller.Devices;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using MediaBrowser.Model.Devices;
|
||||
using MediaBrowser.Model.Querying;
|
||||
@ -128,6 +130,8 @@ namespace MediaBrowser.Api.Devices
|
||||
var id = Request.QueryString["Id"];
|
||||
var name = Request.QueryString["Name"];
|
||||
|
||||
if (Request.ContentType.IndexOf("multi", StringComparison.OrdinalIgnoreCase) == -1)
|
||||
{
|
||||
var task = _deviceManager.AcceptCameraUpload(deviceId, request.RequestStream, new LocalFileInfo
|
||||
{
|
||||
MimeType = Request.ContentType,
|
||||
@ -138,5 +142,20 @@ namespace MediaBrowser.Api.Devices
|
||||
|
||||
Task.WaitAll(task);
|
||||
}
|
||||
else
|
||||
{
|
||||
var file = Request.Files.First();
|
||||
|
||||
var task = _deviceManager.AcceptCameraUpload(deviceId, file.InputStream, new LocalFileInfo
|
||||
{
|
||||
MimeType = file.ContentType,
|
||||
Album = album,
|
||||
Name = name,
|
||||
Id = id
|
||||
});
|
||||
|
||||
Task.WaitAll(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user