mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-28 04:51:54 +00:00
isolate .net specific methods in model project
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user