diff --git a/MediaBrowser.Api/Javascript/JavascriptApiClientService.cs b/MediaBrowser.Api/Javascript/JavascriptApiClientService.cs deleted file mode 100644 index 5ea6f3ebe9..0000000000 --- a/MediaBrowser.Api/Javascript/JavascriptApiClientService.cs +++ /dev/null @@ -1,59 +0,0 @@ -using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Net; -using MediaBrowser.Server.Implementations.HttpServer; -using ServiceStack.ServiceHost; -using System; -using System.IO; -using System.Threading.Tasks; - -namespace MediaBrowser.Api.Javascript -{ - /// - /// Class GetJavascriptApiClient - /// - [Route("/JsApiClient.js", "GET")] - [ServiceStack.ServiceHost.Api(("Gets an api wrapper written in Javascript"))] - public class GetJavascriptApiClient - { - /// - /// Version identifier for caching - /// - /// The v. - public string V { get; set; } - } - - /// - /// Class JavascriptApiClientService - /// - public class JavascriptApiClientService : BaseRestService - { - /// - /// Gets the specified request. - /// - /// The request. - /// System.Object. - public object Get(GetJavascriptApiClient request) - { - TimeSpan? cacheDuration = null; - - // If there's a version number in the query string we can cache this unconditionally - if (!string.IsNullOrEmpty(request.V)) - { - cacheDuration = TimeSpan.FromDays(365); - } - - var assembly = GetType().Assembly.GetName(); - - return ToStaticResult(assembly.Version.ToString().GetMD5(), null, cacheDuration, MimeTypes.GetMimeType("script.js"), GetStream); - } - - /// - /// Gets the stream. - /// - /// Stream. - private Task GetStream() - { - return Task.FromResult(GetType().Assembly.GetManifestResourceStream("MediaBrowser.Api.Javascript.ApiClient.js")); - } - } -} diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj index 8444dc46cc..e0a9444a70 100644 --- a/MediaBrowser.Api/MediaBrowser.Api.csproj +++ b/MediaBrowser.Api/MediaBrowser.Api.csproj @@ -85,7 +85,6 @@ - @@ -141,7 +140,6 @@ - diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 92f267a21d..9aa4203a9b 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -465,7 +465,7 @@ namespace MediaBrowser.Api.UserLibrary return item.ScreenshotImagePaths != null && item.ScreenshotImagePaths.Count > 0; } - if (imageType == ImageType.ChapterImage) + if (imageType == ImageType.Chapter) { var video = item as Video; diff --git a/MediaBrowser.Controller/Drawing/ImageManager.cs b/MediaBrowser.Controller/Drawing/ImageManager.cs index d95f72df70..3c6f845e57 100644 --- a/MediaBrowser.Controller/Drawing/ImageManager.cs +++ b/MediaBrowser.Controller/Drawing/ImageManager.cs @@ -356,7 +356,7 @@ namespace MediaBrowser.Controller.Drawing return item.ScreenshotImagePaths[imageIndex]; } - if (imageType == ImageType.ChapterImage) + if (imageType == ImageType.Chapter) { var video = (Video)item; diff --git a/MediaBrowser.Controller/Library/DtoBuilder.cs b/MediaBrowser.Controller/Library/DtoBuilder.cs index b8e775e976..92a15b117c 100644 --- a/MediaBrowser.Controller/Library/DtoBuilder.cs +++ b/MediaBrowser.Controller/Library/DtoBuilder.cs @@ -678,7 +678,7 @@ namespace MediaBrowser.Controller.Library if (!string.IsNullOrEmpty(chapterInfo.ImagePath)) { - dto.ImageTag = Kernel.Instance.ImageManager.GetImageCacheTag(item, ImageType.ChapterImage, chapterInfo.ImagePath); + dto.ImageTag = Kernel.Instance.ImageManager.GetImageCacheTag(item, ImageType.Chapter, chapterInfo.ImagePath); } return dto; diff --git a/MediaBrowser.Model/Entities/ImageType.cs b/MediaBrowser.Model/Entities/ImageType.cs index aaae8dda37..8ad1090b83 100644 --- a/MediaBrowser.Model/Entities/ImageType.cs +++ b/MediaBrowser.Model/Entities/ImageType.cs @@ -49,6 +49,6 @@ namespace MediaBrowser.Model.Entities /// /// The chapter image /// - ChapterImage + Chapter } } diff --git a/MediaBrowser.Model/PropertyChanged.xml b/MediaBrowser.Model/PropertyChanged.xml new file mode 100644 index 0000000000..e69755cf46 --- /dev/null +++ b/MediaBrowser.Model/PropertyChanged.xml @@ -0,0 +1,54 @@ + + + + PropertyChanged + + + + + Injects this property to be notified when a dependant property is set. + + + + + Initializes a new instance of . + + A property that will be notified for. + + + + Initializes a new instance of . + + A property that will be notified for. + The properties that will be notified for. + + + + Injects this property to be notified when a dependant property is set. + + + + + Initializes a new instance of . + + A property that the assigned property depends on. + + + + Initializes a new instance of . + + A property that the assigned property depends on. + The properties that the assigned property depends on. + + + + Exclude a or property from notification. + + + + + Exclude a or property from IsChanged flagging. + + + + diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 86e4c10ea7..4c861c61bd 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Extensions; +using System.Reflection; +using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Controller; @@ -391,7 +392,6 @@ namespace MediaBrowser.WebDashboard.Api { "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js", "http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js", - "../jsapiclient.js" + versionString, "scripts/all.js" + versionString }; @@ -447,20 +447,27 @@ namespace MediaBrowser.WebDashboard.Api var newLineBytes = Encoding.UTF8.GetBytes(Environment.NewLine); + await AppendResource(assembly, memoryStream, "MediaBrowser.WebDashboard.ApiClient.js", newLineBytes).ConfigureAwait(false); + foreach (var file in scriptFiles) { - using (var stream = assembly.GetManifestResourceStream(resourcePrefix + file)) - { - await stream.CopyToAsync(memoryStream).ConfigureAwait(false); - - await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false); - } + await AppendResource(assembly, memoryStream, resourcePrefix + file, newLineBytes).ConfigureAwait(false); } memoryStream.Position = 0; return memoryStream; } + private async Task AppendResource(Assembly assembly, Stream outputStream, string path, byte[] newLineBytes) + { + using (var stream = assembly.GetManifestResourceStream(path)) + { + await stream.CopyToAsync(outputStream).ConfigureAwait(false); + + await outputStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false); + } + } + } } diff --git a/MediaBrowser.Api/Javascript/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js similarity index 100% rename from MediaBrowser.Api/Javascript/ApiClient.js rename to MediaBrowser.WebDashboard/ApiClient.js diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 188c187226..07992b1e38 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -403,6 +403,7 @@ + diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index 629487c799..fb7a49ef6f 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,5 +1,6 @@  +