commit
0fd99d2d08
|
@ -245,12 +245,8 @@ namespace MediaBrowser.Api
|
|||
|
||||
item.OriginalTitle = string.IsNullOrWhiteSpace(request.OriginalTitle) ? null : request.OriginalTitle;
|
||||
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
if (hasCriticRating != null)
|
||||
{
|
||||
hasCriticRating.CriticRating = request.CriticRating;
|
||||
hasCriticRating.CriticRatingSummary = request.CriticRatingSummary;
|
||||
}
|
||||
item.CriticRating = request.CriticRating;
|
||||
item.CriticRatingSummary = request.CriticRatingSummary;
|
||||
|
||||
item.DisplayMediaType = request.DisplayMediaType;
|
||||
item.CommunityRating = request.CommunityRating;
|
||||
|
@ -279,11 +275,7 @@ namespace MediaBrowser.Api
|
|||
item.Tagline = request.Taglines.FirstOrDefault();
|
||||
}
|
||||
|
||||
var hasShortOverview = item as IHasShortOverview;
|
||||
if (hasShortOverview != null)
|
||||
{
|
||||
hasShortOverview.ShortOverview = request.ShortOverview;
|
||||
}
|
||||
item.ShortOverview = request.ShortOverview;
|
||||
|
||||
item.Keywords = request.Keywords;
|
||||
|
||||
|
|
|
@ -886,7 +886,6 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
|
||||
var mapArgs = state.IsOutputVideo ? GetMapArgs(state) : string.Empty;
|
||||
var enableSplittingOnNonKeyFrames = state.VideoRequest.EnableSplittingOnNonKeyFrames && string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase);
|
||||
enableSplittingOnNonKeyFrames = false;
|
||||
|
||||
// TODO: check libavformat version for 57 50.100 and use -hls_flags split_by_time
|
||||
var hlsProtocolSupportsSplittingByTime = false;
|
||||
|
|
|
@ -127,7 +127,9 @@ namespace MediaBrowser.Common.Implementations.Logging
|
|||
{
|
||||
for (var i = 0; i < paramList.Length; i++)
|
||||
{
|
||||
message = message.Replace("{" + i + "}", paramList[i].ToString());
|
||||
var obj = paramList[i];
|
||||
|
||||
message = message.Replace("{" + i + "}", (obj == null ? "null" : obj.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <summary>
|
||||
/// Class BaseItem
|
||||
/// </summary>
|
||||
public abstract class BaseItem : IHasProviderIds, ILibraryItem, IHasImages, IHasUserData, IHasMetadata, IHasLookupInfo<ItemLookupInfo>
|
||||
public abstract class BaseItem : IHasProviderIds, IHasImages, IHasUserData, IHasMetadata, IHasLookupInfo<ItemLookupInfo>
|
||||
{
|
||||
protected BaseItem()
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// Plugins derive from and export this class to create a folder that will appear in the root along
|
||||
/// with all the other actual physical folders in the system.
|
||||
/// </summary>
|
||||
public abstract class BasePluginFolder : Folder, ICollectionFolder, IByReferenceItem
|
||||
public abstract class BasePluginFolder : Folder, ICollectionFolder
|
||||
{
|
||||
public virtual string CollectionType
|
||||
{
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a marker class that tells us that a particular item type may be physically resolved
|
||||
/// more than once within the library and we need to be sure to resolve them all to the same
|
||||
/// instance of that item.
|
||||
/// </summary>
|
||||
public interface IByReferenceItem
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IHasCriticRating
|
||||
/// </summary>
|
||||
public interface IHasCriticRating
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the critic rating.
|
||||
/// </summary>
|
||||
/// <value>The critic rating.</value>
|
||||
float? CriticRating { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the critic rating summary.
|
||||
/// </summary>
|
||||
/// <value>The critic rating summary.</value>
|
||||
string CriticRatingSummary { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public interface IHasShortOverview
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the short overview.
|
||||
/// </summary>
|
||||
/// <value>The short overview.</value>
|
||||
string ShortOverview { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface ILibraryItem
|
||||
/// </summary>
|
||||
public interface ILibraryItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the id.
|
||||
/// </summary>
|
||||
/// <value>The id.</value>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path.
|
||||
/// </summary>
|
||||
/// <value>The path.</value>
|
||||
string Path { get; }
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public class ImageSourceInfo
|
||||
{
|
||||
public Guid ImagePathMD5 { get; set; }
|
||||
public Guid ImageUrlMD5 { get; set; }
|
||||
}
|
||||
}
|
|
@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||
/// <summary>
|
||||
/// Class Movie
|
||||
/// </summary>
|
||||
public class Movie : Video, IHasCriticRating, IHasSpecialFeatures, IHasBudget, IHasTrailers, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping, IHasOriginalTitle
|
||||
public class Movie : Video, IHasSpecialFeatures, IHasBudget, IHasTrailers, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping, IHasOriginalTitle
|
||||
{
|
||||
public List<Guid> SpecialFeatureIds { get; set; }
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <summary>
|
||||
/// Class Trailer
|
||||
/// </summary>
|
||||
public class Trailer : Video, IHasCriticRating, IHasBudget, IHasMetascore, IHasOriginalTitle, IHasLookupInfo<TrailerInfo>
|
||||
public class Trailer : Video, IHasBudget, IHasMetascore, IHasOriginalTitle, IHasLookupInfo<TrailerInfo>
|
||||
{
|
||||
public Trailer()
|
||||
{
|
||||
|
|
|
@ -1668,16 +1668,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
{
|
||||
var val = query.MinCriticRating.Value;
|
||||
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
|
||||
if (hasCriticRating != null)
|
||||
{
|
||||
if (!(hasCriticRating.CriticRating.HasValue && hasCriticRating.CriticRating >= val))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!(item.CriticRating.HasValue && item.CriticRating >= val))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace MediaBrowser.Controller.Entities
|
|||
IHasAspectRatio,
|
||||
ISupportsPlaceHolders,
|
||||
IHasMediaSources,
|
||||
IHasShortOverview,
|
||||
IThemeMedia
|
||||
{
|
||||
[IgnoreDataMember]
|
||||
|
|
|
@ -78,14 +78,17 @@ namespace MediaBrowser.Controller.LiveTv
|
|||
|
||||
protected override string CreateSortName()
|
||||
{
|
||||
double number = 0;
|
||||
|
||||
if (!string.IsNullOrEmpty(Number))
|
||||
{
|
||||
double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out number);
|
||||
double number = 0;
|
||||
|
||||
if (double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out number))
|
||||
{
|
||||
return number.ToString("00000-") + (Name ?? string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
return number.ToString("00000-") + (Name ?? string.Empty);
|
||||
return Number + "-" + (Name ?? string.Empty);
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
|
|
|
@ -132,10 +132,8 @@
|
|||
<Compile Include="Entities\Game.cs" />
|
||||
<Compile Include="Entities\GameGenre.cs" />
|
||||
<Compile Include="Entities\GameSystem.cs" />
|
||||
<Compile Include="Entities\IByReferenceItem.cs" />
|
||||
<Compile Include="Entities\IHasAspectRatio.cs" />
|
||||
<Compile Include="Entities\IHasBudget.cs" />
|
||||
<Compile Include="Entities\IHasCriticRating.cs" />
|
||||
<Compile Include="Entities\IHasDisplayOrder.cs" />
|
||||
<Compile Include="Entities\IHasId.cs" />
|
||||
<Compile Include="Entities\IHasImages.cs" />
|
||||
|
@ -146,15 +144,12 @@
|
|||
<Compile Include="Entities\IHasProgramAttributes.cs" />
|
||||
<Compile Include="Entities\IHasScreenshots.cs" />
|
||||
<Compile Include="Entities\IHasSeries.cs" />
|
||||
<Compile Include="Entities\IHasShortOverview.cs" />
|
||||
<Compile Include="Entities\IHasSpecialFeatures.cs" />
|
||||
<Compile Include="Entities\IHasStartDate.cs" />
|
||||
<Compile Include="Entities\IHasTrailers.cs" />
|
||||
<Compile Include="Entities\IHasUserData.cs" />
|
||||
<Compile Include="Entities\IHiddenFromDisplay.cs" />
|
||||
<Compile Include="Entities\IItemByName.cs" />
|
||||
<Compile Include="Entities\ILibraryItem.cs" />
|
||||
<Compile Include="Entities\ImageSourceInfo.cs" />
|
||||
<Compile Include="Entities\IMetadataContainer.cs" />
|
||||
<Compile Include="Entities\InternalItemsQuery.cs" />
|
||||
<Compile Include="Entities\InternalPeopleQuery.cs" />
|
||||
|
|
|
@ -185,14 +185,12 @@ namespace MediaBrowser.Controller.Providers
|
|||
{
|
||||
var text = reader.ReadElementContentAsString();
|
||||
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
|
||||
if (hasCriticRating != null && !string.IsNullOrEmpty(text))
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
float value;
|
||||
if (float.TryParse(text, NumberStyles.Any, _usCulture, out value))
|
||||
{
|
||||
hasCriticRating.CriticRating = value;
|
||||
item.CriticRating = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -292,12 +290,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
var hasShortOverview = item as IHasShortOverview;
|
||||
|
||||
if (hasShortOverview != null)
|
||||
{
|
||||
hasShortOverview.ShortOverview = val;
|
||||
}
|
||||
item.ShortOverview = val;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -309,12 +302,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
|
||||
if (hasCriticRating != null)
|
||||
{
|
||||
hasCriticRating.CriticRatingSummary = val;
|
||||
}
|
||||
item.CriticRatingSummary = val;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -12,7 +12,6 @@ namespace MediaBrowser.Controller.Providers
|
|||
public Stream Stream { get; set; }
|
||||
public ImageFormat Format { get; set; }
|
||||
public bool HasImage { get; set; }
|
||||
public string InternalCacheKey { get; set; }
|
||||
|
||||
public void SetFormatFromMimeType(string mimeType)
|
||||
{
|
||||
|
|
|
@ -69,28 +69,8 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <summary>
|
||||
/// Saves the image.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <param name="mimeType">Type of the MIME.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="internalCacheKey">The internal cache key.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Saves the image.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <param name="mimeType">Type of the MIME.</param>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="imageIndex">Index of the image.</param>
|
||||
/// <param name="internalCacheKey">The internal cache key.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken);
|
||||
Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the metadata providers.
|
||||
|
|
|
@ -585,10 +585,9 @@ namespace MediaBrowser.Dlna.Didl
|
|||
{
|
||||
var desc = item.Overview;
|
||||
|
||||
var hasShortOverview = item as IHasShortOverview;
|
||||
if (hasShortOverview != null && !string.IsNullOrEmpty(hasShortOverview.ShortOverview))
|
||||
if (!string.IsNullOrEmpty(item.ShortOverview))
|
||||
{
|
||||
desc = hasShortOverview.ShortOverview;
|
||||
desc = item.ShortOverview;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(desc))
|
||||
|
|
|
@ -258,18 +258,14 @@ namespace MediaBrowser.LocalMetadata.Savers
|
|||
builder.Append("<Type>" + SecurityElement.Escape(item.DisplayMediaType) + "</Type>");
|
||||
}
|
||||
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
if (hasCriticRating != null)
|
||||
if (item.CriticRating.HasValue)
|
||||
{
|
||||
if (hasCriticRating.CriticRating.HasValue)
|
||||
{
|
||||
builder.Append("<CriticRating>" + SecurityElement.Escape(hasCriticRating.CriticRating.Value.ToString(UsCulture)) + "</CriticRating>");
|
||||
builder.Append("<CriticRating>" + SecurityElement.Escape(item.CriticRating.Value.ToString(UsCulture)) + "</CriticRating>");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(hasCriticRating.CriticRatingSummary))
|
||||
if (!string.IsNullOrEmpty(item.CriticRatingSummary))
|
||||
{
|
||||
builder.Append("<CriticRatingSummary><![CDATA[" + hasCriticRating.CriticRatingSummary + "]]></CriticRatingSummary>");
|
||||
}
|
||||
builder.Append("<CriticRatingSummary><![CDATA[" + item.CriticRatingSummary + "]]></CriticRatingSummary>");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(item.Overview))
|
||||
|
@ -286,13 +282,9 @@ namespace MediaBrowser.LocalMetadata.Savers
|
|||
}
|
||||
}
|
||||
|
||||
var hasShortOverview = item as IHasShortOverview;
|
||||
if (hasShortOverview != null)
|
||||
if (!string.IsNullOrEmpty(item.ShortOverview))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(hasShortOverview.ShortOverview))
|
||||
{
|
||||
builder.Append("<ShortOverview><![CDATA[" + hasShortOverview.ShortOverview + "]]></ShortOverview>");
|
||||
}
|
||||
builder.Append("<ShortOverview><![CDATA[" + item.ShortOverview + "]]></ShortOverview>");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(item.CustomRating))
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return SaveImage(item, source, mimeType, type, imageIndex, null, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken)
|
||||
public async Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(mimeType))
|
||||
{
|
||||
|
@ -109,9 +109,9 @@ namespace MediaBrowser.Providers.Manager
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(internalCacheKey))
|
||||
if (saveLocallyWithMedia.HasValue && !saveLocallyWithMedia.Value)
|
||||
{
|
||||
saveLocally = false;
|
||||
saveLocally = saveLocallyWithMedia.Value;
|
||||
}
|
||||
|
||||
if (!imageIndex.HasValue && item.AllowsMultipleImages(type))
|
||||
|
|
|
@ -156,14 +156,14 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
var stream = _fileSystem.GetFileStream(response.Path, FileMode.Open, FileAccess.Read, FileShare.Read, true);
|
||||
|
||||
await _providerManager.SaveImage(item, stream, mimeType, imageType, null, response.InternalCacheKey, cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage(item, stream, mimeType, imageType, null, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var mimeType = "image/" + response.Format.ToString().ToLower();
|
||||
|
||||
await _providerManager.SaveImage(item, response.Stream, mimeType, imageType, null, response.InternalCacheKey, cancellationToken).ConfigureAwait(false);
|
||||
await _providerManager.SaveImage(item, response.Stream, mimeType, imageType, null, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
downloadedImages.Add(imageType);
|
||||
|
|
|
@ -353,8 +353,6 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
var updateType = ItemUpdateType.None;
|
||||
|
||||
if (isFullRefresh || currentUpdateType > ItemUpdateType.None)
|
||||
{
|
||||
var folder = item as Folder;
|
||||
if (folder != null && folder.SupportsDateLastMediaAdded)
|
||||
{
|
||||
|
@ -364,8 +362,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
if ((!folder.DateLastMediaAdded.HasValue && date.HasValue) || folder.DateLastMediaAdded != date)
|
||||
{
|
||||
folder.DateLastMediaAdded = date;
|
||||
updateType = ItemUpdateType.MetadataEdit;
|
||||
}
|
||||
updateType = ItemUpdateType.MetadataImport;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -140,12 +140,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger, _memoryStreamProvider).SaveImage(item, source, mimeType, type, imageIndex, cancellationToken);
|
||||
}
|
||||
|
||||
public Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken)
|
||||
{
|
||||
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger, _memoryStreamProvider).SaveImage(item, source, mimeType, type, imageIndex, internalCacheKey, cancellationToken);
|
||||
}
|
||||
|
||||
public Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken)
|
||||
public Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(source))
|
||||
{
|
||||
|
@ -154,7 +149,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
var fileStream = _fileSystem.GetFileStream(source, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true);
|
||||
|
||||
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger, _memoryStreamProvider).SaveImage(item, fileStream, mimeType, type, imageIndex, internalCacheKey, cancellationToken);
|
||||
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger, _memoryStreamProvider).SaveImage(item, fileStream, mimeType, type, imageIndex, saveLocallyWithMedia, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<RemoteImageInfo>> GetAvailableRemoteImages(IHasImages item, RemoteImageQuery query, CancellationToken cancellationToken)
|
||||
|
|
|
@ -236,15 +236,9 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
private static void MergeShortOverview(BaseItem source, BaseItem target, List<MetadataFields> lockedFields, bool replaceData)
|
||||
{
|
||||
var sourceHasShortOverview = source as IHasShortOverview;
|
||||
var targetHasShortOverview = target as IHasShortOverview;
|
||||
|
||||
if (sourceHasShortOverview != null && targetHasShortOverview != null)
|
||||
if (replaceData || string.IsNullOrEmpty(target.ShortOverview))
|
||||
{
|
||||
if (replaceData || string.IsNullOrEmpty(targetHasShortOverview.ShortOverview))
|
||||
{
|
||||
targetHasShortOverview.ShortOverview = sourceHasShortOverview.ShortOverview;
|
||||
}
|
||||
target.ShortOverview = source.ShortOverview;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -311,20 +305,14 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
private static void MergeCriticRating(BaseItem source, BaseItem target, List<MetadataFields> lockedFields, bool replaceData)
|
||||
{
|
||||
var sourceCast = source as IHasCriticRating;
|
||||
var targetCast = target as IHasCriticRating;
|
||||
|
||||
if (sourceCast != null && targetCast != null)
|
||||
if (replaceData || !target.CriticRating.HasValue)
|
||||
{
|
||||
if (replaceData || !targetCast.CriticRating.HasValue)
|
||||
{
|
||||
targetCast.CriticRating = sourceCast.CriticRating;
|
||||
target.CriticRating = source.CriticRating;
|
||||
}
|
||||
|
||||
if (replaceData || string.IsNullOrEmpty(targetCast.CriticRatingSummary))
|
||||
if (replaceData || string.IsNullOrEmpty(target.CriticRatingSummary))
|
||||
{
|
||||
targetCast.CriticRatingSummary = sourceCast.CriticRatingSummary;
|
||||
}
|
||||
target.CriticRatingSummary = source.CriticRatingSummary;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,9 +66,6 @@ namespace MediaBrowser.Providers.Omdb
|
|||
item.ProductionYear = year;
|
||||
}
|
||||
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
if (hasCriticRating != null)
|
||||
{
|
||||
// Seeing some bogus RT data on omdb for series, so filter it out here
|
||||
// RT doesn't even have tv series
|
||||
int tomatoMeter;
|
||||
|
@ -77,14 +74,13 @@ namespace MediaBrowser.Providers.Omdb
|
|||
&& int.TryParse(result.tomatoMeter, NumberStyles.Integer, _usCulture, out tomatoMeter)
|
||||
&& tomatoMeter >= 0)
|
||||
{
|
||||
hasCriticRating.CriticRating = tomatoMeter;
|
||||
item.CriticRating = tomatoMeter;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(result.tomatoConsensus)
|
||||
&& !string.Equals(result.tomatoConsensus, "No consensus yet.", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
hasCriticRating.CriticRatingSummary = WebUtility.HtmlDecode(result.tomatoConsensus);
|
||||
}
|
||||
item.CriticRatingSummary = WebUtility.HtmlDecode(result.tomatoConsensus);
|
||||
}
|
||||
|
||||
int voteCount;
|
||||
|
@ -167,9 +163,6 @@ namespace MediaBrowser.Providers.Omdb
|
|||
item.ProductionYear = year;
|
||||
}
|
||||
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
if (hasCriticRating != null)
|
||||
{
|
||||
// Seeing some bogus RT data on omdb for series, so filter it out here
|
||||
// RT doesn't even have tv series
|
||||
int tomatoMeter;
|
||||
|
@ -178,14 +171,13 @@ namespace MediaBrowser.Providers.Omdb
|
|||
&& int.TryParse(result.tomatoMeter, NumberStyles.Integer, _usCulture, out tomatoMeter)
|
||||
&& tomatoMeter >= 0)
|
||||
{
|
||||
hasCriticRating.CriticRating = tomatoMeter;
|
||||
item.CriticRating = tomatoMeter;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(result.tomatoConsensus)
|
||||
&& !string.Equals(result.tomatoConsensus, "No consensus yet.", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
hasCriticRating.CriticRatingSummary = WebUtility.HtmlDecode(result.tomatoConsensus);
|
||||
}
|
||||
item.CriticRatingSummary = WebUtility.HtmlDecode(result.tomatoConsensus);
|
||||
}
|
||||
|
||||
int voteCount;
|
||||
|
@ -420,12 +412,8 @@ namespace MediaBrowser.Providers.Omdb
|
|||
hasAwards.AwardSummary = WebUtility.HtmlDecode(result.Awards);
|
||||
}
|
||||
|
||||
var hasShortOverview = item as IHasShortOverview;
|
||||
if (hasShortOverview != null)
|
||||
{
|
||||
// Imdb plots are usually pretty short
|
||||
hasShortOverview.ShortOverview = result.Plot;
|
||||
}
|
||||
item.ShortOverview = result.Plot;
|
||||
|
||||
//if (!string.IsNullOrWhiteSpace(result.Director))
|
||||
//{
|
||||
|
|
|
@ -45,6 +45,11 @@ namespace MediaBrowser.Server.Implementations.IO
|
|||
|
||||
private void AddAffectedPath(string path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
}
|
||||
|
||||
if (!_affectedPaths.Contains(path, StringComparer.Ordinal))
|
||||
{
|
||||
_affectedPaths.Add(path);
|
||||
|
@ -53,6 +58,11 @@ namespace MediaBrowser.Server.Implementations.IO
|
|||
|
||||
public void AddPath(string path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
throw new ArgumentNullException("path");
|
||||
}
|
||||
|
||||
lock (_timerLock)
|
||||
{
|
||||
AddAffectedPath(path);
|
||||
|
|
|
@ -2838,7 +2838,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
|
||||
private bool ValidateNetworkPath(string path)
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT || !path.StartsWith("\\\\", StringComparison.OrdinalIgnoreCase))
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||
{
|
||||
return Directory.Exists(path);
|
||||
}
|
||||
|
|
|
@ -207,14 +207,18 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
// Find movies with their own folders
|
||||
if (args.IsDirectory)
|
||||
{
|
||||
var files = args.FileSystemChildren
|
||||
.Where(i => !LibraryManager.IgnoreFile(i, args.Parent))
|
||||
.ToList();
|
||||
|
||||
if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return null;
|
||||
return FindMovie<MusicVideo>(args.Path, args.Parent, files, args.DirectoryService, collectionType, false);
|
||||
}
|
||||
|
||||
if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return null;
|
||||
return FindMovie<Video>(args.Path, args.Parent, files, args.DirectoryService, collectionType, false);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(collectionType))
|
||||
|
@ -222,6 +226,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
// Owned items will be caught by the plain video resolver
|
||||
if (args.Parent == null)
|
||||
{
|
||||
//return FindMovie<Video>(args.Path, args.Parent, files, args.DirectoryService, collectionType);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -231,21 +236,13 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
}
|
||||
|
||||
{
|
||||
var files = args.FileSystemChildren
|
||||
.Where(i => !LibraryManager.IgnoreFile(i, args.Parent))
|
||||
.ToList();
|
||||
|
||||
return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType);
|
||||
return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var files = args.FileSystemChildren
|
||||
.Where(i => !LibraryManager.IgnoreFile(i, args.Parent))
|
||||
.ToList();
|
||||
|
||||
return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType);
|
||||
return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -360,13 +357,8 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
/// Finds a movie based on a child file system entries
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="parent">The parent.</param>
|
||||
/// <param name="fileSystemEntries">The file system entries.</param>
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <param name="collectionType">Type of the collection.</param>
|
||||
/// <returns>Movie.</returns>
|
||||
private T FindMovie<T>(string path, Folder parent, List<FileSystemMetadata> fileSystemEntries, IDirectoryService directoryService, string collectionType)
|
||||
private T FindMovie<T>(string path, Folder parent, List<FileSystemMetadata> fileSystemEntries, IDirectoryService directoryService, string collectionType, bool allowFilesAsFolders)
|
||||
where T : Video, new()
|
||||
{
|
||||
var multiDiscFolders = new List<FileSystemMetadata>();
|
||||
|
@ -413,6 +405,9 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
}
|
||||
}
|
||||
|
||||
if (allowFilesAsFolders)
|
||||
{
|
||||
// TODO: Allow GetMultiDiscMovie in here
|
||||
var supportsMultiVersion = !string.Equals(collectionType, CollectionType.HomeVideos) &&
|
||||
!string.Equals(collectionType, CollectionType.Photos) &&
|
||||
!string.Equals(collectionType, CollectionType.MusicVideos);
|
||||
|
@ -431,6 +426,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
{
|
||||
return GetMultiDiscMovie<T>(multiDiscFolders, directoryService);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1854,23 +1854,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
|||
ParentIndexNumber = program.SeasonNumber.Value,
|
||||
IndexNumber = program.EpisodeNumber.Value,
|
||||
AncestorIds = seriesIds,
|
||||
ExcludeLocationTypes = new[] { LocationType.Virtual }
|
||||
});
|
||||
|
||||
if (result.TotalRecordCount > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(program.EpisodeTitle))
|
||||
{
|
||||
var result = _libraryManager.GetItemsResult(new InternalItemsQuery
|
||||
{
|
||||
IncludeItemTypes = new[] { typeof(Episode).Name },
|
||||
Name = program.EpisodeTitle,
|
||||
AncestorIds = seriesIds,
|
||||
ExcludeLocationTypes = new[] { LocationType.Virtual }
|
||||
IsVirtualItem = false
|
||||
});
|
||||
|
||||
if (result.TotalRecordCount > 0)
|
||||
|
|
|
@ -72,7 +72,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||
{
|
||||
dto.ProgramInfo = _dtoService.GetBaseItemDto(program, new DtoOptions());
|
||||
|
||||
if (info.Status != RecordingStatus.Cancelled && info.Status != RecordingStatus.Error)
|
||||
{
|
||||
dto.ProgramInfo.TimerId = dto.Id;
|
||||
dto.ProgramInfo.Status = info.Status.ToString();
|
||||
}
|
||||
|
||||
dto.ProgramInfo.SeriesTimerId = dto.SeriesTimerId;
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ namespace MediaBrowser.Server.Implementations.Photos
|
|||
return ItemUpdateType.None;
|
||||
}
|
||||
|
||||
await ProviderManager.SaveImage(item, outputPath, "image/png", imageType, null, Guid.NewGuid().ToString("N"), cancellationToken).ConfigureAwait(false);
|
||||
await ProviderManager.SaveImage(item, outputPath, "image/png", imageType, null, false, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return ItemUpdateType.ImageUpdate;
|
||||
}
|
||||
|
|
|
@ -22,9 +22,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||
|
||||
private float GetValue(BaseItem x)
|
||||
{
|
||||
var hasCriticRating = x as IHasCriticRating;
|
||||
|
||||
return hasCriticRating == null ? 0 : hasCriticRating.CriticRating ?? 0;
|
||||
return x.CriticRating ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -294,14 +294,12 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|||
{
|
||||
var text = reader.ReadElementContentAsString();
|
||||
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
|
||||
if (hasCriticRating != null && !string.IsNullOrEmpty(text))
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
float value;
|
||||
if (float.TryParse(text, NumberStyles.Any, _usCulture, out value))
|
||||
{
|
||||
hasCriticRating.CriticRating = value;
|
||||
item.CriticRating = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -388,12 +386,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
var hasShortOverview = item as IHasShortOverview;
|
||||
|
||||
if (hasShortOverview != null)
|
||||
{
|
||||
hasShortOverview.ShortOverview = val;
|
||||
}
|
||||
item.ShortOverview = val;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -418,12 +411,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
var hasCriticRating = item as IHasCriticRating;
|
||||
|
||||
if (hasCriticRating != null)
|
||||
{
|
||||
hasCriticRating.CriticRatingSummary = val;
|
||||
}
|
||||
item.CriticRatingSummary = val;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user