isolate .net specific methods in model project

This commit is contained in:
Luke Pulverenti
2014-06-01 00:11:04 -04:00
parent d1e045f662
commit 20d35a6405
40 changed files with 336 additions and 187 deletions

View File

@@ -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,

View File

@@ -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
{

View File

@@ -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."
}

View File

@@ -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));
}