add device upload options

This commit is contained in:
Luke Pulverenti
2014-10-11 16:38:13 -04:00
parent 2486cffa71
commit f3539686bd
50 changed files with 1030 additions and 209 deletions

View File

@@ -1,5 +1,6 @@
using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Devices;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
@@ -793,17 +794,23 @@ namespace MediaBrowser.Model.ApiClient
/// <value>The type of the client.</value>
string ClientName { get; set; }
/// <summary>
/// Gets the device.
/// </summary>
/// <value>The device.</value>
IDevice Device { get; }
/// <summary>
/// Gets or sets the name of the device.
/// </summary>
/// <value>The name of the device.</value>
string DeviceName { get; set; }
string DeviceName { get; }
/// <summary>
/// Gets or sets the device id.
/// </summary>
/// <value>The device id.</value>
string DeviceId { get; set; }
string DeviceId { get; }
/// <summary>
/// Gets or sets the current user id.
@@ -1319,5 +1326,29 @@ namespace MediaBrowser.Model.ApiClient
/// <returns>Task.</returns>
Task SendContextMessageAsync(string itemType, string itemId, string itemName, string context,
CancellationToken cancellationToken);
/// <summary>
/// Gets the content upload history.
/// </summary>
/// <param name="deviceId">The device identifier.</param>
/// <returns>Task&lt;ContentUploadHistory&gt;.</returns>
Task<ContentUploadHistory> GetContentUploadHistory(string deviceId);
/// <summary>
/// Uploads the file.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="file">The file.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task UploadFile(Stream stream,
LocalFileInfo file,
CancellationToken cancellationToken);
/// <summary>
/// Gets the devices options options.
/// </summary>
/// <returns>Task&lt;DevicesOptions&gt;.</returns>
Task<DevicesOptions> GetDevicesOptions();
}
}

View File

@@ -0,0 +1,44 @@
using MediaBrowser.Model.Devices;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Model.ApiClient
{
public interface IDevice
{
/// <summary>
/// Occurs when [resume from sleep].
/// </summary>
event EventHandler<EventArgs> ResumeFromSleep;
/// <summary>
/// Gets the name of the device.
/// </summary>
/// <value>The name of the device.</value>
string DeviceName { get; }
/// <summary>
/// Gets the device identifier.
/// </summary>
/// <value>The device identifier.</value>
string DeviceId { get; }
/// <summary>
/// Gets the local images.
/// </summary>
/// <returns>IEnumerable&lt;LocalFileInfo&gt;.</returns>
IEnumerable<LocalFileInfo> GetLocalPhotos();
/// <summary>
/// Gets the local videos.
/// </summary>
/// <returns>IEnumerable&lt;LocalFileInfo&gt;.</returns>
IEnumerable<LocalFileInfo> GetLocalVideos();
/// <summary>
/// Uploads the file.
/// </summary>
/// <param name="file">The file.</param>
/// <param name="apiClient">The API client.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task UploadFile(LocalFileInfo file, IApiClient apiClient, CancellationToken cancellationToken);
}
}