Conflicts:
	SharedVersion.cs
pull/702/head
Luke Pulverenti 10 years ago
commit c48458f215

@ -102,7 +102,7 @@ namespace MediaBrowser.Api
private readonly IHttpClient _httpClient;
private readonly INetworkManager _netManager;
private readonly IJsonSerializer _serializer;
private const string MbAdminUrl = "http://www.mb3admin.com/admin/";
private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
public PackageReviewService(IHttpClient client, INetworkManager net, IJsonSerializer serializer)
{

@ -135,7 +135,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
request.Referer = options.Referer;
}
request.ServicePoint.BindIPEndPointDelegate = BindIPEndPointCallback;
//request.ServicePoint.BindIPEndPointDelegate = BindIPEndPointCallback;
return request;
}

@ -17,7 +17,7 @@ namespace MediaBrowser.Common.Implementations.Security
/// </summary>
public class PluginSecurityManager : ISecurityManager
{
private const string MbAdminUrl = "http://www.mb3admin.com/admin/";
private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
private const string MBValidateUrl = MbAdminUrl + "service/registration/validate";

@ -172,7 +172,7 @@ namespace MediaBrowser.Common.Implementations.Updates
}
private Tuple<List<PackageInfo>, DateTime> _lastPackageListResult;
private const string MbAdminUrl = "http://www.mb3admin.com/admin/";
private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
/// <summary>
/// Gets all available packages.

@ -602,118 +602,6 @@ namespace MediaBrowser.Controller.Entities
return PlayAccess.Full;
}
/// <summary>
/// Loads local trailers from the file system
/// </summary>
/// <returns>List{Video}.</returns>
private IEnumerable<Trailer> LoadLocalTrailers(List<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService)
{
var files = fileSystemChildren.OfType<DirectoryInfo>()
.Where(i => string.Equals(i.Name, TrailerFolderName, StringComparison.OrdinalIgnoreCase))
.SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
.ToList();
var extraTypes = new List<ExtraType> { ExtraType.Trailer };
var suffixes = ExtraSuffixes.Where(i => extraTypes.Contains(i.Value))
.Select(i => i.Key)
.ToList();
files.AddRange(fileSystemChildren.OfType<FileInfo>()
.Where(i =>
{
var nameEithoutExtension = FileSystem.GetFileNameWithoutExtension(i);
if (!suffixes.Any(s => nameEithoutExtension.EndsWith(s, StringComparison.OrdinalIgnoreCase)))
{
return false;
}
return !string.Equals(Path, i.FullName, StringComparison.OrdinalIgnoreCase);
}));
return LibraryManager.ResolvePaths<Trailer>(files, directoryService, null).Select(video =>
{
// Try to retrieve it from the db. If we don't find it, use the resolved version
var dbItem = LibraryManager.GetItemById(video.Id) as Trailer;
if (dbItem != null)
{
video = dbItem;
}
if (video != null)
{
video.ExtraType = ExtraType.Trailer;
}
return video;
// Sort them so that the list can be easily compared for changes
}).OrderBy(i => i.Path).ToList();
}
protected IEnumerable<Video> LoadSpecialFeatures(List<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService)
{
var files = fileSystemChildren.OfType<DirectoryInfo>()
.Where(i => string.Equals(i.Name, "extras", StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, "specials", StringComparison.OrdinalIgnoreCase))
.SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
.ToList();
var extraTypes = new List<ExtraType> { ExtraType.BehindTheScenes, ExtraType.DeletedScene, ExtraType.Interview, ExtraType.Sample, ExtraType.Scene, ExtraType.Clip };
var suffixes = ExtraSuffixes.Where(i => extraTypes.Contains(i.Value))
.Select(i => i.Key)
.ToList();
files.AddRange(fileSystemChildren.OfType<FileInfo>()
.Where(i =>
{
var nameEithoutExtension = FileSystem.GetFileNameWithoutExtension(i);
if (!suffixes.Any(s => nameEithoutExtension.EndsWith(s, StringComparison.OrdinalIgnoreCase)))
{
return false;
}
return !string.Equals(Path, i.FullName, StringComparison.OrdinalIgnoreCase);
}));
return LibraryManager.ResolvePaths<Video>(files, directoryService, null).Select(video =>
{
// Try to retrieve it from the db. If we don't find it, use the resolved version
var dbItem = LibraryManager.GetItemById(video.Id) as Video;
if (dbItem != null)
{
video = dbItem;
}
if (video != null)
{
SetExtraTypeFromFilename(video);
}
return video;
// Sort them so that the list can be easily compared for changes
}).OrderBy(i => i.Path).ToList();
}
private void SetExtraTypeFromFilename(Video item)
{
var name = System.IO.Path.GetFileNameWithoutExtension(item.Path) ?? string.Empty;
foreach (var suffix in ExtraSuffixes)
{
if (name.EndsWith(suffix.Key, StringComparison.OrdinalIgnoreCase))
{
item.ExtraType = suffix.Value;
return;
}
}
item.ExtraType = ExtraType.Clip;
}
/// <summary>
/// Loads the theme songs.
/// </summary>
@ -879,7 +767,8 @@ namespace MediaBrowser.Controller.Entities
private async Task<bool> RefreshLocalTrailers(IHasTrailers item, MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
{
var newItems = LoadLocalTrailers(fileSystemChildren, options.DirectoryService).ToList();
var newItems = LibraryManager.FindTrailers(this, fileSystemChildren, options.DirectoryService).ToList();
var newItemIds = newItems.Select(i => i.Id).ToList();
var itemsChanged = !item.LocalTrailerIds.SequenceEqual(newItemIds);

@ -1,5 +1,4 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Progress;
using MediaBrowser.Common.Progress;
using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization;

@ -119,7 +119,7 @@ namespace MediaBrowser.Controller.Entities.Movies
private async Task<bool> RefreshSpecialFeatures(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)
{
var newItems = LoadSpecialFeatures(fileSystemChildren, options.DirectoryService).ToList();
var newItems = LibraryManager.FindExtras(this, fileSystemChildren, options.DirectoryService).ToList();
var newItemIds = newItems.Select(i => i.Id).ToList();
var itemsChanged = !SpecialFeatureIds.SequenceEqual(newItemIds);

@ -229,46 +229,6 @@ namespace MediaBrowser.Controller.Library
/// <returns>BaseItem.</returns>
BaseItem RetrieveItem(Guid id);
/// <summary>
/// Validates the artists.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>
/// <returns>Task.</returns>
Task ValidateArtists(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
/// Validates the music genres.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>
/// <returns>Task.</returns>
Task ValidateMusicGenres(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
/// Validates the game genres.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>
/// <returns>Task.</returns>
Task ValidateGameGenres(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
/// Validates the genres.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>
/// <returns>Task.</returns>
Task ValidateGenres(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
/// Validates the studios.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>
/// <returns>Task.</returns>
Task ValidateStudios(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
/// Occurs when [item added].
/// </summary>
@ -422,5 +382,25 @@ namespace MediaBrowser.Controller.Library
/// <param name="type">The type.</param>
/// <returns>Guid.</returns>
Guid GetNewItemId(string key, Type type);
/// <summary>
/// Finds the trailers.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="fileSystemChildren">The file system children.</param>
/// <param name="directoryService">The directory service.</param>
/// <returns>IEnumerable&lt;Trailer&gt;.</returns>
IEnumerable<Trailer> FindTrailers(BaseItem owner, List<FileSystemInfo> fileSystemChildren,
IDirectoryService directoryService);
/// <summary>
/// Finds the extras.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="fileSystemChildren">The file system children.</param>
/// <param name="directoryService">The directory service.</param>
/// <returns>IEnumerable&lt;Video&gt;.</returns>
IEnumerable<Video> FindExtras(BaseItem owner, List<FileSystemInfo> fileSystemChildren,
IDirectoryService directoryService);
}
}

@ -111,7 +111,7 @@ namespace MediaBrowser.Dlna.Didl
}
}
AddCover(item, element);
AddCover(item, null, element);
return element;
}
@ -469,7 +469,7 @@ namespace MediaBrowser.Dlna.Didl
AddCommonFields(folder, stubType, null, container, filter);
AddCover(folder, container);
AddCover(folder, stubType, container);
return container;
}
@ -750,8 +750,14 @@ namespace MediaBrowser.Dlna.Didl
}
}
private void AddCover(BaseItem item, XmlElement element)
private void AddCover(BaseItem item, StubType? stubType, XmlElement element)
{
if (stubType.HasValue && stubType.Value == StubType.People)
{
AddEmbeddedImageAsCover("people", element);
return;
}
var imageInfo = GetImageInfo(item);
if (imageInfo == null)
@ -810,6 +816,22 @@ namespace MediaBrowser.Dlna.Didl
}
}
private void AddEmbeddedImageAsCover(string name, XmlElement element)
{
var result = element.OwnerDocument;
var icon = result.CreateElement("upnp", "albumArtURI", NS_UPNP);
var profile = result.CreateAttribute("dlna", "profileID", NS_DLNA);
profile.InnerText = _profile.AlbumArtPn;
icon.SetAttributeNode(profile);
icon.InnerText = _serverAddress + "/Dlna/icons/people480.jpg";
element.AppendChild(icon);
icon = result.CreateElement("upnp", "icon", NS_UPNP);
icon.InnerText = _serverAddress + "/Dlna/icons/people48.jpg";
element.AppendChild(icon);
}
private void AddImageResElement(BaseItem item,
XmlElement element,
int maxWidth,

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

@ -198,6 +198,14 @@
<ItemGroup>
<EmbeddedResource Include="Profiles\Xml\Popcorn Hour.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Images\people48.jpg" />
<EmbeddedResource Include="Images\people48.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Images\people480.jpg" />
<EmbeddedResource Include="Images\people480.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

@ -18,7 +18,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
{
public class RemoteNotifications : IServerEntryPoint
{
private const string Url = "http://www.mb3admin.com/admin/service/MB3ServerNotifications.json";
private const string Url = "https://www.mb3admin.com/admin/service/MB3ServerNotifications.json";
private Timer _timer;
private readonly IHttpClient _httpClient;

@ -12,7 +12,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
private readonly IApplicationHost _applicationHost;
private readonly INetworkManager _networkManager;
private readonly IHttpClient _httpClient;
private const string MbAdminUrl = "http://www.mb3admin.com/admin/";
private const string MbAdminUrl = "https://www.mb3admin.com/admin/";
public UsageReporter(IApplicationHost applicationHost, INetworkManager networkManager, IHttpClient httpClient)
{

@ -1736,5 +1736,113 @@ namespace MediaBrowser.Server.Implementations.Library
return new List<FileSystemInfo>();
}
public IEnumerable<Trailer> FindTrailers(BaseItem owner, List<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService)
{
var files = fileSystemChildren.OfType<DirectoryInfo>()
.Where(i => string.Equals(i.Name, BaseItem.TrailerFolderName, StringComparison.OrdinalIgnoreCase))
.SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
.ToList();
var extraTypes = new List<ExtraType> { ExtraType.Trailer };
var suffixes = BaseItem.ExtraSuffixes.Where(i => extraTypes.Contains(i.Value))
.Select(i => i.Key)
.ToList();
files.AddRange(fileSystemChildren.OfType<FileInfo>()
.Where(i =>
{
var nameEithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);
if (!suffixes.Any(s => nameEithoutExtension.EndsWith(s, StringComparison.OrdinalIgnoreCase)))
{
return false;
}
return !string.Equals(owner.Path, i.FullName, StringComparison.OrdinalIgnoreCase);
}));
return ResolvePaths<Trailer>(files, directoryService, null).Select(video =>
{
// Try to retrieve it from the db. If we don't find it, use the resolved version
var dbItem = GetItemById(video.Id) as Trailer;
if (dbItem != null)
{
video = dbItem;
}
if (video != null)
{
video.ExtraType = ExtraType.Trailer;
}
return video;
// Sort them so that the list can be easily compared for changes
}).OrderBy(i => i.Path).ToList();
}
public IEnumerable<Video> FindExtras(BaseItem owner, List<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService)
{
var files = fileSystemChildren.OfType<DirectoryInfo>()
.Where(i => string.Equals(i.Name, "extras", StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, "specials", StringComparison.OrdinalIgnoreCase))
.SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
.ToList();
var extraTypes = new List<ExtraType> { ExtraType.BehindTheScenes, ExtraType.DeletedScene, ExtraType.Interview, ExtraType.Sample, ExtraType.Scene, ExtraType.Clip };
var suffixes = BaseItem.ExtraSuffixes.Where(i => extraTypes.Contains(i.Value))
.Select(i => i.Key)
.ToList();
files.AddRange(fileSystemChildren.OfType<FileInfo>()
.Where(i =>
{
var nameEithoutExtension = _fileSystem.GetFileNameWithoutExtension(i);
if (!suffixes.Any(s => nameEithoutExtension.EndsWith(s, StringComparison.OrdinalIgnoreCase)))
{
return false;
}
return !string.Equals(owner.Path, i.FullName, StringComparison.OrdinalIgnoreCase);
}));
return ResolvePaths<Video>(files, directoryService, null).Select(video =>
{
// Try to retrieve it from the db. If we don't find it, use the resolved version
var dbItem = GetItemById(video.Id) as Video;
if (dbItem != null)
{
video = dbItem;
}
if (video != null)
{
SetExtraTypeFromFilename(video);
}
return video;
// Sort them so that the list can be easily compared for changes
}).OrderBy(i => i.Path).ToList();
}
private void SetExtraTypeFromFilename(Video item)
{
var name = System.IO.Path.GetFileNameWithoutExtension(item.Path) ?? string.Empty;
foreach (var suffix in BaseItem.ExtraSuffixes)
{
if (name.EndsWith(suffix.Key, StringComparison.OrdinalIgnoreCase))
{
item.ExtraType = suffix.Value;
return;
}
}
item.ExtraType = ExtraType.Clip;
}
}
}

@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
return _libraryManager.ValidateArtists(cancellationToken, progress);
return ((LibraryManager)_libraryManager).ValidateArtists(cancellationToken, progress);
}
}
}

@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
return _libraryManager.ValidateGameGenres(cancellationToken, progress);
return ((LibraryManager)_libraryManager).ValidateGameGenres(cancellationToken, progress);
}
}
}

@ -29,7 +29,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
return _libraryManager.ValidateGenres(cancellationToken, progress);
return ((LibraryManager)_libraryManager).ValidateGenres(cancellationToken, progress);
}
}
}

@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
return _libraryManager.ValidateMusicGenres(cancellationToken, progress);
return ((LibraryManager)_libraryManager).ValidateMusicGenres(cancellationToken, progress);
}
}
}

@ -32,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
/// <returns>Task.</returns>
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
return _libraryManager.ValidateStudios(cancellationToken, progress);
return ((LibraryManager)_libraryManager).ValidateStudios(cancellationToken, progress);
}
}
}

Loading…
Cancel
Save