mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-27 10:00:53 +01:00
fixes #903 - Display image info on web client detail page
This commit is contained in:
@@ -168,6 +168,15 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||
return true;
|
||||
}
|
||||
|
||||
if (item is Audio)
|
||||
{
|
||||
// Moved to plural AlbumArtists
|
||||
if (date < new DateTime(2014, 8, 28))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (item.SupportsLocalMetadata)
|
||||
{
|
||||
var video = item as Video;
|
||||
|
||||
@@ -9,8 +9,6 @@ using MediaBrowser.Providers.Manager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Providers.Music
|
||||
{
|
||||
@@ -104,17 +102,15 @@ namespace MediaBrowser.Providers.Music
|
||||
{
|
||||
var updateType = ItemUpdateType.None;
|
||||
|
||||
var albumArtist = songs
|
||||
var albumArtists = songs
|
||||
.SelectMany(i => i.AlbumArtists)
|
||||
.FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.ToList();
|
||||
|
||||
if (!string.IsNullOrEmpty(albumArtist))
|
||||
if (!item.AlbumArtists.SequenceEqual(albumArtists, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
if (!string.Equals(item.AlbumArtist, albumArtist, StringComparison.Ordinal))
|
||||
{
|
||||
item.AlbumArtist = albumArtist;
|
||||
updateType = updateType | ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
item.AlbumArtists = albumArtists;
|
||||
updateType = updateType | ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
return updateType;
|
||||
|
||||
@@ -70,7 +70,10 @@ namespace MediaBrowser.Providers.Music
|
||||
|
||||
private void ProcessResult(MusicAlbum item, Album result)
|
||||
{
|
||||
item.AlbumArtist = result.strArtist;
|
||||
if (!string.IsNullOrWhiteSpace(result.strArtist))
|
||||
{
|
||||
item.AlbumArtists = new List<string> { result.strArtist };
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(result.intYearReleased))
|
||||
{
|
||||
|
||||
@@ -8,15 +8,15 @@ namespace MediaBrowser.Providers.Music
|
||||
{
|
||||
public static string GetAlbumArtist(this AlbumInfo info)
|
||||
{
|
||||
var id = info.AlbumArtists.FirstOrDefault();
|
||||
|
||||
if (string.IsNullOrEmpty(id))
|
||||
{
|
||||
return info.SongInfos.SelectMany(i => i.AlbumArtists)
|
||||
var id = info.SongInfos.SelectMany(i => i.AlbumArtists)
|
||||
.FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
||||
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
return id;
|
||||
return info.AlbumArtists.FirstOrDefault();
|
||||
}
|
||||
|
||||
public static string GetReleaseGroupId(this AlbumInfo info)
|
||||
|
||||
@@ -29,7 +29,6 @@ namespace MediaBrowser.Providers.Photos
|
||||
public Task<ItemUpdateType> FetchAsync(Photo item, MetadataRefreshOptions options, CancellationToken cancellationToken)
|
||||
{
|
||||
item.SetImagePath(ImageType.Primary, item.Path);
|
||||
item.SetImagePath(ImageType.Backdrop, item.Path);
|
||||
|
||||
// Examples: https://github.com/mono/taglib-sharp/blob/a5f6949a53d09ce63ee7495580d6802921a21f14/tests/fixtures/TagLib.Tests.Images/NullOrientationTest.cs
|
||||
|
||||
@@ -77,7 +76,7 @@ namespace MediaBrowser.Providers.Photos
|
||||
}
|
||||
}
|
||||
|
||||
item.CameraManufacturer = image.ImageTag.Make;
|
||||
item.CameraMake = image.ImageTag.Make;
|
||||
item.CameraModel = image.ImageTag.Model;
|
||||
|
||||
var rating = image.ImageTag.Rating;
|
||||
@@ -105,18 +104,21 @@ namespace MediaBrowser.Providers.Photos
|
||||
item.ProductionYear = dateTaken.Value.Year;
|
||||
}
|
||||
|
||||
var size = _imageProcessor.GetImageSize(item.Path);
|
||||
item.Height = Convert.ToInt32(size.Height);
|
||||
item.Width = Convert.ToInt32(size.Width);
|
||||
|
||||
item.Genres = image.ImageTag.Genres.ToList();
|
||||
item.Tags = image.ImageTag.Keywords.ToList();
|
||||
item.Software = image.ImageTag.Software;
|
||||
|
||||
Model.Drawing.ImageOrientation orientation;
|
||||
if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation))
|
||||
if (image.ImageTag.Orientation == TagLib.Image.ImageOrientation.None)
|
||||
{
|
||||
item.Orientation = orientation;
|
||||
item.Orientation = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Drawing.ImageOrientation orientation;
|
||||
if (Enum.TryParse(image.ImageTag.Orientation.ToString(), true, out orientation))
|
||||
{
|
||||
item.Orientation = orientation;
|
||||
}
|
||||
}
|
||||
|
||||
item.ExposureTime = image.ImageTag.ExposureTime;
|
||||
@@ -127,6 +129,10 @@ namespace MediaBrowser.Providers.Photos
|
||||
_logger.ErrorException("Image Provider - Error reading image tag for {0}", e, item.Path);
|
||||
}
|
||||
|
||||
var size = _imageProcessor.GetImageSize(item.Path);
|
||||
item.Height = Convert.ToInt32(size.Height);
|
||||
item.Width = Convert.ToInt32(size.Width);
|
||||
|
||||
const ItemUpdateType result = ItemUpdateType.ImageUpdate | ItemUpdateType.MetadataImport;
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
@@ -138,6 +144,13 @@ namespace MediaBrowser.Providers.Photos
|
||||
|
||||
public bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date)
|
||||
{
|
||||
// Moved to plural AlbumArtists
|
||||
if (date < new DateTime(2014, 8, 28))
|
||||
{
|
||||
// Revamped vaptured metadata
|
||||
return true;
|
||||
}
|
||||
|
||||
return item.DateModified > date;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user