3.2.30.19

This commit is contained in:
Luke Pulverenti
2017-09-13 14:41:48 -04:00
parent ca1ab81d3c
commit 38fe239f44
18 changed files with 80 additions and 68 deletions

View File

@@ -154,46 +154,28 @@ namespace MediaBrowser.Controller.Entities.Audio
{
var list = base.GetUserDataKeys();
if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys)
var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000") : string.Empty;
if (ParentIndexNumber.HasValue)
{
var songKey = IndexNumber.HasValue ? IndexNumber.Value.ToString("0000") : string.Empty;
if (ParentIndexNumber.HasValue)
{
songKey = ParentIndexNumber.Value.ToString("0000") + "-" + songKey;
}
songKey += Name;
if (!string.IsNullOrWhiteSpace(Album))
{
songKey = Album + "-" + songKey;
}
var albumArtist = AlbumArtists.Length == 0 ? null : AlbumArtists[0];
if (!string.IsNullOrWhiteSpace(albumArtist))
{
songKey = albumArtist + "-" + songKey;
}
list.Insert(0, songKey);
songKey = ParentIndexNumber.Value.ToString("0000") + "-" + songKey;
}
else
songKey += Name;
if (!string.IsNullOrWhiteSpace(Album))
{
var parent = AlbumEntity;
if (parent != null && IndexNumber.HasValue)
{
list.InsertRange(0, parent.GetUserDataKeys().Select(i =>
{
var songKey = (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
+ IndexNumber.Value.ToString("0000 - ");
return i + songKey;
}));
}
songKey = Album + "-" + songKey;
}
var albumArtist = AlbumArtists.Length == 0 ? null : AlbumArtists[0];
if (!string.IsNullOrWhiteSpace(albumArtist))
{
songKey = albumArtist + "-" + songKey;
}
list.Insert(0, songKey);
return list;
}

View File

@@ -145,13 +145,10 @@ namespace MediaBrowser.Controller.Entities.Audio
{
var list = base.GetUserDataKeys();
if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys)
var albumArtist = AlbumArtist;
if (!string.IsNullOrWhiteSpace(albumArtist))
{
var albumArtist = AlbumArtist;
if (!string.IsNullOrWhiteSpace(albumArtist))
{
list.Insert(0, albumArtist + "-" + Name);
}
list.Insert(0, albumArtist + "-" + Name);
}
var id = this.GetProviderId(MetadataProviders.MusicBrainzAlbum);

View File

@@ -918,9 +918,10 @@ namespace MediaBrowser.Controller.Entities
{
get
{
if (!string.IsNullOrWhiteSpace(OfficialRating))
var officialRating = OfficialRating;
if (!string.IsNullOrWhiteSpace(officialRating))
{
return OfficialRating;
return officialRating;
}
var parent = DisplayParent;
@@ -938,9 +939,10 @@ namespace MediaBrowser.Controller.Entities
{
get
{
if (!string.IsNullOrWhiteSpace(CustomRating))
var customRating = CustomRating;
if (!string.IsNullOrWhiteSpace(customRating))
{
return CustomRating;
return customRating;
}
var parent = DisplayParent;
@@ -2480,5 +2482,21 @@ namespace MediaBrowser.Controller.Entities
{
return null;
}
public virtual ItemUpdateType OnMetadataChanged()
{
var updateType = ItemUpdateType.None;
var item = this;
var inheritedParentalRatingValue = item.GetInheritedParentalRatingValue() ?? 0;
if (inheritedParentalRatingValue != item.InheritedParentalRatingValue)
{
item.InheritedParentalRatingValue = inheritedParentalRatingValue;
updateType |= ItemUpdateType.MetadataImport;
}
return updateType;
}
}
}

View File

@@ -266,6 +266,8 @@ namespace MediaBrowser.Controller.Entities
int? ProductionYear { get; set; }
string[] Tags { get; set; }
ItemUpdateType OnMetadataChanged();
}
public static class HasMetadataExtensions