From 8ce3e74e8112a94773df22827849bf274fc88198 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sun, 24 Feb 2013 16:53:54 -0500 Subject: More DI --- .../JavascriptApiClientService.cs | 58 ---------------------- 1 file changed, 58 deletions(-) delete mode 100644 MediaBrowser.ApiInteraction.Javascript/JavascriptApiClientService.cs (limited to 'MediaBrowser.ApiInteraction.Javascript/JavascriptApiClientService.cs') diff --git a/MediaBrowser.ApiInteraction.Javascript/JavascriptApiClientService.cs b/MediaBrowser.ApiInteraction.Javascript/JavascriptApiClientService.cs deleted file mode 100644 index c03146e69..000000000 --- a/MediaBrowser.ApiInteraction.Javascript/JavascriptApiClientService.cs +++ /dev/null @@ -1,58 +0,0 @@ -using MediaBrowser.Common.Extensions; -using MediaBrowser.Common.Net; -using ServiceStack.ServiceHost; -using System; -using System.IO; -using System.Threading.Tasks; - -namespace MediaBrowser.ApiInteraction.Javascript -{ - /// - /// Class GetJavascriptApiClient - /// - [Route("/JsApiClient.js", "GET")] - [Api(("Gets an api wrapper 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.ApiInteraction.Javascript.ApiClient.js")); - } - } -} -- cgit v1.2.3