diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-17 21:35:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-17 21:35:57 -0500 |
| commit | 03acdc7cc94604260e36e74cc43799f86d11ac48 (patch) | |
| tree | e1207117b4d29309150335fde201ae6771516082 /Emby.Server.Implementations | |
| parent | 5666049e579a86b9e4871ce1984bf9d3e6ba32ef (diff) | |
| parent | c99fa9a6511dd4a0b172efa7cc60c588567c3c00 (diff) | |
Merge pull request #2347 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations')
3 files changed, 75 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs index a5b19ff524..84f802d761 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs @@ -30,6 +30,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV Priority = seriesTimer.Priority, Name = parent.Name, Overview = parent.Overview, + SeriesId = parent.SeriesId, SeriesTimerId = seriesTimer.Id, ShowId = parent.ShowId }; @@ -63,6 +64,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV timerInfo.ShortOverview = programInfo.ShortOverview; timerInfo.OfficialRating = programInfo.OfficialRating; timerInfo.IsRepeat = programInfo.IsRepeat; + timerInfo.SeriesId = programInfo.SeriesId; } public static string GetRecordingName(TimerInfo info) diff --git a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs index 5fa3995e6a..7c1de251ca 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs @@ -14,6 +14,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Entities.TV; +using MediaBrowser.Model.Dto; namespace Emby.Server.Implementations.LiveTv { @@ -80,6 +81,11 @@ namespace Emby.Server.Implementations.LiveTv } dto.ProgramInfo.SeriesTimerId = dto.SeriesTimerId; + + if (!string.IsNullOrWhiteSpace(info.SeriesTimerId)) + { + FillImages(dto.ProgramInfo, info.Name, info.SeriesId); + } } if (channel != null) @@ -131,17 +137,73 @@ namespace Emby.Server.Implementations.LiveTv dto.DayPattern = info.Days == null ? null : GetDayPattern(info.Days); - FillImages(dto, info); + FillImages(dto, info.Name, info.SeriesId); return dto; } - private void FillImages(SeriesTimerInfoDto dto, SeriesTimerInfo info) + private void FillImages(BaseItemDto dto, string seriesName, string programSeriesId) { var librarySeries = _libraryManager.GetItemList(new InternalItemsQuery { IncludeItemTypes = new string[] { typeof(Series).Name }, - Name = info.Name, + Name = seriesName, + Limit = 1, + ImageTypes = new ImageType[] { ImageType.Thumb } + + }).FirstOrDefault(); + + if (librarySeries != null) + { + var image = librarySeries.GetImageInfo(ImageType.Thumb, 0); + if (image != null) + { + try + { + dto.ParentThumbImageTag = _imageProcessor.GetImageCacheTag(librarySeries, image); + dto.ParentThumbItemId = librarySeries.Id.ToString("N"); + } + catch (Exception ex) + { + } + } + } + + if (!string.IsNullOrWhiteSpace(programSeriesId)) + { + var program = _libraryManager.GetItemList(new InternalItemsQuery + { + IncludeItemTypes = new string[] { typeof(LiveTvProgram).Name }, + ExternalSeriesId = programSeriesId, + Limit = 1, + ImageTypes = new ImageType[] { ImageType.Primary } + + }).FirstOrDefault(); + + if (program != null) + { + var image = program.GetImageInfo(ImageType.Primary, 0); + if (image != null) + { + try + { + dto.ParentPrimaryImageTag = _imageProcessor.GetImageCacheTag(program, image); + dto.ParentPrimaryImageItemId = program.Id.ToString("N"); + } + catch (Exception ex) + { + } + } + } + } + } + + private void FillImages(SeriesTimerInfoDto dto, string seriesName, string programSeriesId) + { + var librarySeries = _libraryManager.GetItemList(new InternalItemsQuery + { + IncludeItemTypes = new string[] { typeof(Series).Name }, + Name = seriesName, Limit = 1, ImageTypes = new ImageType[] { ImageType.Thumb } @@ -163,12 +225,12 @@ namespace Emby.Server.Implementations.LiveTv } } - if (!string.IsNullOrWhiteSpace(info.SeriesId)) + if (!string.IsNullOrWhiteSpace(programSeriesId)) { var program = _libraryManager.GetItemList(new InternalItemsQuery { IncludeItemTypes = new string[] { typeof(LiveTvProgram).Name }, - ExternalSeriesId = info.SeriesId, + ExternalSeriesId = programSeriesId, Limit = 1, ImageTypes = new ImageType[] { ImageType.Primary } diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index 52bf09284b..0420900c55 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -42,7 +42,8 @@ namespace Emby.Server.Implementations.Updates /// </summary> private ConcurrentBag<InstallationInfo> CompletedInstallationsInternal { get; set; } - public IEnumerable<InstallationInfo> CompletedInstallations { + public IEnumerable<InstallationInfo> CompletedInstallations + { get { return CompletedInstallationsInternal; } } @@ -163,8 +164,8 @@ namespace Emby.Server.Implementations.Updates { var data = new Dictionary<string, string> { - { "key", _securityManager.SupporterKey }, - { "mac", _applicationHost.SystemId }, + { "key", _securityManager.SupporterKey }, + { "mac", _applicationHost.SystemId }, { "systemid", _applicationHost.SystemId } }; @@ -656,6 +657,8 @@ namespace Emby.Server.Implementations.Updates // Remove it the quick way for now _applicationHost.RemovePlugin(plugin); + _logger.Info("Deleting plugin file {0}", plugin.AssemblyFilePath); + _fileSystem.DeleteFile(plugin.AssemblyFilePath); OnPluginUninstalled(plugin); |
