add server id to dto's
This commit is contained in:
parent
45a01563e8
commit
b1c9b224c4
|
@ -35,6 +35,8 @@ namespace MediaBrowser.Model.ApiClient
|
|||
// Merge the data
|
||||
existing.DateLastAccessed = new[] { existing.DateLastAccessed, server.DateLastAccessed }.Max();
|
||||
|
||||
existing.UserLinkType = server.UserLinkType;
|
||||
|
||||
if (!string.IsNullOrEmpty(server.AccessToken))
|
||||
{
|
||||
existing.AccessToken = server.AccessToken;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Connect;
|
||||
using MediaBrowser.Model.System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -15,6 +16,7 @@ namespace MediaBrowser.Model.ApiClient
|
|||
public List<WakeOnLanInfo> WakeOnLanInfos { get; set; }
|
||||
public DateTime DateLastAccessed { get; set; }
|
||||
public String ExchangeToken { get; set; }
|
||||
public UserLinkType? UserLinkType { get; set; }
|
||||
|
||||
public ServerInfo()
|
||||
{
|
||||
|
|
|
@ -9,5 +9,6 @@ namespace MediaBrowser.Model.Connect
|
|||
public string AccessKey { get; set; }
|
||||
public string SystemId { get; set; }
|
||||
public string LocalAddress { get; set; }
|
||||
public string UserType { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
|
||||
namespace MediaBrowser.Model.LiveTv
|
||||
{
|
||||
public class BaseTimerInfoDto : IHasPropertyChangedEvent
|
||||
public class BaseTimerInfoDto : IHasPropertyChangedEvent, IHasServerId
|
||||
{
|
||||
/// <summary>
|
||||
/// Occurs when a property value changes.
|
||||
|
@ -16,6 +17,12 @@ namespace MediaBrowser.Model.LiveTv
|
|||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the server identifier.
|
||||
/// </summary>
|
||||
/// <value>The server identifier.</value>
|
||||
public string ServerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the external identifier.
|
||||
/// </summary>
|
||||
|
|
|
@ -13,14 +13,20 @@ namespace MediaBrowser.Model.LiveTv
|
|||
/// Class ChannelInfoDto
|
||||
/// </summary>
|
||||
[DebuggerDisplay("Name = {Name}, Number = {Number}")]
|
||||
public class ChannelInfoDto : IHasPropertyChangedEvent, IItemDto
|
||||
public class ChannelInfoDto : IHasPropertyChangedEvent, IItemDto, IHasServerId
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the server identifier.
|
||||
/// </summary>
|
||||
/// <value>The server identifier.</value>
|
||||
public string ServerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier.
|
||||
/// </summary>
|
||||
|
|
|
@ -11,7 +11,7 @@ using MediaBrowser.Model.Library;
|
|||
namespace MediaBrowser.Model.LiveTv
|
||||
{
|
||||
[DebuggerDisplay("Name = {Name}, StartTime = {StartDate}, EndTime = {EndDate}")]
|
||||
public class ProgramInfoDto : IHasPropertyChangedEvent, IItemDto
|
||||
public class ProgramInfoDto : IHasPropertyChangedEvent, IItemDto, IHasServerId
|
||||
{
|
||||
/// <summary>
|
||||
/// Id of the program.
|
||||
|
@ -24,6 +24,12 @@ namespace MediaBrowser.Model.LiveTv
|
|||
/// <value>The primary image aspect ratio.</value>
|
||||
public double? PrimaryImageAspectRatio { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the server identifier.
|
||||
/// </summary>
|
||||
/// <value>The server identifier.</value>
|
||||
public string ServerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the original primary image aspect ratio.
|
||||
/// </summary>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace MediaBrowser.Model.LiveTv
|
||||
{
|
||||
|
@ -8,8 +9,14 @@ namespace MediaBrowser.Model.LiveTv
|
|||
/// Class RecordingGroupDto.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("Name = {Name}, Count = {RecordingCount}")]
|
||||
public class RecordingGroupDto : IHasPropertyChangedEvent
|
||||
public class RecordingGroupDto : IHasPropertyChangedEvent, IHasServerId
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the server identifier.
|
||||
/// </summary>
|
||||
/// <value>The server identifier.</value>
|
||||
public string ServerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
|
|
|
@ -11,7 +11,7 @@ using System.Runtime.Serialization;
|
|||
namespace MediaBrowser.Model.LiveTv
|
||||
{
|
||||
[DebuggerDisplay("Name = {Name}, ChannelName = {ChannelName}")]
|
||||
public class RecordingInfoDto : IHasPropertyChangedEvent, IItemDto
|
||||
public class RecordingInfoDto : IHasPropertyChangedEvent, IItemDto, IHasServerId
|
||||
{
|
||||
/// <summary>
|
||||
/// Id of the recording.
|
||||
|
@ -24,6 +24,12 @@ namespace MediaBrowser.Model.LiveTv
|
|||
/// <value>The primary image aspect ratio.</value>
|
||||
public double? PrimaryImageAspectRatio { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the server identifier.
|
||||
/// </summary>
|
||||
/// <value>The server identifier.</value>
|
||||
public string ServerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the original primary image aspect ratio.
|
||||
/// </summary>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
@ -22,13 +23,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
|
||||
private readonly IUserDataManager _userDataManager;
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly IApplicationHost _appHost;
|
||||
|
||||
public LiveTvDtoService(IDtoService dtoService, IUserDataManager userDataManager, IImageProcessor imageProcessor, ILogger logger)
|
||||
public LiveTvDtoService(IDtoService dtoService, IUserDataManager userDataManager, IImageProcessor imageProcessor, ILogger logger, IApplicationHost appHost)
|
||||
{
|
||||
_dtoService = dtoService;
|
||||
_userDataManager = userDataManager;
|
||||
_imageProcessor = imageProcessor;
|
||||
_logger = logger;
|
||||
_appHost = appHost;
|
||||
}
|
||||
|
||||
public TimerInfoDto GetTimerInfoDto(TimerInfo info, ILiveTvService service, LiveTvProgram program, LiveTvChannel channel)
|
||||
|
@ -53,7 +56,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
ServiceName = service.Name,
|
||||
ExternalProgramId = info.ProgramId,
|
||||
Priority = info.Priority,
|
||||
RunTimeTicks = (info.EndDate - info.StartDate).Ticks
|
||||
RunTimeTicks = (info.EndDate - info.StartDate).Ticks,
|
||||
ServerId = _appHost.SystemId
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(info.ProgramId))
|
||||
|
@ -99,7 +103,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
ExternalChannelId = info.ChannelId,
|
||||
ExternalProgramId = info.ProgramId,
|
||||
ServiceName = service.Name,
|
||||
ChannelName = channelName
|
||||
ChannelName = channelName,
|
||||
ServerId = _appHost.SystemId
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(info.ChannelId))
|
||||
|
@ -219,7 +224,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
RunTimeTicks = (info.EndDate - info.StartDate).Ticks,
|
||||
OriginalAirDate = info.OriginalAirDate,
|
||||
|
||||
MediaSources = recording.GetMediaSources(true).ToList()
|
||||
MediaSources = recording.GetMediaSources(true).ToList(),
|
||||
ServerId = _appHost.SystemId
|
||||
};
|
||||
|
||||
dto.MediaStreams = dto.MediaSources.SelectMany(i => i.MediaStreams).ToList();
|
||||
|
@ -314,7 +320,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
Id = info.Id.ToString("N"),
|
||||
MediaType = info.MediaType,
|
||||
ExternalId = info.ExternalId,
|
||||
MediaSources = info.GetMediaSources(true).ToList()
|
||||
MediaSources = info.GetMediaSources(true).ToList(),
|
||||
ServerId = _appHost.SystemId
|
||||
};
|
||||
|
||||
if (user != null)
|
||||
|
@ -368,7 +375,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
IsKids = item.IsKids,
|
||||
IsPremiere = item.IsPremiere,
|
||||
Type = "Program",
|
||||
MediaType = item.MediaType
|
||||
MediaType = item.MediaType,
|
||||
ServerId = _appHost.SystemId
|
||||
};
|
||||
|
||||
if (item.EndDate.HasValue)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
|
@ -60,7 +61,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
|
||||
private readonly SemaphoreSlim _refreshSemaphore = new SemaphoreSlim(1, 1);
|
||||
|
||||
public LiveTvManager(IServerConfigurationManager config, IFileSystem fileSystem, ILogger logger, IItemRepository itemRepo, IImageProcessor imageProcessor, IUserDataManager userDataManager, IDtoService dtoService, IUserManager userManager, ILibraryManager libraryManager, ITaskManager taskManager, ILocalizationManager localization, IJsonSerializer jsonSerializer)
|
||||
public LiveTvManager(IApplicationHost appHost, IServerConfigurationManager config, IFileSystem fileSystem, ILogger logger, IItemRepository itemRepo, IImageProcessor imageProcessor, IUserDataManager userDataManager, IDtoService dtoService, IUserManager userManager, ILibraryManager libraryManager, ITaskManager taskManager, ILocalizationManager localization, IJsonSerializer jsonSerializer)
|
||||
{
|
||||
_config = config;
|
||||
_fileSystem = fileSystem;
|
||||
|
@ -74,7 +75,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
_dtoService = dtoService;
|
||||
_userDataManager = userDataManager;
|
||||
|
||||
_tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger);
|
||||
_tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger, appHost);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -530,7 +530,7 @@ namespace MediaBrowser.ServerApplication
|
|||
var playlistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("PlaylistManager"), UserManager);
|
||||
RegisterSingleInstance<IPlaylistManager>(playlistManager);
|
||||
|
||||
LiveTvManager = new LiveTvManager(ServerConfigurationManager, FileSystemManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer);
|
||||
LiveTvManager = new LiveTvManager(this, ServerConfigurationManager, FileSystemManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer);
|
||||
RegisterSingleInstance(LiveTvManager);
|
||||
|
||||
UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, FileSystemManager, UserManager, ChannelManager, LiveTvManager, ApplicationPaths, playlistManager);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.502</version>
|
||||
<version>3.0.503</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.502" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.503" />
|
||||
<dependency id="NLog" version="3.1.0.0" />
|
||||
<dependency id="SimpleInjector" version="2.6.0" />
|
||||
<dependency id="sharpcompress" version="0.10.2" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.502</version>
|
||||
<version>3.0.503</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Model.Signed</id>
|
||||
<version>3.0.502</version>
|
||||
<version>3.0.503</version>
|
||||
<title>MediaBrowser.Model - Signed Edition</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.502</version>
|
||||
<version>3.0.503</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.502" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.503" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Reference in New Issue
Block a user