From b7867214ef317bbf6502e53701a990ec5f13b645 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 11 Aug 2017 17:55:48 -0400 Subject: [PATCH] update download error handling --- .../ApplicationHost.cs | 1 - Emby.Server.Implementations/Dto/DtoService.cs | 2 +- .../Library/LibraryManager.cs | 4 +- .../Library/Resolvers/Movies/MovieResolver.cs | 2 +- .../LiveTv/EmbyTV/EncodedRecorder.cs | 7 +- .../Reports/Data/ReportBuilder.cs | 2 +- .../Entities/IHasSpecialFeatures.cs | 3 +- .../Entities/Movies/Movie.cs | 6 +- .../Entities/UserViewBuilder.cs | 4 +- .../MediaBrowser.Controller.csproj | 1 - MediaBrowser.Controller/Sync/ISyncManager.cs | 15 +- .../Sync/ISyncRepository.cs | 80 - .../ApiClient/ApiClientExtensions.cs | 48 - MediaBrowser.Model/ApiClient/ApiHelpers.cs | 22 - .../ApiClient/ConnectionMode.cs | 9 - .../ApiClient/ConnectionOptions.cs | 29 - .../ApiClient/ConnectionResult.cs | 21 - .../ApiClient/ConnectionState.cs | 13 - MediaBrowser.Model/ApiClient/IApiClient.cs | 1427 ----------------- .../ApiClient/IClientWebSocket.cs | 54 - .../ApiClient/IConnectionManager.cs | 192 --- MediaBrowser.Model/ApiClient/IDevice.cs | 44 - MediaBrowser.Model/ApiClient/IServerEvents.cs | 152 -- MediaBrowser.Model/ApiClient/NetworkStatus.cs | 30 - .../ApiClient/RemoteLogoutReason.cs | 9 - .../ApiClient/ServerCredentials.cs | 131 -- MediaBrowser.Model/ApiClient/ServerInfo.cs | 127 -- .../ApiClient/ServerUserInfo.cs | 9 - MediaBrowser.Model/Dto/BaseItemDto.cs | 12 - MediaBrowser.Model/MediaBrowser.Model.csproj | 16 - MediaBrowser.Model/Sync/SyncJobItem.cs | 5 - MediaBrowser.Model/Sync/SyncJobItemStatus.cs | 4 +- MediaBrowser.Model/Sync/SyncJobStatus.cs | 3 +- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 +- SharedVersion.cs | 2 +- 36 files changed, 23 insertions(+), 2469 deletions(-) delete mode 100644 MediaBrowser.Controller/Sync/ISyncRepository.cs delete mode 100644 MediaBrowser.Model/ApiClient/ApiClientExtensions.cs delete mode 100644 MediaBrowser.Model/ApiClient/ApiHelpers.cs delete mode 100644 MediaBrowser.Model/ApiClient/ConnectionMode.cs delete mode 100644 MediaBrowser.Model/ApiClient/ConnectionOptions.cs delete mode 100644 MediaBrowser.Model/ApiClient/ConnectionResult.cs delete mode 100644 MediaBrowser.Model/ApiClient/ConnectionState.cs delete mode 100644 MediaBrowser.Model/ApiClient/IApiClient.cs delete mode 100644 MediaBrowser.Model/ApiClient/IClientWebSocket.cs delete mode 100644 MediaBrowser.Model/ApiClient/IConnectionManager.cs delete mode 100644 MediaBrowser.Model/ApiClient/IDevice.cs delete mode 100644 MediaBrowser.Model/ApiClient/IServerEvents.cs delete mode 100644 MediaBrowser.Model/ApiClient/NetworkStatus.cs delete mode 100644 MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs delete mode 100644 MediaBrowser.Model/ApiClient/ServerCredentials.cs delete mode 100644 MediaBrowser.Model/ApiClient/ServerInfo.cs delete mode 100644 MediaBrowser.Model/ApiClient/ServerUserInfo.cs diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index f1f24660c..9c69cc0fc 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -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; } diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 2d717dc2c..5ad3a7ef3 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -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) { diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index b4ba58cfd..40dccf9ba 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -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) diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index d7cc1a7f7..1e5c0beed 100644 --- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -69,7 +69,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase)) { - return ResolveVideos(parent, files, directoryService, false, collectionType); + return ResolveVideos(parent, files, directoryService, true, collectionType); } if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase) || diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 90121b496..48eba4117 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -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) diff --git a/MediaBrowser.Api/Reports/Data/ReportBuilder.cs b/MediaBrowser.Api/Reports/Data/ReportBuilder.cs index 5339fa64b..6b10fcb05 100644 --- a/MediaBrowser.Api/Reports/Data/ReportBuilder.cs +++ b/MediaBrowser.Api/Reports/Data/ReportBuilder.cs @@ -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()) }; diff --git a/MediaBrowser.Controller/Entities/IHasSpecialFeatures.cs b/MediaBrowser.Controller/Entities/IHasSpecialFeatures.cs index b3a0dc237..f4905b7dc 100644 --- a/MediaBrowser.Controller/Entities/IHasSpecialFeatures.cs +++ b/MediaBrowser.Controller/Entities/IHasSpecialFeatures.cs @@ -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. /// /// The special feature ids. - List SpecialFeatureIds { get; set; } + Guid[] SpecialFeatureIds { get; set; } } } diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index 99d7fdecb..3a41709fe 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -19,11 +19,11 @@ namespace MediaBrowser.Controller.Entities.Movies /// public class Movie : Video, IHasSpecialFeatures, IHasTrailers, IHasLookupInfo, ISupportsBoxSetGrouping { - public List SpecialFeatureIds { get; set; } + public Guid[] SpecialFeatureIds { get; set; } public Movie() { - SpecialFeatureIds = new List(); + SpecialFeatureIds = EmptyGuidArray; RemoteTrailers = EmptyMediaUrlArray; LocalTrailerIds = EmptyGuidArray; RemoteTrailerIds = EmptyGuidArray; @@ -77,7 +77,7 @@ namespace MediaBrowser.Controller.Entities.Movies private async Task RefreshSpecialFeatures(MetadataRefreshOptions options, List 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); diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index f0d4d544e..a01260397 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -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) { diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 38a76c06a..5c2bae82e 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -336,7 +336,6 @@ - diff --git a/MediaBrowser.Controller/Sync/ISyncManager.cs b/MediaBrowser.Controller/Sync/ISyncManager.cs index 291632ea5..66f64464f 100644 --- a/MediaBrowser.Controller/Sync/ISyncManager.cs +++ b/MediaBrowser.Controller/Sync/ISyncManager.cs @@ -16,6 +16,7 @@ namespace MediaBrowser.Controller.Sync event EventHandler> SyncJobUpdated; event EventHandler> SyncJobItemUpdated; event EventHandler> SyncJobItemCreated; + event EventHandler> SyncJobItemCancelled; /// /// Creates the job. @@ -134,20 +135,6 @@ namespace MediaBrowser.Controller.Sync /// Task<SyncDataResponse>. Task SyncData(SyncDataRequest request); - /// - /// Marks the job item for removal. - /// - /// The identifier. - /// Task. - Task MarkJobItemForRemoval(string id); - - /// - /// Unmarks the job item for removal. - /// - /// The identifier. - /// Task. - Task UnmarkJobItemForRemoval(string id); - /// /// Gets the library item ids. /// diff --git a/MediaBrowser.Controller/Sync/ISyncRepository.cs b/MediaBrowser.Controller/Sync/ISyncRepository.cs deleted file mode 100644 index 8e9b2bf77..000000000 --- a/MediaBrowser.Controller/Sync/ISyncRepository.cs +++ /dev/null @@ -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 - { - /// - /// Gets the job. - /// - /// The identifier. - /// SyncJob. - SyncJob GetJob(string id); - - /// - /// Creates the specified job. - /// - /// The job. - /// Task. - Task Create(SyncJob job); - - /// - /// Updates the specified job. - /// - /// The job. - /// Task. - Task Update(SyncJob job); - - /// - /// Deletes the job. - /// - /// The identifier. - /// Task. - Task DeleteJob(string id); - - /// - /// Gets the jobs. - /// - /// The query. - /// QueryResult<SyncJob>. - QueryResult GetJobs(SyncJobQuery query); - - /// - /// Gets the job item. - /// - /// The identifier. - /// SyncJobItem. - SyncJobItem GetJobItem(string id); - - /// - /// Creates the specified job item. - /// - /// The job item. - /// Task. - Task Create(SyncJobItem jobItem); - - /// - /// Updates the specified job item. - /// - /// The job item. - /// Task. - Task Update(SyncJobItem jobItem); - - /// - /// Gets the job items. - /// - /// The query. - /// IEnumerable<SyncJobItem>. - QueryResult GetJobItems(SyncJobItemQuery query); - - /// - /// Gets the library item ids. - /// - /// The query. - /// QueryResult<System.String>. - Dictionary GetSyncedItemProgresses(SyncJobItemQuery query); - } -} diff --git a/MediaBrowser.Model/ApiClient/ApiClientExtensions.cs b/MediaBrowser.Model/ApiClient/ApiClientExtensions.cs deleted file mode 100644 index 4ae4fe822..000000000 --- a/MediaBrowser.Model/ApiClient/ApiClientExtensions.cs +++ /dev/null @@ -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 -{ - /// - /// Class ApiClientExtensions - /// - public static class ApiClientExtensions - { - /// - /// Gets the image stream async. - /// - /// The API client. - /// The URL. - /// Task{Stream}. - public static Task GetImageStreamAsync(this IApiClient apiClient, string url) - { - return apiClient.GetImageStreamAsync(url, CancellationToken.None); - } - - public static Task GetPublicUsersAsync(this IApiClient apiClient) - { - return apiClient.GetPublicUsersAsync(CancellationToken.None); - } - - public static Task GetItemsAsync(this IApiClient apiClient, ItemQuery query) - { - return apiClient.GetItemsAsync(query, CancellationToken.None); - } - - public static Task 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 - }); - } - } -} diff --git a/MediaBrowser.Model/ApiClient/ApiHelpers.cs b/MediaBrowser.Model/ApiClient/ApiHelpers.cs deleted file mode 100644 index 65b6495ab..000000000 --- a/MediaBrowser.Model/ApiClient/ApiHelpers.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace MediaBrowser.Model.ApiClient -{ - public static class ApiHelpers - { - /// - /// Gets the name of the slug. - /// - /// The name. - /// System.String. - public static string GetSlugName(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException("name"); - } - - return name.Replace('/', '-').Replace('?', '-').Replace('&', '-'); - } - } -} diff --git a/MediaBrowser.Model/ApiClient/ConnectionMode.cs b/MediaBrowser.Model/ApiClient/ConnectionMode.cs deleted file mode 100644 index 5dc224d95..000000000 --- a/MediaBrowser.Model/ApiClient/ConnectionMode.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MediaBrowser.Model.ApiClient -{ - public enum ConnectionMode - { - Local = 1, - Remote = 2, - Manual = 3 - } -} \ No newline at end of file diff --git a/MediaBrowser.Model/ApiClient/ConnectionOptions.cs b/MediaBrowser.Model/ApiClient/ConnectionOptions.cs deleted file mode 100644 index e12676311..000000000 --- a/MediaBrowser.Model/ApiClient/ConnectionOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ - -namespace MediaBrowser.Model.ApiClient -{ - public class ConnectionOptions - { - /// - /// Gets or sets a value indicating whether [enable web socket]. - /// - /// true if [enable web socket]; otherwise, false. - public bool EnableWebSocket { get; set; } - /// - /// Gets or sets a value indicating whether [report capabilities]. - /// - /// true if [report capabilities]; otherwise, false. - public bool ReportCapabilities { get; set; } - /// - /// Gets or sets a value indicating whether [update date last accessed]. - /// - /// true if [update date last accessed]; otherwise, false. - public bool UpdateDateLastAccessed { get; set; } - - public ConnectionOptions() - { - EnableWebSocket = true; - ReportCapabilities = true; - UpdateDateLastAccessed = true; - } - } -} diff --git a/MediaBrowser.Model/ApiClient/ConnectionResult.cs b/MediaBrowser.Model/ApiClient/ConnectionResult.cs deleted file mode 100644 index 32a80d1a3..000000000 --- a/MediaBrowser.Model/ApiClient/ConnectionResult.cs +++ /dev/null @@ -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 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(); - } - } -} diff --git a/MediaBrowser.Model/ApiClient/ConnectionState.cs b/MediaBrowser.Model/ApiClient/ConnectionState.cs deleted file mode 100644 index 9b753c7bb..000000000 --- a/MediaBrowser.Model/ApiClient/ConnectionState.cs +++ /dev/null @@ -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 - } -} \ No newline at end of file diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs deleted file mode 100644 index 2e9f57087..000000000 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ /dev/null @@ -1,1427 +0,0 @@ -using MediaBrowser.Model.Channels; -using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Devices; -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Events; -using MediaBrowser.Model.Globalization; -using MediaBrowser.Model.LiveTv; -using MediaBrowser.Model.MediaInfo; -using MediaBrowser.Model.Net; -using MediaBrowser.Model.Notifications; -using MediaBrowser.Model.Playlists; -using MediaBrowser.Model.Plugins; -using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Search; -using MediaBrowser.Model.Serialization; -using MediaBrowser.Model.Session; -using MediaBrowser.Model.Sync; -using MediaBrowser.Model.System; -using MediaBrowser.Model.Tasks; -using MediaBrowser.Model.Users; -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace MediaBrowser.Model.ApiClient -{ - /// - /// Interface IApiClient - /// - public interface IApiClient : IServerEvents, IDisposable - { - /// - /// Occurs when [remote logged out]. - /// - event EventHandler> RemoteLoggedOut; - - /// - /// Gets the API URL. - /// - /// The handler. - /// System.String. - string GetApiUrl(string handler); - - /// - /// Gets the game system summaries async. - /// - /// The cancellation token. - /// Task{List{GameSystemSummary}}. - Task> GetGameSystemSummariesAsync(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the async. - /// - /// - /// The URL. - /// The cancellation token. - /// Task{``0}. - Task GetAsync(string url, CancellationToken cancellationToken = default(CancellationToken)) - where T : class; - - /// - /// Reports the capabilities. - /// - /// The capabilities. - /// The cancellation token. - /// Task. - Task ReportCapabilities(ClientCapabilities capabilities, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Logouts this instance. - /// - /// Task. - Task Logout(); - - /// - /// Gets the index of the game players. - /// - /// The user id. - /// The cancellation token. - /// Task{List{ItemIndex}}. - Task> GetGamePlayerIndex(string userId, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the index of the year. - /// - /// The user id. - /// The include item types. - /// The cancellation token. - /// Task{List{ItemIndex}}. - Task> GetYearIndex(string userId, string[] includeItemTypes, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the critic reviews. - /// - /// The item id. - /// The cancellation token. - /// The start index. - /// The limit. - /// Task{ItemReviewsResult}. - Task> GetCriticReviews(string itemId, CancellationToken cancellationToken = default(CancellationToken), int? startIndex = null, int? limit = null); - - /// - /// Gets the theme songs async. - /// - /// The user id. - /// The item id. - /// if set to true [inherit from parents]. - /// The cancellation token. - /// Task{ThemeMediaResult}. - Task GetThemeSongsAsync(string userId, string itemId, bool inheritFromParents, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the search hints async. - /// - /// The query. - /// Task{SearchHintResult}. - Task GetSearchHintsAsync(SearchQuery query); - - /// - /// Gets the filters. - /// - /// The user identifier. - /// The parent identifier. - /// The media types. - /// The item types. - /// Task<QueryFilters>. - Task GetFilters(string userId, string parentId, string[] mediaTypes, string[] itemTypes); - - /// - /// Gets the theme videos async. - /// - /// The user id. - /// The item id. - /// if set to true [inherit from parents]. - /// The cancellation token. - /// Task{ThemeMediaResult}. - Task GetThemeVideosAsync(string userId, string itemId, bool inheritFromParents, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets all theme media async. - /// - /// The user id. - /// The item id. - /// if set to true [inherit from parents]. - /// The cancellation token. - /// Task{AllThemeMediaResult}. - Task GetAllThemeMediaAsync(string userId, string itemId, bool inheritFromParents, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Marks the notifications read. - /// - /// The user id. - /// The notification id list. - /// if set to true [is read]. - /// Task. - Task MarkNotificationsRead(string userId, IEnumerable notificationIdList, bool isRead); - - /// - /// Gets the notifications summary. - /// - /// The user id. - /// Task{NotificationsSummary}. - Task GetNotificationsSummary(string userId); - - /// - /// Gets the notifications async. - /// - /// The query. - /// Task{NotificationResult}. - Task GetNotificationsAsync(NotificationQuery query); - - /// - /// Gets an image stream based on a url - /// - /// The URL. - /// The cancellation token. - /// Task{Stream}. - /// url - Task GetImageStreamAsync(string url, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the stream. - /// - /// The URL. - /// The cancellation token. - /// Task<Stream>. - Task GetStream(string url, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the response. - /// - /// The URL. - /// The cancellation token. - /// Task<HttpResponse>. - Task GetResponse(string url, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Updates the user configuration. - /// - /// The user identifier. - /// The configuration. - /// Task. - Task UpdateUserConfiguration(string userId, UserConfiguration configuration); - - /// - /// Gets a BaseItem - /// - /// The id. - /// The user id. - /// Task{BaseItemDto}. - /// id - Task GetItemAsync(string id, string userId); - - /// - /// Gets the latest items. - /// - /// The query. - /// Task<QueryResult<BaseItemDto>>. - Task GetLatestItems(LatestItemsQuery query); - - /// - /// Gets the intros async. - /// - /// The item id. - /// The user id. - /// Task{ItemsResult}. - Task GetIntrosAsync(string itemId, string userId); - - /// - /// Gets a BaseItem - /// - /// The user id. - /// Task{BaseItemDto}. - /// userId - Task GetRootFolderAsync(string userId); - - /// - /// Gets the additional parts. - /// - /// The item identifier. - /// The user identifier. - /// Task{BaseItemDto[]}. - Task GetAdditionalParts(string itemId, string userId); - - /// - /// Gets the playback information. - /// - /// The request. - /// Task<LiveMediaInfoResult>. - Task GetPlaybackInfo(PlaybackInfoRequest request); - - /// - /// Gets the users async. - /// - /// The query. - /// Task{UserDto[]}. - Task GetUsersAsync(UserQuery query); - - /// - /// Gets the public users async. - /// - /// The cancellation token. - /// Task{UserDto[]}. - Task GetPublicUsersAsync(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets active client sessions. - /// - /// The query. - /// Task{SessionInfoDto[]}. - Task GetClientSessionsAsync(SessionQuery query); - - /// - /// Gets the client session asynchronous. - /// - /// Task{SessionInfoDto}. - Task GetCurrentSessionAsync(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the item counts async. - /// - /// The query. - /// Task{ItemCounts}. - Task GetItemCountsAsync(ItemCountsQuery query); - - /// - /// Gets the episodes asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{ItemsResult}. - Task GetEpisodesAsync(EpisodeQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the seasons asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{ItemsResult}. - Task GetSeasonsAsync(SeasonQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - Task GetRegistrationInfo(); - - /// - /// Queries for items - /// - /// The query. - /// The cancellation token. - /// Task{ItemsResult}. - /// query - Task GetItemsAsync(ItemQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the user views. - /// - /// The user identifier. - /// The cancellation token. - /// Task<ItemsResult>. - Task GetUserViews(string userId, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the instant mix from item asynchronous. - /// - /// The query. - /// Task<ItemsResult>. - Task GetInstantMixFromItemAsync(SimilarItemsQuery query); - - /// - /// Gets the similar movies async. - /// - /// The query. - /// The cancellation token. - /// Task{ItemsResult}. - Task GetSimilarItemsAsync(SimilarItemsQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the people async. - /// - /// The query. - /// The cancellation token. - /// Task{ItemsResult}. - /// userId - Task GetPeopleAsync(PersonsQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the artists. - /// - /// The query. - /// Task{ItemsResult}. - /// userId - Task GetArtistsAsync(ArtistsQuery query); - - /// - /// Gets the album artists asynchronous. - /// - /// The query. - /// Task{ItemsResult}. - Task GetAlbumArtistsAsync(ArtistsQuery query); - - /// - /// Gets the next up async. - /// - /// The query. - /// The cancellation token. - /// Task{ItemsResult}. - Task GetNextUpEpisodesAsync(NextUpQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the upcoming episodes asynchronous. - /// - /// The query. - /// Task{ItemsResult}. - Task GetUpcomingEpisodesAsync(UpcomingEpisodesQuery query); - - /// - /// Gets a genre - /// - /// The name. - /// The user id. - /// Task{BaseItemDto}. - /// userId - Task GetGenreAsync(string name, string userId); - - /// - /// Gets the genres async. - /// - /// The query. - /// Task{ItemsResult}. - Task GetGenresAsync(ItemsByNameQuery query); - - /// - /// Gets the studios async. - /// - /// The query. - /// Task{ItemsResult}. - Task GetStudiosAsync(ItemsByNameQuery query); - - /// - /// Gets the music genre async. - /// - /// The name. - /// The user id. - /// Task{BaseItemDto}. - Task GetMusicGenreAsync(string name, string userId); - - /// - /// Gets the game genre async. - /// - /// The name. - /// The user id. - /// Task{BaseItemDto}. - Task GetGameGenreAsync(string name, string userId); - - /// - /// Restarts the server. - /// - /// Task. - Task RestartServerAsync(); - - /// - /// Gets the system status async. - /// - /// The cancellation token. - /// Task{SystemInfo}. - Task GetSystemInfoAsync(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the public system information asynchronous. - /// - /// The cancellation token. - /// Task<PublicSystemInfo>. - Task GetPublicSystemInfoAsync(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets a list of plugins installed on the server - /// - /// Task{PluginInfo[]}. - Task GetInstalledPluginsAsync(); - - /// - /// Gets the current server configuration - /// - /// Task{ServerConfiguration}. - Task GetServerConfigurationAsync(); - - /// - /// Gets the scheduled tasks. - /// - /// Task{TaskInfo[]}. - Task GetScheduledTasksAsync(); - - /// - /// Gets the scheduled task async. - /// - /// The id. - /// Task{TaskInfo}. - /// id - Task GetScheduledTaskAsync(string id); - - /// - /// Gets a user by id - /// - /// The id. - /// Task{UserDto}. - /// id - Task GetUserAsync(string id); - - /// - /// Gets the offline user asynchronous. - /// - /// The identifier. - /// Task<UserDto>. - Task GetOfflineUserAsync(string id); - - /// - /// Gets the parental ratings async. - /// - /// Task{List{ParentalRating}}. - Task> GetParentalRatingsAsync(); - - /// - /// Gets local trailers for an item - /// - /// The user id. - /// The item id. - /// Task{ItemsResult}. - /// query - Task GetLocalTrailersAsync(string userId, string itemId); - - /// - /// Gets special features for an item - /// - /// The user id. - /// The item id. - /// Task{BaseItemDto[]}. - /// userId - Task GetSpecialFeaturesAsync(string userId, string itemId); - - /// - /// Gets the cultures async. - /// - /// Task{CultureDto[]}. - Task GetCulturesAsync(); - - /// - /// Gets the countries async. - /// - /// Task{CountryInfo[]}. - Task GetCountriesAsync(); - - /// - /// Marks the played async. - /// - /// The item id. - /// The user id. - /// The date played. - /// Task{UserItemDataDto}. - Task MarkPlayedAsync(string itemId, string userId, DateTime? datePlayed); - - /// - /// Marks the unplayed async. - /// - /// The item id. - /// The user id. - /// Task{UserItemDataDto}. - Task MarkUnplayedAsync(string itemId, string userId); - - /// - /// Updates the favorite status async. - /// - /// The item id. - /// The user id. - /// if set to true [is favorite]. - /// Task. - /// itemId - Task UpdateFavoriteStatusAsync(string itemId, string userId, bool isFavorite); - - /// - /// Reports to the server that the user has begun playing an item - /// - /// The information. - /// Task{UserItemDataDto}. - /// itemId - Task ReportPlaybackStartAsync(PlaybackStartInfo info); - - /// - /// Reports playback progress to the server - /// - /// The information. - /// Task{UserItemDataDto}. - /// itemId - Task ReportPlaybackProgressAsync(PlaybackProgressInfo info); - - /// - /// Reports to the server that the user has stopped playing an item - /// - /// The information. - /// Task{UserItemDataDto}. - /// itemId - Task ReportPlaybackStoppedAsync(PlaybackStopInfo info); - - /// - /// Instructs another client to browse to a library item. - /// - /// The session id. - /// The id of the item to browse to. - /// The name of the item to browse to. - /// The type of the item to browse to. - /// Task. - Task SendBrowseCommandAsync(string sessionId, string itemId, string itemName, string itemType); - - /// - /// Sends the playstate command async. - /// - /// The session id. - /// The request. - /// Task. - Task SendPlaystateCommandAsync(string sessionId, PlaystateRequest request); - - /// - /// Sends the play command async. - /// - /// The session id. - /// The request. - /// Task. - /// sessionId - /// or - /// request - Task SendPlayCommandAsync(string sessionId, PlayRequest request); - - /// - /// Sends the command asynchronous. - /// - /// The session identifier. - /// The command. - /// Task. - Task SendCommandAsync(string sessionId, GeneralCommand command); - - /// - /// Sends the string. - /// - /// The session identifier. - /// The text. - /// Task. - Task SendString(string sessionId, string text); - - /// - /// Sets the volume. - /// - /// The session identifier. - /// The volume. - /// Task. - Task SetVolume(string sessionId, int volume); - - /// - /// Stops the transcoding processes. - /// - /// The device identifier. - /// The stream identifier. - /// Task. - Task StopTranscodingProcesses(string deviceId, string streamId); - - /// - /// Sets the index of the audio stream. - /// - /// The session identifier. - /// The index. - /// Task. - Task SetAudioStreamIndex(string sessionId, int index); - - /// - /// Sets the index of the subtitle stream. - /// - /// The session identifier. - /// The index. - /// Task. - Task SetSubtitleStreamIndex(string sessionId, int? index); - - /// - /// Instructs the client to display a message to the user - /// - /// The session id. - /// The command. - /// Task. - Task SendMessageCommandAsync(string sessionId, MessageCommand command); - - /// - /// Clears a user's rating for an item - /// - /// The item id. - /// The user id. - /// Task{UserItemDataDto}. - /// itemId - Task ClearUserItemRatingAsync(string itemId, string userId); - - /// - /// Updates a user's rating for an item, based on likes or dislikes - /// - /// The item id. - /// The user id. - /// if set to true [likes]. - /// Task. - /// itemId - Task UpdateUserItemRatingAsync(string itemId, string userId, bool likes); - - /// - /// Authenticates a user and returns the result - /// - /// The username. - /// The password. - /// Task. - /// userId - Task AuthenticateUserAsync(string username, - string password); - - /// - /// Updates the server configuration async. - /// - /// The configuration. - /// Task. - /// configuration - Task UpdateServerConfigurationAsync(ServerConfiguration configuration); - - /// - /// Updates the scheduled task triggers. - /// - /// The id. - /// The triggers. - /// Task{RequestResult}. - /// id - Task UpdateScheduledTaskTriggersAsync(string id, TaskTriggerInfo[] triggers); - - /// - /// Gets the display preferences. - /// - /// The id. - /// The user id. - /// The client. - /// The cancellation token. - /// Task{BaseItemDto}. - Task GetDisplayPreferencesAsync(string id, string userId, string client, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Updates display preferences for a user - /// - /// The display preferences. - /// The user id. - /// The client. - /// The cancellation token. - /// Task{DisplayPreferences}. - /// userId - Task UpdateDisplayPreferencesAsync(DisplayPreferences displayPreferences, string userId, string client, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Posts a set of data to a url, and deserializes the return stream into T - /// - /// - /// The URL. - /// The args. - /// The cancellation token. - /// Task{``0}. - Task PostAsync(string url, Dictionary args, CancellationToken cancellationToken = default(CancellationToken)) - where T : class; - - /// - /// This is a helper around getting a stream from the server that contains serialized data - /// - /// The URL. - /// Task{Stream}. - Task GetSerializedStreamAsync(string url); - - /// - /// Gets the json serializer. - /// - /// The json serializer. - IJsonSerializer JsonSerializer { get; set; } - - /// - /// Gets or sets the server address - /// - /// The server address. - string ServerAddress { get; } - - /// - /// Gets or sets the type of the client. - /// - /// The type of the client. - string ClientName { get; set; } - - /// - /// Gets the device. - /// - /// The device. - IDevice Device { get; } - - /// - /// Gets or sets the name of the device. - /// - /// The name of the device. - string DeviceName { get; } - - /// - /// Gets or sets the device id. - /// - /// The device id. - string DeviceId { get; } - - /// - /// Gets or sets the current user id. - /// - /// The current user id. - string CurrentUserId { get; } - - /// - /// Gets the access token. - /// - /// The access token. - string AccessToken { get; } - - /// - /// Sets the authentication information. - /// - /// The access token. - /// The user identifier. - void SetAuthenticationInfo(string accessToken, string userId); - - /// - /// Sets the authentication information. - /// - /// The access token. - void SetAuthenticationInfo(string accessToken); - - /// - /// Clears the authentication information. - /// - void ClearAuthenticationInfo(); - - /// - /// Changes the server location. - /// - /// The address. - /// if set to true [keep existing authentication]. - void ChangeServerLocation(string address, bool keepExistingAuth = false); - - /// - /// Starts the receiving synchronize job updates. - /// - /// The interval ms. - /// The job identifier. - /// Task. - Task StartReceivingSyncJobUpdates(int intervalMs, string jobId); - - /// - /// Stops the receiving synchronize job updates. - /// - /// Task. - Task StopReceivingSyncJobUpdates(); - - /// - /// Starts the receiving synchronize jobs updates. - /// - /// The interval ms. - /// The user identifier. - /// The target identifier. - /// Task. - Task StartReceivingSyncJobsUpdates(int intervalMs, string userId, string targetId); - - /// - /// Stops the receiving synchronize jobs updates. - /// - /// Task. - Task StopReceivingSyncJobsUpdates(); - - /// - /// Starts the receiving session updates. - /// - /// The interval ms. - /// Task. - Task StartReceivingSessionUpdates(int intervalMs); - - /// - /// Stops the receiving session updates. - /// - /// Task. - Task StopReceivingSessionUpdates(); - - /// - /// Gets the image URL. - /// - /// The item. - /// The options. - /// System.String. - /// item - string GetImageUrl(BaseItemDto item, ImageOptions options); - - /// - /// Gets the image URL. - /// - /// The item. - /// The options. - /// System.String. - string GetImageUrl(ChannelInfoDto item, ImageOptions options); - - /// - /// Gets the subtitle URL. - /// - /// The options. - /// System.String. - string GetSubtitleUrl(SubtitleDownloadOptions options); - - /// - /// Gets an image url that can be used to download an image from the api - /// - /// The Id of the item - /// The options. - /// System.String. - /// itemId - string GetImageUrl(string itemId, ImageOptions options); - - /// - /// Gets the user image URL. - /// - /// The user. - /// The options. - /// System.String. - /// user - string GetUserImageUrl(UserDto user, ImageOptions options); - - /// - /// Gets an image url that can be used to download an image from the api - /// - /// The Id of the user - /// The options. - /// System.String. - /// userId - string GetUserImageUrl(string userId, ImageOptions options); - - /// - /// Gets the person image URL. - /// - /// The item. - /// The options. - /// System.String. - /// item - string GetPersonImageUrl(BaseItemPerson item, ImageOptions options); - - /// - /// Gets an image url that can be used to download an image from the api - /// - /// The name. - /// The options. - /// System.String. - /// name - string GetGenreImageUrl(string name, ImageOptions options); - - /// - /// Gets the music genre image URL. - /// - /// The name. - /// The options. - /// System.String. - string GetMusicGenreImageUrl(string name, ImageOptions options); - - /// - /// Gets the game genre image URL. - /// - /// The name. - /// The options. - /// System.String. - string GetGameGenreImageUrl(string name, ImageOptions options); - - /// - /// This is a helper to get a list of backdrop url's from a given ApiBaseItemWrapper. If the actual item does not have any backdrops it will return backdrops from the first parent that does. - /// - /// A given item. - /// The options. - /// System.String[][]. - /// item - string[] GetBackdropImageUrls(BaseItemDto item, ImageOptions options); - - /// - /// This is a helper to get the logo image url from a given ApiBaseItemWrapper. If the actual item does not have a logo, it will return the logo from the first parent that does, or null. - /// - /// A given item. - /// The options. - /// System.String. - /// item - string GetLogoImageUrl(BaseItemDto item, ImageOptions options); - - /// - /// Gets the art image URL. - /// - /// The item. - /// The options. - /// System.String. - string GetArtImageUrl(BaseItemDto item, ImageOptions options); - - /// - /// Gets the thumb image URL. - /// - /// The item. - /// The options. - /// System.String. - string GetThumbImageUrl(BaseItemDto item, ImageOptions options); - - /// - /// Gets the live tv information asynchronous. - /// - /// The cancellation token. - /// Task{LiveTvInfo}. - Task GetLiveTvInfoAsync(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv channels asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{LiveTvInfo}. - Task> GetLiveTvChannelsAsync(LiveTvChannelQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv channel asynchronous. - /// - /// The identifier. - /// The user identifier. - /// The cancellation token. - /// Task{ChannelInfoDto}. - Task GetLiveTvChannelAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv recordings asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{RecordingInfoDto}}. - Task> GetLiveTvRecordingsAsync(RecordingQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv recording asynchronous. - /// - /// The identifier. - /// The user identifier. - /// The cancellation token. - /// Task{RecordingInfoDto}. - Task GetLiveTvRecordingAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv recording groups asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{RecordingGroupDto}}. - Task> GetLiveTvRecordingGroupsAsync(RecordingGroupQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv recording group asynchronous. - /// - /// The identifier. - /// The user identifier. - /// The cancellation token. - /// Task{RecordingGroupDto}. - Task GetLiveTvRecordingGroupAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv timers asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{TimerInfoDto}}. - Task> GetLiveTvTimersAsync(TimerQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv programs asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{ProgramInfoDto}}. - Task> GetLiveTvProgramsAsync(ProgramQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv program asynchronous. - /// - /// The identifier. - /// The user identifier. - /// The cancellation token. - /// Task{ProgramInfoDto}. - Task GetLiveTvProgramAsync(string id, string userId, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the recommended live tv programs asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{ProgramInfoDto}}. - Task> GetRecommendedLiveTvProgramsAsync(RecommendedProgramQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Creates the live tv timer asynchronous. - /// - /// The timer. - /// The cancellation token. - /// Task. - Task CreateLiveTvTimerAsync(BaseTimerInfoDto timer, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Updates the live tv timer asynchronous. - /// - /// The timer. - /// The cancellation token. - /// Task. - Task UpdateLiveTvTimerAsync(TimerInfoDto timer, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Creates the live tv series timer asynchronous. - /// - /// The timer. - /// The cancellation token. - /// Task. - Task CreateLiveTvSeriesTimerAsync(SeriesTimerInfoDto timer, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Updates the live tv series timer asynchronous. - /// - /// The timer. - /// The cancellation token. - /// Task. - Task UpdateLiveTvSeriesTimerAsync(SeriesTimerInfoDto timer, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv timer asynchronous. - /// - /// The identifier. - /// The cancellation token. - /// Task{TimerInfoDto}. - Task GetLiveTvTimerAsync(string id, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv series timers asynchronous. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{SeriesTimerInfoDto}}. - Task> GetLiveTvSeriesTimersAsync(SeriesTimerQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv series timer asynchronous. - /// - /// The identifier. - /// The cancellation token. - /// Task{SeriesTimerInfoDto}. - Task GetLiveTvSeriesTimerAsync(string id, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Cancels the live tv timer asynchronous. - /// - /// The identifier. - /// The cancellation token. - /// Task. - Task CancelLiveTvTimerAsync(string id, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Cancels the live tv series timer asynchronous. - /// - /// The identifier. - /// The cancellation token. - /// Task. - Task CancelLiveTvSeriesTimerAsync(string id, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the default timer information. - /// - /// The cancellation token. - /// Task{SeriesTimerInfoDto}. - Task GetDefaultLiveTvTimerInfo(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the live tv guide information. - /// - /// The cancellation token. - /// Task{GuideInfo}. - Task GetLiveTvGuideInfo(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the default timer information. - /// - /// The program identifier. - /// The cancellation token. - /// Task{SeriesTimerInfoDto}. - Task GetDefaultLiveTvTimerInfo(string programId, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the channel features. - /// - /// The channel identifier. - /// The cancellation token. - /// Task{ChannelFeatures}. - Task GetChannelFeatures(string channelId, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the channel items. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{BaseItemDto}}. - Task> GetChannelItems(ChannelItemQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the channels. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{BaseItemDto}}. - Task> GetChannels(ChannelQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the latest channel items. - /// - /// The query. - /// The cancellation token. - /// Task{QueryResult{BaseItemDto}}. - Task> GetLatestChannelItems(AllChannelMediaQuery query, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Creates the playlist. - /// - /// The request. - /// Task<PlaylistCreationResult>. - Task CreatePlaylist(PlaylistCreationRequest request); - - /// - /// Adds to playlist. - /// - /// The playlist identifier. - /// The item ids. - /// The user identifier. - /// Task. - Task AddToPlaylist(string playlistId, IEnumerable itemIds, string userId); - - /// - /// Removes from playlist. - /// - /// The playlist identifier. - /// The entry ids. - /// Task. - Task RemoveFromPlaylist(string playlistId, IEnumerable entryIds); - - /// - /// Gets the playlist items. - /// - /// The query. - /// Task<QueryResult<BaseItemDto>>. - Task> GetPlaylistItems(PlaylistItemQuery query); - - /// - /// Sends the context message asynchronous. - /// - /// Type of the item. - /// The item identifier. - /// Name of the item. - /// The context. - /// The cancellation token. - /// Task. - Task SendContextMessageAsync(string itemType, string itemId, string itemName, string context, - CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the content upload history. - /// - /// The device identifier. - /// Task<ContentUploadHistory>. - Task GetContentUploadHistory(string deviceId); - - /// - /// Uploads the file. - /// - /// The stream. - /// The file. - /// The cancellation token. - /// Task. - Task UploadFile(Stream stream, - LocalFileInfo file, - CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the devices options options. - /// - /// Task<DevicesOptions>. - Task GetDevicesOptions(); - - /// - /// Updates the item. - /// - /// The item. - /// Task. - Task UpdateItem(BaseItemDto item); - - /// - /// Creates the synchronize job. - /// - /// The request. - /// Task<SyncJob>. - Task CreateSyncJob(SyncJobRequest request); - - /// - /// Updates the synchronize job. - /// - /// The job. - /// Task. - Task UpdateSyncJob(SyncJob job); - - /// - /// Gets the synchronize jobs. - /// - /// The query. - /// Task<QueryResult<SyncJob>>. - Task> GetSyncJobs(SyncJobQuery query); - - /// - /// Gets the synchronize job items. - /// - /// The query. - /// Task<QueryResult<SyncJobItem>>. - Task> GetSyncJobItems(SyncJobItemQuery query); - - /// - /// Reports the synchronize job item transferred. - /// - /// The identifier. - /// Task. - Task ReportSyncJobItemTransferred(string id); - - /// - /// Gets the synchronize job item file. - /// - /// The identifier. - /// The cancellation token. - /// Task<Stream>. - Task GetSyncJobItemFile(string id, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Gets the synchronize job item additional file. - /// - /// The identifier. - /// The name. - /// The cancellation token. - /// Task<Stream>. - Task GetSyncJobItemAdditionalFile(string id, string name, CancellationToken cancellationToken); - - /// - /// Opens the web socket. - /// - /// The web socket factory. - /// The keep alive timer ms. - void OpenWebSocket(Func webSocketFactory, int keepAliveTimerMs = 60000); - - /// - /// Reports the offline actions. - /// - /// The actions. - /// Task. - Task ReportOfflineActions(List actions); - - /// - /// Gets the ready synchronize items. - /// - /// The target identifier. - /// List<SyncedItem>. - Task> GetReadySyncItems(string targetId); - - /// - /// Synchronizes the data. - /// - /// The request. - /// Task<SyncDataResponse>. - Task SyncData(SyncDataRequest request); - /// - /// Gets the synchronize job item file URL. - /// - /// The identifier. - /// System.String. - string GetSyncJobItemFileUrl(string id); - /// - /// Marks the synchronize job item for removal. - /// - /// The identifier. - /// Task. - Task MarkSyncJobItemForRemoval(string id); - /// - /// Unmarks the synchronize job item for removal. - /// - /// The identifier. - /// Task. - Task UnmarkSyncJobItemForRemoval(string id); - /// - /// Queues the failed synchronize job item for retry. - /// - /// The identifier. - /// Task. - Task QueueFailedSyncJobItemForRetry(string id); - /// - /// Cancels the synchronize job. - /// - /// The identifier. - /// Task. - Task CancelSyncJob(string id); - /// - /// Cancels the synchronize job item. - /// - /// The identifier. - /// Task. - Task CancelSyncJobItem(string id); - /// - /// Enables the cancelled synchronize job item. - /// - /// The identifier. - /// Task. - Task EnableCancelledSyncJobItem(string id); - /// - /// Gets the synchronize options. - /// - /// The job information. - /// Task<SyncOptions>. - Task GetSyncOptions(SyncJobRequest jobInfo); - /// - /// Gets the synchronize options. - /// - /// The job information. - /// Task<SyncDialogOptions>. - Task GetSyncOptions(SyncJob jobInfo); - /// - /// Gets the movie recommendations. - /// - /// The query. - /// Task<List<RecommendationDto>>. - Task> GetMovieRecommendations(MovieRecommendationQuery query); - /// - /// Opens the live stream. - /// - /// The request. - /// The cancellation token. - /// Task<LiveStreamResponse>. - Task OpenLiveStream(LiveStreamRequest request, CancellationToken cancellationToken); - /// - /// Cancels the synchronize library items. - /// - /// The target identifier. - /// The item ids. - /// Task. - Task CancelSyncLibraryItems(string targetId, IEnumerable itemIds); - /// - /// Gets the supported bitrate. - /// - /// The cancellation token. - /// Task<System.Int32>. - Task DetectMaxBitrate(CancellationToken cancellationToken); - - /// - /// Gets the end point information. - /// - /// The cancellation token. - /// System.Threading.Tasks.Task<MediaBrowser.Model.Net.EndPointInfo>. - Task GetEndPointInfo(CancellationToken cancellationToken); - } -} \ No newline at end of file diff --git a/MediaBrowser.Model/ApiClient/IClientWebSocket.cs b/MediaBrowser.Model/ApiClient/IClientWebSocket.cs deleted file mode 100644 index ca3a761d4..000000000 --- a/MediaBrowser.Model/ApiClient/IClientWebSocket.cs +++ /dev/null @@ -1,54 +0,0 @@ -using MediaBrowser.Model.Net; -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace MediaBrowser.Model.ApiClient -{ - /// - /// Interface IClientWebSocket - /// - public interface IClientWebSocket : IDisposable - { - /// - /// Occurs when [closed]. - /// - event EventHandler Closed; - - /// - /// Gets or sets the state. - /// - /// The state. - WebSocketState State { get; } - - /// - /// Connects the async. - /// - /// The URL. - /// The cancellation token. - /// Task. - Task ConnectAsync(string url, CancellationToken cancellationToken); - - /// - /// Gets or sets the receive action. - /// - /// The receive action. - Action OnReceiveBytes { get; set; } - - /// - /// Gets or sets the on receive. - /// - /// The on receive. - Action OnReceive { get; set; } - - /// - /// Sends the async. - /// - /// The bytes. - /// The type. - /// if set to true [end of message]. - /// The cancellation token. - /// Task. - Task SendAsync(byte[] bytes, WebSocketMessageType type, bool endOfMessage, CancellationToken cancellationToken); - } -} diff --git a/MediaBrowser.Model/ApiClient/IConnectionManager.cs b/MediaBrowser.Model/ApiClient/IConnectionManager.cs deleted file mode 100644 index 083f230bc..000000000 --- a/MediaBrowser.Model/ApiClient/IConnectionManager.cs +++ /dev/null @@ -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 - { - /// - /// Occurs when [connected]. - /// - event EventHandler> Connected; - /// - /// Occurs when [local user sign in]. - /// - event EventHandler> LocalUserSignIn; - /// - /// Occurs when [connect user sign in]. - /// - event EventHandler> ConnectUserSignIn; - /// - /// Occurs when [local user sign out]. - /// - event EventHandler> LocalUserSignOut; - /// - /// Occurs when [connect user sign out]. - /// - event EventHandler ConnectUserSignOut; - /// - /// Occurs when [remote logged out]. - /// - event EventHandler RemoteLoggedOut; - - /// - /// Gets the device. - /// - /// The device. - IDevice Device { get; } - - /// - /// Gets the connect user. - /// - /// The connect user. - ConnectUser ConnectUser { get; } - - /// - /// Gets or sets a value indicating whether [save local credentials]. - /// - /// true if [save local credentials]; otherwise, false. - bool SaveLocalCredentials { get; set; } - - /// - /// Gets the client capabilities. - /// - /// The client capabilities. - ClientCapabilities ClientCapabilities { get; } - - /// - /// Gets the API client. - /// - /// The item. - /// IApiClient. - IApiClient GetApiClient(IHasServerId item); - - /// - /// Gets the API client. - /// - /// The server identifier. - /// IApiClient. - IApiClient GetApiClient(string serverId); - - /// - /// Connects the specified cancellation token. - /// - /// The cancellation token. - /// Task<ConnectionResult>. - Task Connect(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Connects the specified API client. - /// - /// The API client. - /// The cancellation token. - /// Task<ConnectionResult>. - Task Connect(IApiClient apiClient, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Connects the specified server. - /// - /// The server. - /// The cancellation token. - /// Task<ConnectionResult>. - Task Connect(ServerInfo server, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Connects the specified server. - /// - /// The server. - /// The options. - /// The cancellation token. - /// Task<ConnectionResult>. - Task Connect(ServerInfo server, ConnectionOptions options, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Connects the specified server. - /// - /// The address. - /// The cancellation token. - /// Task<ConnectionResult>. - Task Connect(string address, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Logouts this instance. - /// - /// Task<ConnectionResult>. - Task Logout(); - - /// - /// Logins to connect. - /// - /// Task. - Task LoginToConnect(string username, string password); - - /// - /// Gets the active api client instance - /// - IApiClient CurrentApiClient { get; } - - /// - /// Creates the pin. - /// - /// Task<PinCreationResult>. - Task CreatePin(); - - /// - /// Gets the pin status. - /// - /// The pin. - /// Task<PinStatusResult>. - Task GetPinStatus(PinCreationResult pin); - - /// - /// Exchanges the pin. - /// - /// The pin. - /// Task. - Task ExchangePin(PinCreationResult pin); - - /// - /// Gets the server information. - /// - /// The identifier. - /// Task<ServerInfo>. - Task GetServerInfo(string id); - - /// - /// Gets the available servers. - /// - /// The cancellation token. - Task> GetAvailableServers(CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Authenticates an offline user with their password - /// - /// The user. - /// The password. - /// if set to true [remember credentials]. - /// Task. - Task AuthenticateOffline(UserDto user, string password, bool rememberCredentials); - - /// - /// Gets the offline users. - /// - /// Task<List<UserDto>>. - Task> GetOfflineUsers(); - - /// - /// Signups for connect. - /// - /// The email. - /// The username. - /// The password. - /// The cancellation token. - /// Task. - Task SignupForConnect(string email, string username, string password, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/MediaBrowser.Model/ApiClient/IDevice.cs b/MediaBrowser.Model/ApiClient/IDevice.cs deleted file mode 100644 index 7b67122fb..000000000 --- a/MediaBrowser.Model/ApiClient/IDevice.cs +++ /dev/null @@ -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 - { - /// - /// Occurs when [resume from sleep]. - /// - event EventHandler ResumeFromSleep; - /// - /// Gets the name of the device. - /// - /// The name of the device. - string DeviceName { get; } - /// - /// Gets the device identifier. - /// - /// The device identifier. - string DeviceId { get; } - /// - /// Gets the local images. - /// - /// IEnumerable<LocalFileInfo>. - Task> GetLocalPhotos(); - /// - /// Gets the local videos. - /// - /// IEnumerable<LocalFileInfo>. - Task> GetLocalVideos(); - /// - /// Uploads the file. - /// - /// The file. - /// The API client. - /// The cancellation token. - /// Task. - Task UploadFile(LocalFileInfo file, IApiClient apiClient, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/MediaBrowser.Model/ApiClient/IServerEvents.cs b/MediaBrowser.Model/ApiClient/IServerEvents.cs deleted file mode 100644 index ae2d5d323..000000000 --- a/MediaBrowser.Model/ApiClient/IServerEvents.cs +++ /dev/null @@ -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 -{ - /// - /// Interface IServerEvents - /// - public interface IServerEvents - { - /// - /// Occurs when [user deleted]. - /// - event EventHandler> UserDeleted; - /// - /// Occurs when [scheduled task ended]. - /// - event EventHandler> ScheduledTaskEnded; - /// - /// Occurs when [package installing]. - /// - event EventHandler> PackageInstalling; - /// - /// Occurs when [package installation failed]. - /// - event EventHandler> PackageInstallationFailed; - /// - /// Occurs when [package installation completed]. - /// - event EventHandler> PackageInstallationCompleted; - /// - /// Occurs when [package installation cancelled]. - /// - event EventHandler> PackageInstallationCancelled; - /// - /// Occurs when [user updated]. - /// - event EventHandler> UserUpdated; - /// - /// Occurs when [plugin uninstalled]. - /// - event EventHandler> PluginUninstalled; - /// - /// Occurs when [library changed]. - /// - event EventHandler> LibraryChanged; - /// - /// Occurs when [browse command]. - /// - event EventHandler> BrowseCommand; - /// - /// Occurs when [play command]. - /// - event EventHandler> PlayCommand; - /// - /// Occurs when [playstate command]. - /// - event EventHandler> PlaystateCommand; - /// - /// Occurs when [message command]. - /// - event EventHandler> MessageCommand; - /// - /// Occurs when [system command]. - /// - event EventHandler> GeneralCommand; - /// - /// Occurs when [notification added]. - /// - event EventHandler NotificationAdded; - /// - /// Occurs when [notification updated]. - /// - event EventHandler NotificationUpdated; - /// - /// Occurs when [notifications marked read]. - /// - event EventHandler NotificationsMarkedRead; - /// - /// Occurs when [server restarting]. - /// - event EventHandler ServerRestarting; - /// - /// Occurs when [server shutting down]. - /// - event EventHandler ServerShuttingDown; - /// - /// Occurs when [send text command]. - /// - event EventHandler> SendStringCommand; - /// - /// Occurs when [set volume command]. - /// - event EventHandler> SetVolumeCommand; - /// - /// Occurs when [set audio stream index command]. - /// - event EventHandler> SetAudioStreamIndexCommand; - /// - /// Occurs when [set video stream index command]. - /// - event EventHandler> SetSubtitleStreamIndexCommand; - /// - /// Occurs when [sessions updated]. - /// - event EventHandler> SessionsUpdated; - /// - /// Occurs when [restart required]. - /// - event EventHandler RestartRequired; - /// - /// Occurs when [user data changed]. - /// - event EventHandler> UserDataChanged; - /// - /// Occurs when [playback start]. - /// - event EventHandler> PlaybackStart; - /// - /// Occurs when [playback stopped]. - /// - event EventHandler> PlaybackStopped; - /// - /// Occurs when [session ended]. - /// - event EventHandler> SessionEnded; - /// - /// Occurs when [synchronize job created]. - /// - event EventHandler> SyncJobCreated; - /// - /// Occurs when [synchronize job cancelled]. - /// - event EventHandler> SyncJobCancelled; - /// - /// Occurs when [synchronize jobs updated]. - /// - event EventHandler>> SyncJobsUpdated; - /// - /// Occurs when [synchronize job updated]. - /// - event EventHandler> SyncJobUpdated; - } -} diff --git a/MediaBrowser.Model/ApiClient/NetworkStatus.cs b/MediaBrowser.Model/ApiClient/NetworkStatus.cs deleted file mode 100644 index 715087607..000000000 --- a/MediaBrowser.Model/ApiClient/NetworkStatus.cs +++ /dev/null @@ -1,30 +0,0 @@ - -namespace MediaBrowser.Model.ApiClient -{ - public class NetworkStatus - { - /// - /// Gets or sets a value indicating whether this instance is network available. - /// - /// true if this instance is network available; otherwise, false. - public bool IsNetworkAvailable { get; set; } - /// - /// Gets or sets a value indicating whether this instance is local network available. - /// - /// null if [is local network available] contains no value, true if [is local network available]; otherwise, false. - public bool? IsLocalNetworkAvailable { get; set; } - /// - /// Gets the is any local network available. - /// - /// true if XXXX, false otherwise. - public bool GetIsAnyLocalNetworkAvailable() - { - if (!IsLocalNetworkAvailable.HasValue) - { - return IsNetworkAvailable; - } - - return IsLocalNetworkAvailable.Value; - } - } -} diff --git a/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs b/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs deleted file mode 100644 index 237949c69..000000000 --- a/MediaBrowser.Model/ApiClient/RemoteLogoutReason.cs +++ /dev/null @@ -1,9 +0,0 @@ - -namespace MediaBrowser.Model.ApiClient -{ - public enum RemoteLogoutReason - { - GeneralAccesError = 0, - ParentalControlRestriction = 1 - } -} diff --git a/MediaBrowser.Model/ApiClient/ServerCredentials.cs b/MediaBrowser.Model/ApiClient/ServerCredentials.cs deleted file mode 100644 index ddeb7e546..000000000 --- a/MediaBrowser.Model/ApiClient/ServerCredentials.cs +++ /dev/null @@ -1,131 +0,0 @@ -using MediaBrowser.Model.Extensions; -using System; -using System.Collections.Generic; - -namespace MediaBrowser.Model.ApiClient -{ - public class ServerCredentials - { - public List Servers { get; set; } - - public string ConnectUserId { get; set; } - public string ConnectAccessToken { get; set; } - - public ServerCredentials() - { - Servers = new List(); - } - - public void AddOrUpdateServer(ServerInfo server) - { - if (server == null) - { - throw new ArgumentNullException("server"); - } - - // Clone the existing list of servers - var list = new List(); - 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(); - 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 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; - } - } -} diff --git a/MediaBrowser.Model/ApiClient/ServerInfo.cs b/MediaBrowser.Model/ApiClient/ServerInfo.cs deleted file mode 100644 index 48995e80a..000000000 --- a/MediaBrowser.Model/ApiClient/ServerInfo.cs +++ /dev/null @@ -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 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 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(); - Users = new List(); - } - - 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(); - - 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(); - 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 users, string id) - { - var index = 0; - - foreach (var user in users) - { - if (StringHelper.EqualsIgnoreCase(id, user.Id)) - { - return index; - } - - index++; - } - - return -1; - } - } -} diff --git a/MediaBrowser.Model/ApiClient/ServerUserInfo.cs b/MediaBrowser.Model/ApiClient/ServerUserInfo.cs deleted file mode 100644 index 812da7402..000000000 --- a/MediaBrowser.Model/ApiClient/ServerUserInfo.cs +++ /dev/null @@ -1,9 +0,0 @@ - -namespace MediaBrowser.Model.ApiClient -{ - public class ServerUserInfo - { - public string Id { get; set; } - public bool IsSignedInOffline { get; set; } - } -} diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 2df69a58f..324570901 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -221,12 +221,6 @@ namespace MediaBrowser.Model.Dto /// The cumulative run time ticks. public long? CumulativeRunTimeTicks { get; set; } - /// - /// Gets or sets the original run time ticks. - /// - /// The original run time ticks. - public long? OriginalRunTimeTicks { get; set; } - /// /// Gets or sets the run time ticks. /// @@ -410,12 +404,6 @@ namespace MediaBrowser.Model.Dto /// The status. public string Status { get; set; } - /// - /// Gets or sets the air time. - /// - /// The air time. - public string AirTime { get; set; } - /// /// Gets or sets the air days. /// diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 547baee66..60cad44db 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -40,25 +40,10 @@ - - - - - - - - - - - - - - - @@ -85,7 +70,6 @@ - diff --git a/MediaBrowser.Model/Sync/SyncJobItem.cs b/MediaBrowser.Model/Sync/SyncJobItem.cs index 1c72ccd52..9fb275823 100644 --- a/MediaBrowser.Model/Sync/SyncJobItem.cs +++ b/MediaBrowser.Model/Sync/SyncJobItem.cs @@ -92,11 +92,6 @@ namespace MediaBrowser.Model.Sync /// The additional files. public List AdditionalFiles { get; set; } /// - /// Gets or sets a value indicating whether this instance is marked for removal. - /// - /// true if this instance is marked for removal; otherwise, false. - public bool IsMarkedForRemoval { get; set; } - /// /// Gets or sets the index of the job item. /// /// The index of the job item. diff --git a/MediaBrowser.Model/Sync/SyncJobItemStatus.cs b/MediaBrowser.Model/Sync/SyncJobItemStatus.cs index c4e23c63c..2a968869f 100644 --- a/MediaBrowser.Model/Sync/SyncJobItemStatus.cs +++ b/MediaBrowser.Model/Sync/SyncJobItemStatus.cs @@ -8,8 +8,6 @@ namespace MediaBrowser.Model.Sync ReadyToTransfer = 2, Transferring = 3, Synced = 4, - RemovedFromDevice = 5, - Failed = 6, - Cancelled = 7 + Failed = 5 } } diff --git a/MediaBrowser.Model/Sync/SyncJobStatus.cs b/MediaBrowser.Model/Sync/SyncJobStatus.cs index ac211a32a..2d1d30802 100644 --- a/MediaBrowser.Model/Sync/SyncJobStatus.cs +++ b/MediaBrowser.Model/Sync/SyncJobStatus.cs @@ -9,7 +9,6 @@ namespace MediaBrowser.Model.Sync Transferring = 3, Completed = 4, CompletedWithError = 5, - Failed = 6, - Cancelled = 7 + Failed = 6 } } diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index d82242826..fedb815cf 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.720 + 3.0.726 Emby.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 8c3f90e4f..58432679b 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.720 + 3.0.726 Emby.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + diff --git a/SharedVersion.cs b/SharedVersion.cs index 719ace03f..25d498a60 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.26.21")] +[assembly: AssemblyVersion("3.2.26.22")]