Merge pull request #2806 from MediaBrowser/dev

update download error handling
This commit is contained in:
Luke 2017-08-11 17:56:12 -04:00 committed by GitHub
commit 3237fd9e5e
36 changed files with 23 additions and 2469 deletions

View File

@ -212,7 +212,6 @@ namespace Emby.Server.Implementations
internal IUserViewManager UserViewManager { get; set; }
private IAuthenticationRepository AuthenticationRepository { get; set; }
private ISyncRepository SyncRepository { get; set; }
private ITVSeriesManager TVSeriesManager { get; set; }
private ICollectionManager CollectionManager { get; set; }
private IMediaSourceManager MediaSourceManager { get; set; }

View File

@ -1263,7 +1263,7 @@ namespace Emby.Server.Implementations.Dto
var hasSpecialFeatures = item as IHasSpecialFeatures;
if (hasSpecialFeatures != null)
{
var specialFeatureCount = hasSpecialFeatures.SpecialFeatureIds.Count;
var specialFeatureCount = hasSpecialFeatures.SpecialFeatureIds.Length;
if (specialFeatureCount > 0)
{

View File

@ -2610,7 +2610,7 @@ namespace Emby.Server.Implementations.Library
return video;
// Sort them so that the list can be easily compared for changes
}).OrderBy(i => i.Path).ToList();
}).OrderBy(i => i.Path);
}
private static readonly string[] ExtrasSubfolderNames = new[] { "extras", "specials", "shorts", "scenes", "featurettes", "behind the scenes", "deleted scenes", "interviews" };
@ -2652,7 +2652,7 @@ namespace Emby.Server.Implementations.Library
return video;
// Sort them so that the list can be easily compared for changes
}).OrderBy(i => i.Path).ToList();
}).OrderBy(i => i.Path);
}
public string GetPathAfterNetworkSubstitution(string path, BaseItem ownerItem)

View File

@ -69,7 +69,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
{
return ResolveVideos<MusicVideo>(parent, files, directoryService, false, collectionType);
return ResolveVideos<MusicVideo>(parent, files, directoryService, true, collectionType);
}
if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase) ||

View File

@ -207,9 +207,12 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
inputModifier += " -fflags " + string.Join("", flags.ToArray());
}
if (!string.IsNullOrWhiteSpace(GetEncodingOptions().HardwareAccelerationType))
var videoStream = mediaSource.VideoStream;
var videoDecoder = videoStream == null ? null : new EncodingHelper(_mediaEncoder, _fileSystem, null).GetVideoDecoder(VideoType.VideoFile, videoStream, GetEncodingOptions());
if (!string.IsNullOrWhiteSpace(videoDecoder))
{
inputModifier += " -hwaccel auto";
inputModifier += " " + videoDecoder;
}
if (mediaSource.ReadAtNativeFramerate)

View File

@ -613,7 +613,7 @@ namespace MediaBrowser.Api.Reports
HasImageTagsPrimary = item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Primary) > 0,
HasImageTagsBackdrop = item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Backdrop) > 0,
HasImageTagsLogo = item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Logo) > 0,
HasSpecials = hasSpecialFeatures != null ? hasSpecialFeatures.SpecialFeatureIds.Count > 0 : false,
HasSpecials = hasSpecialFeatures != null ? hasSpecialFeatures.SpecialFeatureIds.Length > 0 : false,
HasSubtitles = video != null ? video.HasSubtitles : false,
RowType = ReportHelper.GetRowType(item.GetClientTypeName())
};

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{
@ -9,6 +8,6 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the special feature ids.
/// </summary>
/// <value>The special feature ids.</value>
List<Guid> SpecialFeatureIds { get; set; }
Guid[] SpecialFeatureIds { get; set; }
}
}

View File

@ -19,11 +19,11 @@ namespace MediaBrowser.Controller.Entities.Movies
/// </summary>
public class Movie : Video, IHasSpecialFeatures, IHasTrailers, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping
{
public List<Guid> SpecialFeatureIds { get; set; }
public Guid[] SpecialFeatureIds { get; set; }
public Movie()
{
SpecialFeatureIds = new List<Guid>();
SpecialFeatureIds = EmptyGuidArray;
RemoteTrailers = EmptyMediaUrlArray;
LocalTrailerIds = EmptyGuidArray;
RemoteTrailerIds = EmptyGuidArray;
@ -77,7 +77,7 @@ namespace MediaBrowser.Controller.Entities.Movies
private async Task<bool> RefreshSpecialFeatures(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
{
var newItems = LibraryManager.FindExtras(this, fileSystemChildren, options.DirectoryService).ToList();
var newItemIds = newItems.Select(i => i.Id).ToList();
var newItemIds = newItems.Select(i => i.Id).ToArray();
var itemsChanged = !SpecialFeatureIds.SequenceEqual(newItemIds);

View File

@ -1387,8 +1387,8 @@ namespace MediaBrowser.Controller.Entities
if (movie != null)
{
var ok = filterValue
? movie.SpecialFeatureIds.Count > 0
: movie.SpecialFeatureIds.Count == 0;
? movie.SpecialFeatureIds.Length > 0
: movie.SpecialFeatureIds.Length == 0;
if (!ok)
{

View File

@ -336,7 +336,6 @@
<Compile Include="Sync\ISyncDataProvider.cs" />
<Compile Include="Sync\ISyncManager.cs" />
<Compile Include="Sync\ISyncProvider.cs" />
<Compile Include="Sync\ISyncRepository.cs" />
<Compile Include="Sync\SyncedFileInfo.cs" />
<Compile Include="Sync\SyncedItemProgress.cs" />
<Compile Include="TV\ITVSeriesManager.cs" />

View File

@ -16,6 +16,7 @@ namespace MediaBrowser.Controller.Sync
event EventHandler<GenericEventArgs<SyncJob>> SyncJobUpdated;
event EventHandler<GenericEventArgs<SyncJobItem>> SyncJobItemUpdated;
event EventHandler<GenericEventArgs<SyncJobItem>> SyncJobItemCreated;
event EventHandler<GenericEventArgs<SyncJobItem>> SyncJobItemCancelled;
/// <summary>
/// Creates the job.
@ -134,20 +135,6 @@ namespace MediaBrowser.Controller.Sync
/// <returns>Task&lt;SyncDataResponse&gt;.</returns>
Task<SyncDataResponse> SyncData(SyncDataRequest request);
/// <summary>
/// Marks the job item for removal.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task MarkJobItemForRemoval(string id);
/// <summary>
/// Unmarks the job item for removal.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task UnmarkJobItemForRemoval(string id);
/// <summary>
/// Gets the library item ids.
/// </summary>

View File

@ -1,80 +0,0 @@
using System.Collections.Generic;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Sync;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Sync
{
public interface ISyncRepository
{
/// <summary>
/// Gets the job.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>SyncJob.</returns>
SyncJob GetJob(string id);
/// <summary>
/// Creates the specified job.
/// </summary>
/// <param name="job">The job.</param>
/// <returns>Task.</returns>
Task Create(SyncJob job);
/// <summary>
/// Updates the specified job.
/// </summary>
/// <param name="job">The job.</param>
/// <returns>Task.</returns>
Task Update(SyncJob job);
/// <summary>
/// Deletes the job.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
Task DeleteJob(string id);
/// <summary>
/// Gets the jobs.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;SyncJob&gt;.</returns>
QueryResult<SyncJob> GetJobs(SyncJobQuery query);
/// <summary>
/// Gets the job item.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>SyncJobItem.</returns>
SyncJobItem GetJobItem(string id);
/// <summary>
/// Creates the specified job item.
/// </summary>
/// <param name="jobItem">The job item.</param>
/// <returns>Task.</returns>
Task Create(SyncJobItem jobItem);
/// <summary>
/// Updates the specified job item.
/// </summary>
/// <param name="jobItem">The job item.</param>
/// <returns>Task.</returns>
Task Update(SyncJobItem jobItem);
/// <summary>
/// Gets the job items.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>IEnumerable&lt;SyncJobItem&gt;.</returns>
QueryResult<SyncJobItem> GetJobItems(SyncJobItemQuery query);
/// <summary>
/// Gets the library item ids.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;System.String&gt;.</returns>
Dictionary<string, SyncedItemProgress> GetSyncedItemProgresses(SyncJobItemQuery query);
}
}

View File

@ -1,48 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Sync;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Model.ApiClient
{
/// <summary>
/// Class ApiClientExtensions
/// </summary>
public static class ApiClientExtensions
{
/// <summary>
/// Gets the image stream async.
/// </summary>
/// <param name="apiClient">The API client.</param>
/// <param name="url">The URL.</param>
/// <returns>Task{Stream}.</returns>
public static Task<Stream> GetImageStreamAsync(this IApiClient apiClient, string url)
{
return apiClient.GetImageStreamAsync(url, CancellationToken.None);
}
public static Task<UserDto[]> GetPublicUsersAsync(this IApiClient apiClient)
{
return apiClient.GetPublicUsersAsync(CancellationToken.None);
}
public static Task<ItemsResult> GetItemsAsync(this IApiClient apiClient, ItemQuery query)
{
return apiClient.GetItemsAsync(query, CancellationToken.None);
}
public static Task<SyncDialogOptions> GetSyncOptions(this IApiClient apiClient, SyncJob job)
{
return apiClient.GetSyncOptions(new SyncJobRequest
{
Category = job.Category,
ItemIds = job.RequestedItemIds,
ParentId = job.ParentId,
TargetId = job.TargetId,
UserId = job.UserId
});
}
}
}

View File

@ -1,22 +0,0 @@
using System;
namespace MediaBrowser.Model.ApiClient
{
public static class ApiHelpers
{
/// <summary>
/// Gets the name of the slug.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>System.String.</returns>
public static string GetSlugName(string name)
{
if (string.IsNullOrEmpty(name))
{
throw new ArgumentNullException("name");
}
return name.Replace('/', '-').Replace('?', '-').Replace('&', '-');
}
}
}

View File

@ -1,9 +0,0 @@
namespace MediaBrowser.Model.ApiClient
{
public enum ConnectionMode
{
Local = 1,
Remote = 2,
Manual = 3
}
}

View File

@ -1,29 +0,0 @@

namespace MediaBrowser.Model.ApiClient
{
public class ConnectionOptions
{
/// <summary>
/// Gets or sets a value indicating whether [enable web socket].
/// </summary>
/// <value><c>true</c> if [enable web socket]; otherwise, <c>false</c>.</value>
public bool EnableWebSocket { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [report capabilities].
/// </summary>
/// <value><c>true</c> if [report capabilities]; otherwise, <c>false</c>.</value>
public bool ReportCapabilities { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [update date last accessed].
/// </summary>
/// <value><c>true</c> if [update date last accessed]; otherwise, <c>false</c>.</value>
public bool UpdateDateLastAccessed { get; set; }
public ConnectionOptions()
{
EnableWebSocket = true;
ReportCapabilities = true;
UpdateDateLastAccessed = true;
}
}
}

View File

@ -1,21 +0,0 @@
using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Dto;
using System.Collections.Generic;
namespace MediaBrowser.Model.ApiClient
{
public class ConnectionResult
{
public ConnectionState State { get; set; }
public List<ServerInfo> Servers { get; set; }
public IApiClient ApiClient { get; set; }
public ConnectUser ConnectUser { get; set; }
public UserDto OfflineUser { get; set; }
public ConnectionResult()
{
State = ConnectionState.Unavailable;
Servers = new List<ServerInfo>();
}
}
}

View File

@ -1,13 +0,0 @@
namespace MediaBrowser.Model.ApiClient
{
public enum ConnectionState
{
Unavailable = 1,
ServerSignIn = 2,
SignedIn = 3,
ServerSelection = 4,
ConnectSignIn = 5,
OfflineSignIn = 6,
OfflineSignedIn = 7
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,54 +0,0 @@
using MediaBrowser.Model.Net;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Model.ApiClient
{
/// <summary>
/// Interface IClientWebSocket
/// </summary>
public interface IClientWebSocket : IDisposable
{
/// <summary>
/// Occurs when [closed].
/// </summary>
event EventHandler Closed;
/// <summary>
/// Gets or sets the state.
/// </summary>
/// <value>The state.</value>
WebSocketState State { get; }
/// <summary>
/// Connects the async.
/// </summary>
/// <param name="url">The URL.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task ConnectAsync(string url, CancellationToken cancellationToken);
/// <summary>
/// Gets or sets the receive action.
/// </summary>
/// <value>The receive action.</value>
Action<byte[]> OnReceiveBytes { get; set; }
/// <summary>
/// Gets or sets the on receive.
/// </summary>
/// <value>The on receive.</value>
Action<string> OnReceive { get; set; }
/// <summary>
/// Sends the async.
/// </summary>
/// <param name="bytes">The bytes.</param>
/// <param name="type">The type.</param>
/// <param name="endOfMessage">if set to <c>true</c> [end of message].</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SendAsync(byte[] bytes, WebSocketMessageType type, bool endOfMessage, CancellationToken cancellationToken);
}
}

View File

@ -1,192 +0,0 @@
using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Session;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Model.ApiClient
{
public interface IConnectionManager
{
/// <summary>
/// Occurs when [connected].
/// </summary>
event EventHandler<GenericEventArgs<ConnectionResult>> Connected;
/// <summary>
/// Occurs when [local user sign in].
/// </summary>
event EventHandler<GenericEventArgs<UserDto>> LocalUserSignIn;
/// <summary>
/// Occurs when [connect user sign in].
/// </summary>
event EventHandler<GenericEventArgs<ConnectUser>> ConnectUserSignIn;
/// <summary>
/// Occurs when [local user sign out].
/// </summary>
event EventHandler<GenericEventArgs<IApiClient>> LocalUserSignOut;
/// <summary>
/// Occurs when [connect user sign out].
/// </summary>
event EventHandler<EventArgs> ConnectUserSignOut;
/// <summary>
/// Occurs when [remote logged out].
/// </summary>
event EventHandler<EventArgs> RemoteLoggedOut;
/// <summary>
/// Gets the device.
/// </summary>
/// <value>The device.</value>
IDevice Device { get; }
/// <summary>
/// Gets the connect user.
/// </summary>
/// <value>The connect user.</value>
ConnectUser ConnectUser { get; }
/// <summary>
/// Gets or sets a value indicating whether [save local credentials].
/// </summary>
/// <value><c>true</c> if [save local credentials]; otherwise, <c>false</c>.</value>
bool SaveLocalCredentials { get; set; }
/// <summary>
/// Gets the client capabilities.
/// </summary>
/// <value>The client capabilities.</value>
ClientCapabilities ClientCapabilities { get; }
/// <summary>
/// Gets the API client.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>IApiClient.</returns>
IApiClient GetApiClient(IHasServerId item);
/// <summary>
/// Gets the API client.
/// </summary>
/// <param name="serverId">The server identifier.</param>
/// <returns>IApiClient.</returns>
IApiClient GetApiClient(string serverId);
/// <summary>
/// Connects the specified cancellation token.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;ConnectionResult&gt;.</returns>
Task<ConnectionResult> Connect(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Connects the specified API client.
/// </summary>
/// <param name="apiClient">The API client.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;ConnectionResult&gt;.</returns>
Task<ConnectionResult> Connect(IApiClient apiClient, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Connects the specified server.
/// </summary>
/// <param name="server">The server.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;ConnectionResult&gt;.</returns>
Task<ConnectionResult> Connect(ServerInfo server, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Connects the specified server.
/// </summary>
/// <param name="server">The server.</param>
/// <param name="options">The options.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;ConnectionResult&gt;.</returns>
Task<ConnectionResult> Connect(ServerInfo server, ConnectionOptions options, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Connects the specified server.
/// </summary>
/// <param name="address">The address.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;ConnectionResult&gt;.</returns>
Task<ConnectionResult> Connect(string address, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Logouts this instance.
/// </summary>
/// <returns>Task&lt;ConnectionResult&gt;.</returns>
Task Logout();
/// <summary>
/// Logins to connect.
/// </summary>
/// <returns>Task.</returns>
Task LoginToConnect(string username, string password);
/// <summary>
/// Gets the active api client instance
/// </summary>
IApiClient CurrentApiClient { get; }
/// <summary>
/// Creates the pin.
/// </summary>
/// <returns>Task&lt;PinCreationResult&gt;.</returns>
Task<PinCreationResult> CreatePin();
/// <summary>
/// Gets the pin status.
/// </summary>
/// <param name="pin">The pin.</param>
/// <returns>Task&lt;PinStatusResult&gt;.</returns>
Task<PinStatusResult> GetPinStatus(PinCreationResult pin);
/// <summary>
/// Exchanges the pin.
/// </summary>
/// <param name="pin">The pin.</param>
/// <returns>Task.</returns>
Task ExchangePin(PinCreationResult pin);
/// <summary>
/// Gets the server information.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task&lt;ServerInfo&gt;.</returns>
Task<ServerInfo> GetServerInfo(string id);
/// <summary>
/// Gets the available servers.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
Task<List<ServerInfo>> GetAvailableServers(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Authenticates an offline user with their password
/// </summary>
/// <param name="user">The user.</param>
/// <param name="password">The password.</param>
/// <param name="rememberCredentials">if set to <c>true</c> [remember credentials].</param>
/// <returns>Task.</returns>
Task AuthenticateOffline(UserDto user, string password, bool rememberCredentials);
/// <summary>
/// Gets the offline users.
/// </summary>
/// <returns>Task&lt;List&lt;UserDto&gt;&gt;.</returns>
Task<List<UserDto>> GetOfflineUsers();
/// <summary>
/// Signups for connect.
/// </summary>
/// <param name="email">The email.</param>
/// <param name="username">The username.</param>
/// <param name="password">The password.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task<ConnectSignupResponse> SignupForConnect(string email, string username, string password, CancellationToken cancellationToken = default(CancellationToken));
}
}

View File

@ -1,44 +0,0 @@
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>
Task<IEnumerable<LocalFileInfo>> GetLocalPhotos();
/// <summary>
/// Gets the local videos.
/// </summary>
/// <returns>IEnumerable&lt;LocalFileInfo&gt;.</returns>
Task<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 = default(CancellationToken));
}
}

View File

@ -1,152 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Session;
using MediaBrowser.Model.Sync;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Updates;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.ApiClient
{
/// <summary>
/// Interface IServerEvents
/// </summary>
public interface IServerEvents
{
/// <summary>
/// Occurs when [user deleted].
/// </summary>
event EventHandler<GenericEventArgs<string>> UserDeleted;
/// <summary>
/// Occurs when [scheduled task ended].
/// </summary>
event EventHandler<GenericEventArgs<TaskResult>> ScheduledTaskEnded;
/// <summary>
/// Occurs when [package installing].
/// </summary>
event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstalling;
/// <summary>
/// Occurs when [package installation failed].
/// </summary>
event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationFailed;
/// <summary>
/// Occurs when [package installation completed].
/// </summary>
event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationCompleted;
/// <summary>
/// Occurs when [package installation cancelled].
/// </summary>
event EventHandler<GenericEventArgs<InstallationInfo>> PackageInstallationCancelled;
/// <summary>
/// Occurs when [user updated].
/// </summary>
event EventHandler<GenericEventArgs<UserDto>> UserUpdated;
/// <summary>
/// Occurs when [plugin uninstalled].
/// </summary>
event EventHandler<GenericEventArgs<PluginInfo>> PluginUninstalled;
/// <summary>
/// Occurs when [library changed].
/// </summary>
event EventHandler<GenericEventArgs<LibraryUpdateInfo>> LibraryChanged;
/// <summary>
/// Occurs when [browse command].
/// </summary>
event EventHandler<GenericEventArgs<BrowseRequest>> BrowseCommand;
/// <summary>
/// Occurs when [play command].
/// </summary>
event EventHandler<GenericEventArgs<PlayRequest>> PlayCommand;
/// <summary>
/// Occurs when [playstate command].
/// </summary>
event EventHandler<GenericEventArgs<PlaystateRequest>> PlaystateCommand;
/// <summary>
/// Occurs when [message command].
/// </summary>
event EventHandler<GenericEventArgs<MessageCommand>> MessageCommand;
/// <summary>
/// Occurs when [system command].
/// </summary>
event EventHandler<GenericEventArgs<GeneralCommandEventArgs>> GeneralCommand;
/// <summary>
/// Occurs when [notification added].
/// </summary>
event EventHandler<EventArgs> NotificationAdded;
/// <summary>
/// Occurs when [notification updated].
/// </summary>
event EventHandler<EventArgs> NotificationUpdated;
/// <summary>
/// Occurs when [notifications marked read].
/// </summary>
event EventHandler<EventArgs> NotificationsMarkedRead;
/// <summary>
/// Occurs when [server restarting].
/// </summary>
event EventHandler<EventArgs> ServerRestarting;
/// <summary>
/// Occurs when [server shutting down].
/// </summary>
event EventHandler<EventArgs> ServerShuttingDown;
/// <summary>
/// Occurs when [send text command].
/// </summary>
event EventHandler<GenericEventArgs<string>> SendStringCommand;
/// <summary>
/// Occurs when [set volume command].
/// </summary>
event EventHandler<GenericEventArgs<int>> SetVolumeCommand;
/// <summary>
/// Occurs when [set audio stream index command].
/// </summary>
event EventHandler<GenericEventArgs<int>> SetAudioStreamIndexCommand;
/// <summary>
/// Occurs when [set video stream index command].
/// </summary>
event EventHandler<GenericEventArgs<int>> SetSubtitleStreamIndexCommand;
/// <summary>
/// Occurs when [sessions updated].
/// </summary>
event EventHandler<GenericEventArgs<SessionUpdatesEventArgs>> SessionsUpdated;
/// <summary>
/// Occurs when [restart required].
/// </summary>
event EventHandler<EventArgs> RestartRequired;
/// <summary>
/// Occurs when [user data changed].
/// </summary>
event EventHandler<GenericEventArgs<UserDataChangeInfo>> UserDataChanged;
/// <summary>
/// Occurs when [playback start].
/// </summary>
event EventHandler<GenericEventArgs<SessionInfoDto>> PlaybackStart;
/// <summary>
/// Occurs when [playback stopped].
/// </summary>
event EventHandler<GenericEventArgs<SessionInfoDto>> PlaybackStopped;
/// <summary>
/// Occurs when [session ended].
/// </summary>
event EventHandler<GenericEventArgs<SessionInfoDto>> SessionEnded;
/// <summary>
/// Occurs when [synchronize job created].
/// </summary>
event EventHandler<GenericEventArgs<SyncJobCreationResult>> SyncJobCreated;
/// <summary>
/// Occurs when [synchronize job cancelled].
/// </summary>
event EventHandler<GenericEventArgs<SyncJob>> SyncJobCancelled;
/// <summary>
/// Occurs when [synchronize jobs updated].
/// </summary>
event EventHandler<GenericEventArgs<List<SyncJob>>> SyncJobsUpdated;
/// <summary>
/// Occurs when [synchronize job updated].
/// </summary>
event EventHandler<GenericEventArgs<CompleteSyncJobInfo>> SyncJobUpdated;
}
}

View File

@ -1,30 +0,0 @@

namespace MediaBrowser.Model.ApiClient
{
public class NetworkStatus
{
/// <summary>
/// Gets or sets a value indicating whether this instance is network available.
/// </summary>
/// <value><c>true</c> if this instance is network available; otherwise, <c>false</c>.</value>
public bool IsNetworkAvailable { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is local network available.
/// </summary>
/// <value><c>null</c> if [is local network available] contains no value, <c>true</c> if [is local network available]; otherwise, <c>false</c>.</value>
public bool? IsLocalNetworkAvailable { get; set; }
/// <summary>
/// Gets the is any local network available.
/// </summary>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
public bool GetIsAnyLocalNetworkAvailable()
{
if (!IsLocalNetworkAvailable.HasValue)
{
return IsNetworkAvailable;
}
return IsLocalNetworkAvailable.Value;
}
}
}

View File

@ -1,9 +0,0 @@

namespace MediaBrowser.Model.ApiClient
{
public enum RemoteLogoutReason
{
GeneralAccesError = 0,
ParentalControlRestriction = 1
}
}

View File

@ -1,131 +0,0 @@
using MediaBrowser.Model.Extensions;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.ApiClient
{
public class ServerCredentials
{
public List<ServerInfo> Servers { get; set; }
public string ConnectUserId { get; set; }
public string ConnectAccessToken { get; set; }
public ServerCredentials()
{
Servers = new List<ServerInfo>();
}
public void AddOrUpdateServer(ServerInfo server)
{
if (server == null)
{
throw new ArgumentNullException("server");
}
// Clone the existing list of servers
var list = new List<ServerInfo>();
foreach (ServerInfo serverInfo in Servers)
{
list.Add(serverInfo);
}
var index = FindIndex(list, server.Id);
if (index != -1)
{
var existing = list[index];
// Take the most recent DateLastAccessed
if (server.DateLastAccessed > existing.DateLastAccessed)
{
existing.DateLastAccessed = server.DateLastAccessed;
}
existing.UserLinkType = server.UserLinkType;
if (!string.IsNullOrEmpty(server.AccessToken))
{
existing.AccessToken = server.AccessToken;
existing.UserId = server.UserId;
}
if (!string.IsNullOrEmpty(server.ExchangeToken))
{
existing.ExchangeToken = server.ExchangeToken;
}
if (!string.IsNullOrEmpty(server.RemoteAddress))
{
existing.RemoteAddress = server.RemoteAddress;
}
if (!string.IsNullOrEmpty(server.ConnectServerId))
{
existing.ConnectServerId = server.ConnectServerId;
}
if (!string.IsNullOrEmpty(server.LocalAddress))
{
existing.LocalAddress = server.LocalAddress;
}
if (!string.IsNullOrEmpty(server.ManualAddress))
{
existing.ManualAddress = server.ManualAddress;
}
if (!string.IsNullOrEmpty(server.Name))
{
existing.Name = server.Name;
}
if (server.WakeOnLanInfos != null && server.WakeOnLanInfos.Count > 0)
{
existing.WakeOnLanInfos = new List<WakeOnLanInfo>();
foreach (WakeOnLanInfo info in server.WakeOnLanInfos)
{
existing.WakeOnLanInfos.Add(info);
}
}
if (server.LastConnectionMode.HasValue)
{
existing.LastConnectionMode = server.LastConnectionMode;
}
foreach (ServerUserInfo user in server.Users)
{
existing.AddOrUpdate(user);
}
}
else
{
list.Add(server);
}
Servers = list;
}
private int FindIndex(List<ServerInfo> servers, string id)
{
var index = 0;
foreach (ServerInfo server in servers)
{
if (StringHelper.EqualsIgnoreCase(id, server.Id))
{
return index;
}
index++;
}
return -1;
}
public ServerInfo GetServer(string id)
{
foreach (ServerInfo server in Servers)
{
if (StringHelper.EqualsIgnoreCase(id, server.Id))
{
return server;
}
}
return null;
}
}
}

View File

@ -1,127 +0,0 @@
using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.System;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.ApiClient
{
public class ServerInfo
{
public List<ServerUserInfo> Users { get; set; }
public String Name { get; set; }
public String Id { get; set; }
public String ConnectServerId { get; set; }
public String LocalAddress { get; set; }
public String RemoteAddress { get; set; }
public String ManualAddress { get; set; }
public String UserId { get; set; }
public String AccessToken { get; set; }
public List<WakeOnLanInfo> WakeOnLanInfos { get; set; }
public DateTime DateLastAccessed { get; set; }
public String ExchangeToken { get; set; }
public UserLinkType? UserLinkType { get; set; }
public ConnectionMode? LastConnectionMode { get; set; }
public ServerInfo()
{
WakeOnLanInfos = new List<WakeOnLanInfo>();
Users = new List<ServerUserInfo>();
}
public void ImportInfo(PublicSystemInfo systemInfo)
{
Name = systemInfo.ServerName;
Id = systemInfo.Id;
if (!string.IsNullOrEmpty(systemInfo.LocalAddress))
{
LocalAddress = systemInfo.LocalAddress;
}
if (!string.IsNullOrEmpty(systemInfo.WanAddress))
{
RemoteAddress = systemInfo.WanAddress;
}
var fullSystemInfo = systemInfo as SystemInfo;
if (fullSystemInfo != null)
{
WakeOnLanInfos = new List<WakeOnLanInfo>();
if (!string.IsNullOrEmpty(fullSystemInfo.MacAddress))
{
WakeOnLanInfos.Add(new WakeOnLanInfo
{
MacAddress = fullSystemInfo.MacAddress
});
}
}
}
public string GetAddress(ConnectionMode mode)
{
switch (mode)
{
case ConnectionMode.Local:
return LocalAddress;
case ConnectionMode.Manual:
return ManualAddress;
case ConnectionMode.Remote:
return RemoteAddress;
default:
throw new ArgumentException("Unexpected ConnectionMode");
}
}
public void AddOrUpdate(ServerUserInfo user)
{
if (user == null)
{
throw new ArgumentNullException("user");
}
// Clone the existing list of users
var list = new List<ServerUserInfo>();
foreach (ServerUserInfo serverUserInfo in Users)
{
list.Add(serverUserInfo);
}
var index = FindIndex(list, user.Id);
if (index != -1)
{
var existing = list[index];
// Merge the data
existing.IsSignedInOffline = user.IsSignedInOffline;
}
else
{
list.Add(user);
}
Users = list;
}
private int FindIndex(List<ServerUserInfo> users, string id)
{
var index = 0;
foreach (var user in users)
{
if (StringHelper.EqualsIgnoreCase(id, user.Id))
{
return index;
}
index++;
}
return -1;
}
}
}

View File

@ -1,9 +0,0 @@

namespace MediaBrowser.Model.ApiClient
{
public class ServerUserInfo
{
public string Id { get; set; }
public bool IsSignedInOffline { get; set; }
}
}

View File

@ -221,12 +221,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The cumulative run time ticks.</value>
public long? CumulativeRunTimeTicks { get; set; }
/// <summary>
/// Gets or sets the original run time ticks.
/// </summary>
/// <value>The original run time ticks.</value>
public long? OriginalRunTimeTicks { get; set; }
/// <summary>
/// Gets or sets the run time ticks.
/// </summary>
@ -410,12 +404,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The status.</value>
public string Status { get; set; }
/// <summary>
/// Gets or sets the air time.
/// </summary>
/// <value>The air time.</value>
public string AirTime { get; set; }
/// <summary>
/// Gets or sets the air days.
/// </summary>

View File

@ -40,25 +40,10 @@
<Compile Include="Activity\ActivityLogEntry.cs" />
<Compile Include="Activity\IActivityManager.cs" />
<Compile Include="Activity\IActivityRepository.cs" />
<Compile Include="ApiClient\ApiHelpers.cs" />
<Compile Include="ApiClient\ConnectionMode.cs" />
<Compile Include="ApiClient\ConnectionResult.cs" />
<Compile Include="ApiClient\ConnectionState.cs" />
<Compile Include="ApiClient\ConnectSignupResponse.cs" />
<Compile Include="ApiClient\HttpResponseEventArgs.cs" />
<Compile Include="ApiClient\IApiClient.cs" />
<Compile Include="ApiClient\ApiClientExtensions.cs" />
<Compile Include="ApiClient\IClientWebSocket.cs" />
<Compile Include="ApiClient\IConnectionManager.cs" />
<Compile Include="ApiClient\IDevice.cs" />
<Compile Include="ApiClient\IServerEvents.cs" />
<Compile Include="ApiClient\GeneralCommandEventArgs.cs" />
<Compile Include="ApiClient\NetworkStatus.cs" />
<Compile Include="ApiClient\RemoteLogoutReason.cs" />
<Compile Include="ApiClient\ServerCredentials.cs" />
<Compile Include="ApiClient\ServerDiscoveryInfo.cs" />
<Compile Include="ApiClient\ServerInfo.cs" />
<Compile Include="ApiClient\ServerUserInfo.cs" />
<Compile Include="ApiClient\SessionUpdatesEventArgs.cs" />
<Compile Include="ApiClient\WakeOnLanInfo.cs" />
<Compile Include="Branding\BrandingOptions.cs" />
@ -85,7 +70,6 @@
<Compile Include="Connect\ConnectAuthenticationResult.cs" />
<Compile Include="Connect\ConnectAuthorization.cs" />
<Compile Include="Connect\ConnectAuthorizationRequest.cs" />
<Compile Include="ApiClient\ConnectionOptions.cs" />
<Compile Include="Connect\ConnectPassword.cs" />
<Compile Include="Connect\ConnectUser.cs" />
<Compile Include="Connect\ConnectUserQuery.cs" />

View File

@ -92,11 +92,6 @@ namespace MediaBrowser.Model.Sync
/// <value>The additional files.</value>
public List<ItemFileInfo> AdditionalFiles { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is marked for removal.
/// </summary>
/// <value><c>true</c> if this instance is marked for removal; otherwise, <c>false</c>.</value>
public bool IsMarkedForRemoval { get; set; }
/// <summary>
/// Gets or sets the index of the job item.
/// </summary>
/// <value>The index of the job item.</value>

View File

@ -8,8 +8,6 @@ namespace MediaBrowser.Model.Sync
ReadyToTransfer = 2,
Transferring = 3,
Synced = 4,
RemovedFromDevice = 5,
Failed = 6,
Cancelled = 7
Failed = 5
}
}

View File

@ -9,7 +9,6 @@ namespace MediaBrowser.Model.Sync
Transferring = 3,
Completed = 4,
CompletedWithError = 5,
Failed = 6,
Cancelled = 7
Failed = 6
}
}

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.720</version>
<version>3.0.726</version>
<title>Emby.Common</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.720</version>
<version>3.0.726</version>
<title>Emby.Server.Core</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.720" />
<dependency id="MediaBrowser.Common" version="3.0.726" />
</dependencies>
</metadata>
<files>

View File

@ -1,3 +1,3 @@
using System.Reflection;
[assembly: AssemblyVersion("3.2.26.21")]
[assembly: AssemblyVersion("3.2.26.22")]