Skip to content

Commit

Permalink
Merge pull request #3322 from MediaBrowser/dev
Browse files Browse the repository at this point in the history
consolidate chapter objects
  • Loading branch information
LukePulverenti authored Jun 14, 2018
2 parents 9101634 + 78d72fc commit 6c1b3d7
Show file tree
Hide file tree
Showing 99 changed files with 567 additions and 715 deletions.
4 changes: 2 additions & 2 deletions BDInfo/BDInfo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
2 changes: 1 addition & 1 deletion BDInfo/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Common" version="3.3.49-beta" targetFramework="net47" />
</packages>
4 changes: 2 additions & 2 deletions DvdLib/DvdLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
<Compile Include="Ifo\VideoAttributes.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
2 changes: 1 addition & 1 deletion DvdLib/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Common" version="3.3.49-beta" targetFramework="net47" />
</packages>
14 changes: 7 additions & 7 deletions Emby.Dlna/Api/DlnaServerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,42 +167,42 @@ public object Get(GetContentDirectory request)
{
var xml = ContentDirectory.GetServiceXml(Request.Headers.ToDictionary());

return _resultFactory.GetResult(xml, XMLContentType);
return _resultFactory.GetResult(Request, xml, XMLContentType);
}

public object Get(GetMediaReceiverRegistrar request)
{
var xml = MediaReceiverRegistrar.GetServiceXml(Request.Headers.ToDictionary());

return _resultFactory.GetResult(xml, XMLContentType);
return _resultFactory.GetResult(Request, xml, XMLContentType);
}

public object Get(GetConnnectionManager request)
{
var xml = ConnectionManager.GetServiceXml(Request.Headers.ToDictionary());

return _resultFactory.GetResult(xml, XMLContentType);
return _resultFactory.GetResult(Request, xml, XMLContentType);
}

public object Post(ProcessMediaReceiverRegistrarControlRequest request)
{
var response = PostAsync(request.RequestStream, MediaReceiverRegistrar);

return _resultFactory.GetResult(response.Xml, XMLContentType);
return _resultFactory.GetResult(Request, response.Xml, XMLContentType);
}

public object Post(ProcessContentDirectoryControlRequest request)
{
var response = PostAsync(request.RequestStream, ContentDirectory);

return _resultFactory.GetResult(response.Xml, XMLContentType);
return _resultFactory.GetResult(Request, response.Xml, XMLContentType);
}

public object Post(ProcessConnectionManagerControlRequest request)
{
var response = PostAsync(request.RequestStream, ConnectionManager);

return _resultFactory.GetResult(response.Xml, XMLContentType);
return _resultFactory.GetResult(Request, response.Xml, XMLContentType);
}

private ControlResponse PostAsync(Stream requestStream, IUpnpService service)
Expand Down Expand Up @@ -314,7 +314,7 @@ private object ProcessEventRequest(IEventManager eventManager)

private object GetSubscriptionResponse(EventSubscriptionResponse response)
{
return _resultFactory.GetResult(response.Content, response.ContentType, response.Headers);
return _resultFactory.GetResult(Request, response.Content, response.ContentType, response.Headers);
}
}
}
13 changes: 0 additions & 13 deletions Emby.Dlna/Didl/DidlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -951,19 +951,6 @@ private void AddCover(BaseItem item, BaseItem context, StubType? stubType, XmlWr
{
ImageDownloadInfo imageInfo = null;

if (context is UserView)
{
var episode = item as Episode;
if (episode != null)
{
var parent = episode.Series;
if (parent != null)
{
imageInfo = GetImageInfo(parent);
}
}
}

// Finally, just use the image from the item
if (imageInfo == null)
{
Expand Down
6 changes: 3 additions & 3 deletions Emby.Dlna/Emby.Dlna.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@
</ItemGroup>
<ItemGroup>
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Controller, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
4 changes: 2 additions & 2 deletions Emby.Dlna/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Common" version="3.3.49-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.49-beta" targetFramework="net47" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.0" targetFramework="net47" />
</packages>
6 changes: 3 additions & 3 deletions Emby.Drawing.ImageMagick/Emby.Drawing.ImageMagick.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
<HintPath>..\packages\ImageMagickSharp.1.0.0.19\lib\net45\ImageMagickSharp.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Controller, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
4 changes: 2 additions & 2 deletions Emby.Drawing.ImageMagick/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ImageMagickSharp" version="1.0.0.19" targetFramework="net452" />
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Common" version="3.3.49-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.49-beta" targetFramework="net47" />
</packages>
6 changes: 3 additions & 3 deletions Emby.Drawing.Skia/Emby.Drawing.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
<Compile Include="StripCollageBuilder.cs" />
<Compile Include="UnplayedCountIndicator.cs" />
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Controller, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
4 changes: 2 additions & 2 deletions Emby.Drawing.Skia/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Common" version="3.3.49-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.49-beta" targetFramework="net47" />
<package id="SkiaSharp" version="1.58.1" targetFramework="portable45-net45+win8" requireReinstallation="true" />
</packages>
6 changes: 3 additions & 3 deletions Emby.Drawing/Emby.Drawing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
</ItemGroup>
<ItemGroup>
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Controller, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
40 changes: 16 additions & 24 deletions Emby.Drawing/ImageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -518,19 +518,26 @@ private ImageSize GetImageSize(string path, bool allowSlowMethod)
/// <exception cref="System.ArgumentNullException">item</exception>
public string GetImageCacheTag(BaseItem item, ItemImageInfo image)
{
if (item == null)
var supportedEnhancers = GetSupportedEnhancers(item, image.Type);

return GetImageCacheTag(item, image, supportedEnhancers);
}

public string GetImageCacheTag(BaseItem item, ChapterInfo chapter)
{
try
{
throw new ArgumentNullException("item");
return GetImageCacheTag(item, new ItemImageInfo
{
Path = chapter.ImagePath,
Type = ImageType.Chapter,
DateModified = chapter.ImageDateModified
});
}

if (image == null)
catch
{
throw new ArgumentNullException("image");
return null;
}

var supportedEnhancers = GetSupportedEnhancers(item, image.Type);

return GetImageCacheTag(item, image, supportedEnhancers);
}

/// <summary>
Expand All @@ -543,21 +550,6 @@ public string GetImageCacheTag(BaseItem item, ItemImageInfo image)
/// <exception cref="System.ArgumentNullException">item</exception>
public string GetImageCacheTag(BaseItem item, ItemImageInfo image, IImageEnhancer[] imageEnhancers)
{
if (item == null)
{
throw new ArgumentNullException("item");
}

if (imageEnhancers == null)
{
throw new ArgumentNullException("imageEnhancers");
}

if (image == null)
{
throw new ArgumentNullException("image");
}

var originalImagePath = image.Path;
var dateModified = image.DateModified;
var imageType = image.Type;
Expand Down
4 changes: 2 additions & 2 deletions Emby.Drawing/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Common" version="3.3.49-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.49-beta" targetFramework="net47" />
</packages>
6 changes: 3 additions & 3 deletions Emby.Photos/Emby.Photos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Controller, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
<HintPath>..\packages\MediaBrowser.Common.3.3.49-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
</Reference>
<Reference Include="TagLib.Portable">
<HintPath>..\ThirdParty\taglib\TagLib.Portable.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions Emby.Photos/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.48-beta" targetFramework="net47" />
<package id="MediaBrowser.Common" version="3.3.49-beta" targetFramework="net47" />
<package id="MediaBrowser.Server.Core" version="3.3.49-beta" targetFramework="net47" />
</packages>
9 changes: 8 additions & 1 deletion Emby.Server.Implementations/ApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ protected void RegisterResources()
ZipClient = new ZipClient(FileSystemManager);
RegisterSingleInstance(ZipClient);

HttpResultFactory = new HttpResultFactory(LogManager, FileSystemManager, JsonSerializer);
HttpResultFactory = new HttpResultFactory(LogManager, FileSystemManager, JsonSerializer, CreateBrotliCompressor());
RegisterSingleInstance(HttpResultFactory);

RegisterSingleInstance<IServerApplicationHost>(this);
Expand Down Expand Up @@ -1091,6 +1091,11 @@ protected void RegisterResources()
((UserManager)UserManager).Initialize();
}

protected virtual IBrotliCompressor CreateBrotliCompressor()
{
return null;
}

private static Func<string, object> GetParseFn(Type propertyType)
{
return s => JsvReader.GetParseFn(propertyType)(s);
Expand Down Expand Up @@ -1361,6 +1366,8 @@ private void ConfigureNotificationsRepository()
/// </summary>
private void SetStaticProperties()
{
((SqliteItemRepository)ItemRepository).ImageProcessor = ImageProcessor;

// For now there's no real way to inject these properly
BaseItem.Logger = LogManager.GetLogger("BaseItem");
BaseItem.ConfigurationManager = ServerConfigurationManager;
Expand Down
17 changes: 8 additions & 9 deletions Emby.Server.Implementations/Channels/ChannelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ private async Task<Channel> GetChannel(IChannel channelInfo, CancellationToken c

item.OfficialRating = GetOfficialRating(channelInfo.ParentalRating);
item.Overview = channelInfo.Description;
item.HomePageUrl = channelInfo.HomePageUrl;

if (string.IsNullOrWhiteSpace(item.Name))
{
Expand Down Expand Up @@ -1023,7 +1022,6 @@ private BaseItem GetChannelItemEntity(ChannelItemInfo info, IChannel channelProv
item.OfficialRating = info.OfficialRating;
item.DateCreated = info.DateCreated ?? DateTime.UtcNow;
item.Tags = info.Tags.ToArray(info.Tags.Count);
item.HomePageUrl = info.HomePageUrl;
item.OriginalTitle = info.OriginalTitle;
}
else if (info.Type == ChannelItemType.Folder && info.FolderType == ChannelFolderType.Container)
Expand Down Expand Up @@ -1066,12 +1064,13 @@ private BaseItem GetChannelItemEntity(ChannelItemInfo info, IChannel channelProv
forceUpdate = true;
}

if (!string.Equals(item.ExternalEtag ?? string.Empty, info.Etag ?? string.Empty, StringComparison.Ordinal))
{
item.ExternalEtag = info.Etag;
forceUpdate = true;
_logger.Debug("Forcing update due to ExternalEtag {0}", item.Name);
}
// was used for status
//if (!string.Equals(item.ExternalEtag ?? string.Empty, info.Etag ?? string.Empty, StringComparison.Ordinal))
//{
// item.ExternalEtag = info.Etag;
// forceUpdate = true;
// _logger.Debug("Forcing update due to ExternalEtag {0}", item.Name);
//}

if (!internalChannelId.Equals(item.ChannelId))
{
Expand All @@ -1087,7 +1086,7 @@ private BaseItem GetChannelItemEntity(ChannelItemInfo info, IChannel channelProv
}
item.ParentId = parentFolderId;

var hasSeries = item as IHasSeries;
var hasSeries = item as IHasSeriesName;
if (hasSeries != null)
{
if (!string.Equals(hasSeries.SeriesName, info.SeriesName, StringComparison.OrdinalIgnoreCase))
Expand Down
Loading

0 comments on commit 6c1b3d7

Please sign in to comment.