mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
update music user data key
This commit is contained in:
@@ -153,6 +153,31 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// <returns>System.String.</returns>
|
||||
protected override string CreateUserDataKey()
|
||||
{
|
||||
if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys)
|
||||
{
|
||||
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.FirstOrDefault();
|
||||
if (!string.IsNullOrWhiteSpace(albumArtist))
|
||||
{
|
||||
songKey = albumArtist + "-" + songKey;
|
||||
}
|
||||
|
||||
return songKey;
|
||||
}
|
||||
|
||||
var parent = AlbumEntity;
|
||||
|
||||
if (parent != null)
|
||||
|
||||
@@ -34,7 +34,17 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
{
|
||||
get
|
||||
{
|
||||
return GetParents().OfType<MusicArtist>().FirstOrDefault();
|
||||
var artist = GetParents().OfType<MusicArtist>().FirstOrDefault();
|
||||
|
||||
if (artist == null)
|
||||
{
|
||||
var name = AlbumArtist;
|
||||
if (!string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
artist = LibraryManager.GetArtist(name);
|
||||
}
|
||||
}
|
||||
return artist;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +116,15 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
return "MusicAlbum-Musicbrainz-" + id;
|
||||
}
|
||||
|
||||
if (ConfigurationManager.Configuration.EnableStandaloneMusicKeys)
|
||||
{
|
||||
var albumArtist = AlbumArtist;
|
||||
if (!string.IsNullOrWhiteSpace(albumArtist))
|
||||
{
|
||||
return albumArtist + "-" + Name;
|
||||
}
|
||||
}
|
||||
|
||||
return base.CreateUserDataKey();
|
||||
}
|
||||
|
||||
@@ -125,7 +144,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
|
||||
id.AlbumArtists = AlbumArtists;
|
||||
|
||||
var artist = GetParents().OfType<MusicArtist>().FirstOrDefault();
|
||||
var artist = MusicArtist;
|
||||
|
||||
if (artist != null)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CommonIO;
|
||||
@@ -85,6 +86,13 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||
/// <value>The name of the TMDB collection.</value>
|
||||
public string TmdbCollectionName { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public string CollectionName
|
||||
{
|
||||
get { return TmdbCollectionName; }
|
||||
set { TmdbCollectionName = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the trailer ids.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user