mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 22:38:30 +01:00
update image aspect ratio detection
This commit is contained in:
@@ -32,14 +32,6 @@ namespace MediaBrowser.Controller.Channels
|
||||
return base.IsVisible(user);
|
||||
}
|
||||
|
||||
public override double? GetDefaultPrimaryImageAspectRatio()
|
||||
{
|
||||
double value = 16;
|
||||
value /= 9;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsInheritedParentImages
|
||||
{
|
||||
|
||||
@@ -31,16 +31,9 @@ namespace MediaBrowser.Controller.Drawing
|
||||
/// </summary>
|
||||
/// <param name="info">The information.</param>
|
||||
/// <returns>ImageSize.</returns>
|
||||
ImageSize GetImageSize(ItemImageInfo info);
|
||||
ImageSize GetImageSize(BaseItem item, ItemImageInfo info);
|
||||
|
||||
ImageSize GetImageSize(ItemImageInfo info, bool allowSlowMethods);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the image.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <returns>ImageSize.</returns>
|
||||
ImageSize GetImageSize(string path);
|
||||
ImageSize GetImageSize(BaseItem item, ItemImageInfo info, bool allowSlowMethods, bool updateItem);
|
||||
|
||||
/// <summary>
|
||||
/// Adds the parts.
|
||||
|
||||
@@ -23,14 +23,14 @@ namespace MediaBrowser.Controller.Dto
|
||||
/// </summary>
|
||||
/// <param name="dto">The dto.</param>
|
||||
/// <param name="item">The item.</param>
|
||||
void AttachPrimaryImageAspectRatio(IItemDto dto, IHasMetadata item);
|
||||
void AttachPrimaryImageAspectRatio(IItemDto dto, BaseItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the primary image aspect ratio.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <returns>System.Nullable<System.Double>.</returns>
|
||||
double? GetPrimaryImageAspectRatio(IHasMetadata item);
|
||||
double? GetPrimaryImageAspectRatio(BaseItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base item dto.
|
||||
|
||||
@@ -1952,6 +1952,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
existingImage.Path = image.Path;
|
||||
existingImage.DateModified = image.DateModified;
|
||||
existingImage.Width = image.Width;
|
||||
existingImage.Height = image.Height;
|
||||
}
|
||||
|
||||
else
|
||||
@@ -2268,6 +2270,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
info1.DateModified = FileSystem.GetLastWriteTimeUtc(info1.Path);
|
||||
info2.DateModified = FileSystem.GetLastWriteTimeUtc(info2.Path);
|
||||
|
||||
info1.Width = 0;
|
||||
info1.Height = 0;
|
||||
info2.Width = 0;
|
||||
info2.Height = 0;
|
||||
|
||||
UpdateToRepository(ItemUpdateType.ImageUpdate, CancellationToken.None);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <value>The date modified.</value>
|
||||
public DateTime DateModified { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsLocalFile
|
||||
{
|
||||
|
||||
@@ -30,10 +30,5 @@ namespace MediaBrowser.Controller.Entities
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override double? GetDefaultPrimaryImageAspectRatio()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,14 +78,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public override double? GetDefaultPrimaryImageAspectRatio()
|
||||
{
|
||||
double value = 16;
|
||||
value /= 9;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public override string CreatePresentationUniqueKey()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(PrimaryVersionId))
|
||||
|
||||
@@ -128,6 +128,8 @@ namespace MediaBrowser.Controller.Library
|
||||
/// </summary>
|
||||
void QueueLibraryScan();
|
||||
|
||||
void UpdateImages(BaseItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default view.
|
||||
/// </summary>
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace MediaBrowser.Controller.Persistence
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
void SaveItems(List<BaseItem> items, CancellationToken cancellationToken);
|
||||
|
||||
void SaveImages(BaseItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the item.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user