diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-01 00:11:04 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-01 00:11:04 -0400 |
| commit | 20d35a640570eab1a47e4bd8c156f1e8aeb7db2d (patch) | |
| tree | 4464240863af1e8e6fa811583bb82ad8864dd3ab /MediaBrowser.Server.Implementations | |
| parent | d1e045f66274e8ec240557d32f484d8640b05edc (diff) | |
isolate .net specific methods in model project
Diffstat (limited to 'MediaBrowser.Server.Implementations')
4 files changed, 10 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs index b03139c64..8d9abc128 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs @@ -206,7 +206,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv IsRepeat = info.IsRepeat, EpisodeTitle = info.EpisodeTitle, ChannelType = info.ChannelType, - MediaType = info.ChannelType == LiveTvChannelType.Radio ? MediaType.Audio : MediaType.Video, + MediaType = info.ChannelType == ChannelType.Radio ? MediaType.Audio : MediaType.Video, CommunityRating = GetClientCommunityRating(info.CommunityRating), OfficialRating = info.OfficialRating, Audio = info.Audio, diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index a449b525c..0d0707386 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -416,7 +416,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv return item; } - private LiveTvProgram GetProgram(ProgramInfo info, LiveTvChannelType channelType, string serviceName, CancellationToken cancellationToken) + private LiveTvProgram GetProgram(ProgramInfo info, ChannelType channelType, string serviceName, CancellationToken cancellationToken) { var id = _tvDtoService.GetInternalProgramId(serviceName, info.Id); @@ -475,7 +475,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv if (item == null) { - if (info.ChannelType == LiveTvChannelType.TV) + if (info.ChannelType == ChannelType.TV) { item = new LiveTvVideoRecording { diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index dc0766099..a31c53b50 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -795,5 +795,6 @@ "MessageNoCollectionsAvailable": "Collections allow you to enjoy personalized groupings of Movies, Series, Albums, Books and Games. Click the New button to start creating Collections.", "HeaderWelcomeToMediaBrowserWebClient": "Welcome to the Media Browser Web Client", "ButtonDismiss": "Dismiss", - "MessageLearnHowToCustomize": "Learn how to customize this page to your own personal tastes. Click your user icon in the top right corner of the screen to view and update your preferences." + "MessageLearnHowToCustomize": "Learn how to customize this page to your own personal tastes. Click your user icon in the top right corner of the screen to view and update your preferences.", + "ButtonEditOtherUserPreferences": "Edit this user's personal preferences." }
\ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 5181361e3..ec3e636ae 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -256,7 +256,7 @@ namespace MediaBrowser.Server.Implementations.Session try { - var session = GetSession(sessionId); + var session = GetSession(sessionId, false); if (session != null) { @@ -710,13 +710,14 @@ namespace MediaBrowser.Server.Implementations.Session /// Gets the session. /// </summary> /// <param name="sessionId">The session identifier.</param> + /// <param name="throwOnMissing">if set to <c>true</c> [throw on missing].</param> /// <returns>SessionInfo.</returns> /// <exception cref="ResourceNotFoundException"></exception> - private SessionInfo GetSession(string sessionId) + private SessionInfo GetSession(string sessionId, bool throwOnMissing = true) { - var session = Sessions.First(i => string.Equals(i.Id, sessionId)); + var session = Sessions.FirstOrDefault(i => string.Equals(i.Id, sessionId)); - if (session == null) + if (session == null && throwOnMissing) { throw new ResourceNotFoundException(string.Format("Session {0} not found.", sessionId)); } |
