resharper suggestions in api project

This commit is contained in:
Luke Pulverenti 2013-04-10 11:32:09 -04:00
parent c645b3ff64
commit 70da0b6ae9
18 changed files with 66 additions and 73 deletions

View File

@ -59,9 +59,9 @@ namespace MediaBrowser.Api
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool dispose) protected virtual void Dispose(bool dispose)
{ {
var jobCount = ActiveTranscodingJobs.Count; var jobCount = _activeTranscodingJobs.Count;
Parallel.ForEach(ActiveTranscodingJobs, OnTranscodeKillTimerStopped); Parallel.ForEach(_activeTranscodingJobs, OnTranscodeKillTimerStopped);
// Try to allow for some time to kill the ffmpeg processes and delete the partial stream files // Try to allow for some time to kill the ffmpeg processes and delete the partial stream files
if (jobCount > 0) if (jobCount > 0)
@ -73,7 +73,7 @@ namespace MediaBrowser.Api
/// <summary> /// <summary>
/// The active transcoding jobs /// The active transcoding jobs
/// </summary> /// </summary>
private readonly List<TranscodingJob> ActiveTranscodingJobs = new List<TranscodingJob>(); private readonly List<TranscodingJob> _activeTranscodingJobs = new List<TranscodingJob>();
/// <summary> /// <summary>
/// Called when [transcode beginning]. /// Called when [transcode beginning].
@ -83,9 +83,9 @@ namespace MediaBrowser.Api
/// <param name="process">The process.</param> /// <param name="process">The process.</param>
public void OnTranscodeBeginning(string path, TranscodingJobType type, Process process) public void OnTranscodeBeginning(string path, TranscodingJobType type, Process process)
{ {
lock (ActiveTranscodingJobs) lock (_activeTranscodingJobs)
{ {
ActiveTranscodingJobs.Add(new TranscodingJob _activeTranscodingJobs.Add(new TranscodingJob
{ {
Type = type, Type = type,
Path = path, Path = path,
@ -105,11 +105,11 @@ namespace MediaBrowser.Api
/// <param name="type">The type.</param> /// <param name="type">The type.</param>
public void OnTranscodeFailedToStart(string path, TranscodingJobType type) public void OnTranscodeFailedToStart(string path, TranscodingJobType type)
{ {
lock (ActiveTranscodingJobs) lock (_activeTranscodingJobs)
{ {
var job = ActiveTranscodingJobs.First(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase)); var job = _activeTranscodingJobs.First(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
ActiveTranscodingJobs.Remove(job); _activeTranscodingJobs.Remove(job);
} }
} }
@ -121,9 +121,9 @@ namespace MediaBrowser.Api
/// <returns><c>true</c> if [has active transcoding job] [the specified path]; otherwise, <c>false</c>.</returns> /// <returns><c>true</c> if [has active transcoding job] [the specified path]; otherwise, <c>false</c>.</returns>
public bool HasActiveTranscodingJob(string path, TranscodingJobType type) public bool HasActiveTranscodingJob(string path, TranscodingJobType type)
{ {
lock (ActiveTranscodingJobs) lock (_activeTranscodingJobs)
{ {
return ActiveTranscodingJobs.Any(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase)); return _activeTranscodingJobs.Any(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
} }
} }
@ -134,9 +134,9 @@ namespace MediaBrowser.Api
/// <param name="type">The type.</param> /// <param name="type">The type.</param>
public void OnTranscodeBeginRequest(string path, TranscodingJobType type) public void OnTranscodeBeginRequest(string path, TranscodingJobType type)
{ {
lock (ActiveTranscodingJobs) lock (_activeTranscodingJobs)
{ {
var job = ActiveTranscodingJobs.FirstOrDefault(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase)); var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
if (job == null) if (job == null)
{ {
@ -160,9 +160,9 @@ namespace MediaBrowser.Api
/// <param name="type">The type.</param> /// <param name="type">The type.</param>
public void OnTranscodeEndRequest(string path, TranscodingJobType type) public void OnTranscodeEndRequest(string path, TranscodingJobType type)
{ {
lock (ActiveTranscodingJobs) lock (_activeTranscodingJobs)
{ {
var job = ActiveTranscodingJobs.FirstOrDefault(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase)); var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
if (job == null) if (job == null)
{ {
@ -194,16 +194,16 @@ namespace MediaBrowser.Api
/// <param name="type">The type.</param> /// <param name="type">The type.</param>
public void OnTranscodingFinished(string path, TranscodingJobType type) public void OnTranscodingFinished(string path, TranscodingJobType type)
{ {
lock (ActiveTranscodingJobs) lock (_activeTranscodingJobs)
{ {
var job = ActiveTranscodingJobs.FirstOrDefault(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase)); var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && j.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
if (job == null) if (job == null)
{ {
return; return;
} }
ActiveTranscodingJobs.Remove(job); _activeTranscodingJobs.Remove(job);
if (job.KillTimer != null) if (job.KillTimer != null)
{ {
@ -221,9 +221,9 @@ namespace MediaBrowser.Api
{ {
var job = (TranscodingJob)state; var job = (TranscodingJob)state;
lock (ActiveTranscodingJobs) lock (_activeTranscodingJobs)
{ {
ActiveTranscodingJobs.Remove(job); _activeTranscodingJobs.Remove(job);
if (job.KillTimer != null) if (job.KillTimer != null)
{ {
@ -306,10 +306,6 @@ namespace MediaBrowser.Api
/// <value>The active request count.</value> /// <value>The active request count.</value>
public int ActiveRequestCount { get; set; } public int ActiveRequestCount { get; set; }
/// <summary> /// <summary>
/// <summary>
/// Enum TranscodingJobType
/// </summary>
/// <summary>
/// Gets or sets the kill timer. /// Gets or sets the kill timer.
/// </summary> /// </summary>
/// <value>The kill timer.</value> /// <value>The kill timer.</value>

View File

@ -2,7 +2,6 @@
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;
using ServiceStack.ServiceHost; using ServiceStack.ServiceHost;
using ServiceStack.Text.Controller;
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -78,11 +77,6 @@ namespace MediaBrowser.Api
/// <param name="request">The request.</param> /// <param name="request">The request.</param>
public void Post(UpdateDisplayPreferences request) public void Post(UpdateDisplayPreferences request)
{ {
// We need to parse this manually because we told service stack not to with IRequiresRequestStream
// https://code.google.com/p/servicestack/source/browse/trunk/Common/ServiceStack.Text/ServiceStack.Text/Controller/PathInfo.cs
var pathInfo = PathInfo.Parse(RequestContext.PathInfo);
var displayPreferencesId = new Guid(pathInfo.GetArgumentValue<string>(1));
// Serialize to json and then back so that the core doesn't see the request dto type // Serialize to json and then back so that the core doesn't see the request dto type
var displayPreferences = _jsonSerializer.DeserializeFromString<DisplayPreferences>(_jsonSerializer.SerializeToString(request)); var displayPreferences = _jsonSerializer.DeserializeFromString<DisplayPreferences>(_jsonSerializer.SerializeToString(request));

View File

@ -51,7 +51,7 @@ namespace MediaBrowser.Api
/// Class GetDrives /// Class GetDrives
/// </summary> /// </summary>
[Route("/Environment/Drives", "GET")] [Route("/Environment/Drives", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets available drives from the server's file system")] [Api(Description = "Gets available drives from the server's file system")]
public class GetDrives : IReturn<List<FileSystemEntryInfo>> public class GetDrives : IReturn<List<FileSystemEntryInfo>>
{ {
} }
@ -60,7 +60,7 @@ namespace MediaBrowser.Api
/// Class GetNetworkComputers /// Class GetNetworkComputers
/// </summary> /// </summary>
[Route("/Environment/NetworkDevices", "GET")] [Route("/Environment/NetworkDevices", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets a list of devices on the network")] [Api(Description = "Gets a list of devices on the network")]
public class GetNetworkDevices : IReturn<List<FileSystemEntryInfo>> public class GetNetworkDevices : IReturn<List<FileSystemEntryInfo>>
{ {
} }

View File

@ -146,11 +146,12 @@ namespace MediaBrowser.Api.Library
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="LibraryService" /> class. /// Initializes a new instance of the <see cref="LibraryStructureService"/> class.
/// </summary> /// </summary>
/// <param name="appPaths">The app paths.</param> /// <param name="appPaths">The app paths.</param>
/// <param name="userManager">The user manager.</param> /// <param name="userManager">The user manager.</param>
/// <exception cref="System.ArgumentNullException">appHost</exception> /// <param name="libraryManager">The library manager.</param>
/// <exception cref="System.ArgumentNullException">appPaths</exception>
public LibraryStructureService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager) public LibraryStructureService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager)
{ {
if (appPaths == null) if (appPaths == null)

View File

@ -13,7 +13,7 @@ namespace MediaBrowser.Api
/// Class GetCultures /// Class GetCultures
/// </summary> /// </summary>
[Route("/Localization/Cultures", "GET")] [Route("/Localization/Cultures", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets known cultures")] [Api(Description = "Gets known cultures")]
public class GetCultures : IReturn<List<CultureDto>> public class GetCultures : IReturn<List<CultureDto>>
{ {
} }
@ -22,7 +22,7 @@ namespace MediaBrowser.Api
/// Class GetCountries /// Class GetCountries
/// </summary> /// </summary>
[Route("/Localization/Countries", "GET")] [Route("/Localization/Countries", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets known countries")] [Api(Description = "Gets known countries")]
public class GetCountries : IReturn<List<CountryInfo>> public class GetCountries : IReturn<List<CountryInfo>>
{ {
} }
@ -31,7 +31,7 @@ namespace MediaBrowser.Api
/// Class ParentalRatings /// Class ParentalRatings
/// </summary> /// </summary>
[Route("/Localization/ParentalRatings", "GET")] [Route("/Localization/ParentalRatings", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets known parental ratings")] [Api(Description = "Gets known parental ratings")]
public class GetParentalRatings : IReturn<List<ParentalRating>> public class GetParentalRatings : IReturn<List<ParentalRating>>
{ {
} }

View File

@ -137,7 +137,7 @@ namespace MediaBrowser.Api
else if (request.PackageType == PackageType.System || request.PackageType == PackageType.All) else if (request.PackageType == PackageType.System || request.PackageType == PackageType.All)
{ {
var updateCheckResult = _appHost.CheckForApplicationUpdate(CancellationToken.None, new Progress<double> { }).Result; var updateCheckResult = _appHost.CheckForApplicationUpdate(CancellationToken.None, new Progress<double>()).Result;
if (updateCheckResult.IsUpdateAvailable) if (updateCheckResult.IsUpdateAvailable)
{ {
@ -202,7 +202,7 @@ namespace MediaBrowser.Api
throw new ResourceNotFoundException(string.Format("Package not found: {0}", request.Name)); throw new ResourceNotFoundException(string.Format("Package not found: {0}", request.Name));
} }
Task.Run(() => _installationManager.InstallPackage(package, new Progress<double> { }, CancellationToken.None)); Task.Run(() => _installationManager.InstallPackage(package, new Progress<double>(), CancellationToken.None));
} }
/// <summary> /// <summary>

View File

@ -529,7 +529,7 @@ namespace MediaBrowser.Api.Playback
/// <param name="state">The state.</param> /// <param name="state">The state.</param>
/// <param name="outputPath">The output path.</param> /// <param name="outputPath">The output path.</param>
/// <returns>Task.</returns> /// <returns>Task.</returns>
protected async Task StartFFMpeg(StreamState state, string outputPath) protected async Task StartFfMpeg(StreamState state, string outputPath)
{ {
var video = state.Item as Video; var video = state.Item as Video;
@ -569,7 +569,7 @@ namespace MediaBrowser.Api.Playback
// FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory. // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory.
state.LogFileStream = new FileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, FileOptions.Asynchronous); state.LogFileStream = new FileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, StreamDefaults.DefaultFileStreamBufferSize, FileOptions.Asynchronous);
process.Exited += (sender, args) => OnFFMpegProcessExited(process, state); process.Exited += (sender, args) => OnFfMpegProcessExited(process, state);
try try
{ {
@ -604,7 +604,7 @@ namespace MediaBrowser.Api.Playback
/// </summary> /// </summary>
/// <param name="process">The process.</param> /// <param name="process">The process.</param>
/// <param name="state">The state.</param> /// <param name="state">The state.</param>
protected void OnFFMpegProcessExited(Process process, StreamState state) protected void OnFfMpegProcessExited(Process process, StreamState state)
{ {
if (state.IsoMount != null) if (state.IsoMount != null)
{ {
@ -691,9 +691,9 @@ namespace MediaBrowser.Api.Playback
videoRequest.VideoCodec = InferVideoCodec(url); videoRequest.VideoCodec = InferVideoCodec(url);
} }
state.VideoStream = GetMediaStream(media.MediaStreams, videoRequest.VideoStreamIndex, MediaStreamType.Video, true); state.VideoStream = GetMediaStream(media.MediaStreams, videoRequest.VideoStreamIndex, MediaStreamType.Video);
state.SubtitleStream = GetMediaStream(media.MediaStreams, videoRequest.SubtitleStreamIndex, MediaStreamType.Subtitle, false); state.SubtitleStream = GetMediaStream(media.MediaStreams, videoRequest.SubtitleStreamIndex, MediaStreamType.Subtitle, false);
state.AudioStream = GetMediaStream(media.MediaStreams, videoRequest.AudioStreamIndex, MediaStreamType.Audio, true); state.AudioStream = GetMediaStream(media.MediaStreams, videoRequest.AudioStreamIndex, MediaStreamType.Audio);
} }
else else
{ {

View File

@ -13,7 +13,7 @@ namespace MediaBrowser.Api.Playback.Hls
/// Class GetHlsAudioStream /// Class GetHlsAudioStream
/// </summary> /// </summary>
[Route("/Audio/{Id}/stream.m3u8", "GET")] [Route("/Audio/{Id}/stream.m3u8", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets an audio stream using HTTP live streaming.")] [Api(Description = "Gets an audio stream using HTTP live streaming.")]
public class GetHlsAudioStream : StreamRequest public class GetHlsAudioStream : StreamRequest
{ {
@ -21,7 +21,7 @@ namespace MediaBrowser.Api.Playback.Hls
[Route("/Audio/{Id}/segments/{SegmentId}/stream.mp3", "GET")] [Route("/Audio/{Id}/segments/{SegmentId}/stream.mp3", "GET")]
[Route("/Audio/{Id}/segments/{SegmentId}/stream.aac", "GET")] [Route("/Audio/{Id}/segments/{SegmentId}/stream.aac", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets an Http live streaming segment file. Internal use only.")] [Api(Description = "Gets an Http live streaming segment file. Internal use only.")]
public class GetHlsAudioSegment public class GetHlsAudioSegment
{ {
public string Id { get; set; } public string Id { get; set; }

View File

@ -75,7 +75,7 @@ namespace MediaBrowser.Api.Playback.Hls
if (!File.Exists(playlist)) if (!File.Exists(playlist))
{ {
isPlaylistNewlyCreated = true; isPlaylistNewlyCreated = true;
await StartFFMpeg(state, playlist).ConfigureAwait(false); await StartFfMpeg(state, playlist).ConfigureAwait(false);
} }
else else
{ {

View File

@ -110,12 +110,12 @@ namespace MediaBrowser.Api.Playback.Progressive
var extension = GetOutputFileExtension(state); var extension = GetOutputFileExtension(state);
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none // first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
var org_op = isStaticallyStreamed ? ";DLNA.ORG_OP=01" : ";DLNA.ORG_OP=00"; var orgOp = isStaticallyStreamed ? ";DLNA.ORG_OP=01" : ";DLNA.ORG_OP=00";
// 0 = native, 1 = transcoded // 0 = native, 1 = transcoded
var org_ci = isStaticallyStreamed ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1"; var orgCi = isStaticallyStreamed ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
var dlnaflags = ";DLNA.ORG_FLAGS=01500000000000000000000000000000"; const string dlnaflags = ";DLNA.ORG_FLAGS=01500000000000000000000000000000";
if (string.Equals(extension, ".mp3", StringComparison.OrdinalIgnoreCase)) if (string.Equals(extension, ".mp3", StringComparison.OrdinalIgnoreCase))
{ {
@ -158,7 +158,7 @@ namespace MediaBrowser.Api.Playback.Progressive
if (!string.IsNullOrEmpty(contentFeatures)) if (!string.IsNullOrEmpty(contentFeatures))
{ {
responseHeaders["ContentFeatures.DLNA.ORG"] = (contentFeatures + org_op + org_ci + dlnaflags).Trim(';'); responseHeaders["ContentFeatures.DLNA.ORG"] = (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
} }
} }
@ -274,7 +274,7 @@ namespace MediaBrowser.Api.Playback.Progressive
if (!File.Exists(outputPath)) if (!File.Exists(outputPath))
{ {
await StartFFMpeg(state, outputPath).ConfigureAwait(false); await StartFfMpeg(state, outputPath).ConfigureAwait(false);
} }
else else
{ {

View File

@ -42,7 +42,7 @@ namespace MediaBrowser.Api
/// Class UninstallPlugin /// Class UninstallPlugin
/// </summary> /// </summary>
[Route("/Plugins/{Id}", "DELETE")] [Route("/Plugins/{Id}", "DELETE")]
[ServiceStack.ServiceHost.Api(("Uninstalls a plugin"))] [Api(("Uninstalls a plugin"))]
public class UninstallPlugin : IReturnVoid public class UninstallPlugin : IReturnVoid
{ {
/// <summary> /// <summary>
@ -161,6 +161,7 @@ namespace MediaBrowser.Api
/// <param name="jsonSerializer">The json serializer.</param> /// <param name="jsonSerializer">The json serializer.</param>
/// <param name="appHost">The app host.</param> /// <param name="appHost">The app host.</param>
/// <param name="securityManager">The security manager.</param> /// <param name="securityManager">The security manager.</param>
/// <param name="installationManager">The installation manager.</param>
/// <exception cref="System.ArgumentNullException">jsonSerializer</exception> /// <exception cref="System.ArgumentNullException">jsonSerializer</exception>
public PluginService(IJsonSerializer jsonSerializer, IApplicationHost appHost, ISecurityManager securityManager, IInstallationManager installationManager) public PluginService(IJsonSerializer jsonSerializer, IApplicationHost appHost, ISecurityManager securityManager, IInstallationManager installationManager)
: base() : base()

View File

@ -13,7 +13,7 @@ namespace MediaBrowser.Api.ScheduledTasks
/// Class GetScheduledTask /// Class GetScheduledTask
/// </summary> /// </summary>
[Route("/ScheduledTasks/{Id}", "GET")] [Route("/ScheduledTasks/{Id}", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets a scheduled task, by Id")] [Api(Description = "Gets a scheduled task, by Id")]
public class GetScheduledTask : IReturn<TaskInfo> public class GetScheduledTask : IReturn<TaskInfo>
{ {
/// <summary> /// <summary>
@ -28,7 +28,7 @@ namespace MediaBrowser.Api.ScheduledTasks
/// Class GetScheduledTasks /// Class GetScheduledTasks
/// </summary> /// </summary>
[Route("/ScheduledTasks", "GET")] [Route("/ScheduledTasks", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets scheduled tasks")] [Api(Description = "Gets scheduled tasks")]
public class GetScheduledTasks : IReturn<List<TaskInfo>> public class GetScheduledTasks : IReturn<List<TaskInfo>>
{ {
@ -38,7 +38,7 @@ namespace MediaBrowser.Api.ScheduledTasks
/// Class StartScheduledTask /// Class StartScheduledTask
/// </summary> /// </summary>
[Route("/ScheduledTasks/Running/{Id}", "POST")] [Route("/ScheduledTasks/Running/{Id}", "POST")]
[ServiceStack.ServiceHost.Api(Description = "Starts a scheduled task")] [Api(Description = "Starts a scheduled task")]
public class StartScheduledTask : IReturnVoid public class StartScheduledTask : IReturnVoid
{ {
/// <summary> /// <summary>
@ -53,7 +53,7 @@ namespace MediaBrowser.Api.ScheduledTasks
/// Class StopScheduledTask /// Class StopScheduledTask
/// </summary> /// </summary>
[Route("/ScheduledTasks/Running/{Id}", "DELETE")] [Route("/ScheduledTasks/Running/{Id}", "DELETE")]
[ServiceStack.ServiceHost.Api(Description = "Stops a scheduled task")] [Api(Description = "Stops a scheduled task")]
public class StopScheduledTask : IReturnVoid public class StopScheduledTask : IReturnVoid
{ {
/// <summary> /// <summary>
@ -68,7 +68,7 @@ namespace MediaBrowser.Api.ScheduledTasks
/// Class UpdateScheduledTaskTriggers /// Class UpdateScheduledTaskTriggers
/// </summary> /// </summary>
[Route("/ScheduledTasks/{Id}/Triggers", "POST")] [Route("/ScheduledTasks/{Id}/Triggers", "POST")]
[ServiceStack.ServiceHost.Api(Description = "Updates the triggers for a scheduled task")] [Api(Description = "Updates the triggers for a scheduled task")]
public class UpdateScheduledTaskTriggers : List<TaskTriggerInfo>, IReturnVoid public class UpdateScheduledTaskTriggers : List<TaskTriggerInfo>, IReturnVoid
{ {
/// <summary> /// <summary>

View File

@ -15,7 +15,7 @@ namespace MediaBrowser.Api
/// Class GetSystemInfo /// Class GetSystemInfo
/// </summary> /// </summary>
[Route("/System/Info", "GET")] [Route("/System/Info", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets information about the server")] [Api(Description = "Gets information about the server")]
public class GetSystemInfo : IReturn<SystemInfo> public class GetSystemInfo : IReturn<SystemInfo>
{ {
@ -25,13 +25,13 @@ namespace MediaBrowser.Api
/// Class RestartApplication /// Class RestartApplication
/// </summary> /// </summary>
[Route("/System/Restart", "POST")] [Route("/System/Restart", "POST")]
[ServiceStack.ServiceHost.Api(("Restarts the application, if needed"))] [Api(("Restarts the application, if needed"))]
public class RestartApplication public class RestartApplication
{ {
} }
[Route("/System/Shutdown", "POST")] [Route("/System/Shutdown", "POST")]
[ServiceStack.ServiceHost.Api(("Shuts down the application"))] [Api(("Shuts down the application"))]
public class ShutdownApplication public class ShutdownApplication
{ {
} }
@ -40,7 +40,7 @@ namespace MediaBrowser.Api
/// Class GetConfiguration /// Class GetConfiguration
/// </summary> /// </summary>
[Route("/System/Configuration", "GET")] [Route("/System/Configuration", "GET")]
[ServiceStack.ServiceHost.Api(("Gets application configuration"))] [Api(("Gets application configuration"))]
public class GetConfiguration : IReturn<ServerConfiguration> public class GetConfiguration : IReturn<ServerConfiguration>
{ {
@ -50,7 +50,7 @@ namespace MediaBrowser.Api
/// Class UpdateConfiguration /// Class UpdateConfiguration
/// </summary> /// </summary>
[Route("/System/Configuration", "POST")] [Route("/System/Configuration", "POST")]
[ServiceStack.ServiceHost.Api(("Updates application configuration"))] [Api(("Updates application configuration"))]
public class UpdateConfiguration : ServerConfiguration, IReturnVoid public class UpdateConfiguration : ServerConfiguration, IReturnVoid
{ {
} }

View File

@ -13,7 +13,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary> /// </summary>
[Route("/Users/{UserId}/Items/{ParentId}/Persons", "GET")] [Route("/Users/{UserId}/Items/{ParentId}/Persons", "GET")]
[Route("/Users/{UserId}/Items/Root/Persons", "GET")] [Route("/Users/{UserId}/Items/Root/Persons", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets all persons from a given item, folder, or the entire library")] [Api(Description = "Gets all persons from a given item, folder, or the entire library")]
public class GetPersons : GetItemsByName public class GetPersons : GetItemsByName
{ {
/// <summary> /// <summary>

View File

@ -13,7 +13,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary> /// </summary>
[Route("/Users/{UserId}/Items/{ParentId}/Studios", "GET")] [Route("/Users/{UserId}/Items/{ParentId}/Studios", "GET")]
[Route("/Users/{UserId}/Items/Root/Studios", "GET")] [Route("/Users/{UserId}/Items/Root/Studios", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets all studios from a given item, folder, or the entire library")] [Api(Description = "Gets all studios from a given item, folder, or the entire library")]
public class GetStudios : GetItemsByName public class GetStudios : GetItemsByName
{ {
} }

View File

@ -14,7 +14,7 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary> /// </summary>
[Route("/Users/{UserId}/Items/{ParentId}/Years", "GET")] [Route("/Users/{UserId}/Items/{ParentId}/Years", "GET")]
[Route("/Users/{UserId}/Items/Root/Years", "GET")] [Route("/Users/{UserId}/Items/Root/Years", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets all years from a given item, folder, or the entire library")] [Api(Description = "Gets all years from a given item, folder, or the entire library")]
public class GetYears : GetItemsByName public class GetYears : GetItemsByName
{ {
} }

View File

@ -15,7 +15,7 @@ namespace MediaBrowser.Api
/// Class GetUsers /// Class GetUsers
/// </summary> /// </summary>
[Route("/Users", "GET")] [Route("/Users", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets a list of users")] [Api(Description = "Gets a list of users")]
public class GetUsers : IReturn<List<UserDto>> public class GetUsers : IReturn<List<UserDto>>
{ {
} }
@ -24,7 +24,7 @@ namespace MediaBrowser.Api
/// Class GetUser /// Class GetUser
/// </summary> /// </summary>
[Route("/Users/{Id}", "GET")] [Route("/Users/{Id}", "GET")]
[ServiceStack.ServiceHost.Api(Description = "Gets a user by Id")] [Api(Description = "Gets a user by Id")]
public class GetUser : IReturn<UserDto> public class GetUser : IReturn<UserDto>
{ {
/// <summary> /// <summary>
@ -39,7 +39,7 @@ namespace MediaBrowser.Api
/// Class DeleteUser /// Class DeleteUser
/// </summary> /// </summary>
[Route("/Users/{Id}", "DELETE")] [Route("/Users/{Id}", "DELETE")]
[ServiceStack.ServiceHost.Api(Description = "Deletes a user")] [Api(Description = "Deletes a user")]
public class DeleteUser : IReturnVoid public class DeleteUser : IReturnVoid
{ {
/// <summary> /// <summary>
@ -54,7 +54,7 @@ namespace MediaBrowser.Api
/// Class AuthenticateUser /// Class AuthenticateUser
/// </summary> /// </summary>
[Route("/Users/{Id}/Authenticate", "POST")] [Route("/Users/{Id}/Authenticate", "POST")]
[ServiceStack.ServiceHost.Api(Description = "Authenticates a user")] [Api(Description = "Authenticates a user")]
public class AuthenticateUser : IReturnVoid public class AuthenticateUser : IReturnVoid
{ {
/// <summary> /// <summary>
@ -76,7 +76,7 @@ namespace MediaBrowser.Api
/// Class UpdateUserPassword /// Class UpdateUserPassword
/// </summary> /// </summary>
[Route("/Users/{Id}/Password", "POST")] [Route("/Users/{Id}/Password", "POST")]
[ServiceStack.ServiceHost.Api(Description = "Updates a user's password")] [Api(Description = "Updates a user's password")]
public class UpdateUserPassword : IReturnVoid public class UpdateUserPassword : IReturnVoid
{ {
/// <summary> /// <summary>
@ -108,7 +108,7 @@ namespace MediaBrowser.Api
/// Class UpdateUser /// Class UpdateUser
/// </summary> /// </summary>
[Route("/Users/{Id}", "POST")] [Route("/Users/{Id}", "POST")]
[ServiceStack.ServiceHost.Api(Description = "Updates a user")] [Api(Description = "Updates a user")]
public class UpdateUser : UserDto, IReturnVoid public class UpdateUser : UserDto, IReturnVoid
{ {
} }
@ -117,7 +117,7 @@ namespace MediaBrowser.Api
/// Class CreateUser /// Class CreateUser
/// </summary> /// </summary>
[Route("/Users", "POST")] [Route("/Users", "POST")]
[ServiceStack.ServiceHost.Api(Description = "Creates a user")] [Api(Description = "Creates a user")]
public class CreateUser : UserDto, IReturn<UserDto> public class CreateUser : UserDto, IReturn<UserDto>
{ {
} }

View File

@ -29,6 +29,7 @@ namespace MediaBrowser.Api.WebSocket
/// Initializes a new instance of the <see cref="SystemInfoWebSocketListener" /> class. /// Initializes a new instance of the <see cref="SystemInfoWebSocketListener" /> class.
/// </summary> /// </summary>
/// <param name="logger">The logger.</param> /// <param name="logger">The logger.</param>
/// <param name="appHost">The app host.</param>
public SystemInfoWebSocketListener(ILogger logger, IServerApplicationHost appHost) public SystemInfoWebSocketListener(ILogger logger, IServerApplicationHost appHost)
: base(logger) : base(logger)
{ {