mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 15:28:28 +01:00
audio page progress
This commit is contained in:
@@ -427,7 +427,7 @@ namespace MediaBrowser.Controller.Dto
|
||||
{
|
||||
dto.Album = audio.Album;
|
||||
dto.AlbumArtist = audio.AlbumArtist;
|
||||
dto.Artists = audio.Artists;
|
||||
dto.Artist = audio.Artist;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities.Audio
|
||||
@@ -53,7 +52,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// Gets or sets the artist.
|
||||
/// </summary>
|
||||
/// <value>The artist.</value>
|
||||
public List<string> Artists { get; set; }
|
||||
public string Artist { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the album.
|
||||
@@ -78,40 +77,13 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Audio"/> class.
|
||||
/// </summary>
|
||||
public Audio()
|
||||
{
|
||||
Artists = new List<string>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the artist.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <exception cref="System.ArgumentNullException">name</exception>
|
||||
public void AddArtist(string name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
|
||||
if (!Artists.Contains(name, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
Artists.Add(name);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the name of the sort.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
protected override string CreateSortName()
|
||||
{
|
||||
return (ProductionYear != null ? ProductionYear.Value.ToString("000-") : "")
|
||||
+ (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
|
||||
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
|
||||
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
|
||||
}
|
||||
|
||||
@@ -122,7 +94,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// <returns><c>true</c> if the specified name has artist; otherwise, <c>false</c>.</returns>
|
||||
public bool HasArtist(string name)
|
||||
{
|
||||
return Artists.Contains(name, StringComparer.OrdinalIgnoreCase) || string.Equals(AlbumArtist, name, StringComparison.OrdinalIgnoreCase);
|
||||
return string.Equals(Artist, name, StringComparison.OrdinalIgnoreCase) || string.Equals(AlbumArtist, name, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,5 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
base.Images = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the name of the sort.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
protected override string CreateSortName()
|
||||
{
|
||||
return ProductionYear != null ? ProductionYear.Value.ToString("0000") : Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,8 +193,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
var songs = recursiveChildren.OfType<Audio.Audio>().ToList();
|
||||
|
||||
indexFolders = songs.SelectMany(i => i.Artists)
|
||||
.Distinct()
|
||||
indexFolders = songs.Select(i => i.Artist ?? string.Empty)
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Select(i =>
|
||||
{
|
||||
try
|
||||
@@ -214,7 +214,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
})
|
||||
.Where(i => i != null)
|
||||
.Select(a => new IndexFolder(us, a,
|
||||
songs.Where(i => i.Artists.Contains(a.Name, StringComparer.OrdinalIgnoreCase)
|
||||
songs.Where(i => string.Equals(i.Artist, a.Name, StringComparison.OrdinalIgnoreCase)
|
||||
), currentIndexName)).Concat(indexFolders);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,19 +109,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
||||
|
||||
audio.Album = GetDictionaryValue(tags, "album");
|
||||
|
||||
var artists = GetDictionaryValue(tags, "artist");
|
||||
if (!string.IsNullOrWhiteSpace(artists))
|
||||
{
|
||||
foreach (var artist in Split(artists))
|
||||
{
|
||||
var name = artist.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
audio.AddArtist(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
audio.Artist = GetDictionaryValue(tags, "artist");
|
||||
|
||||
// Several different forms of albumartist
|
||||
audio.AlbumArtist = GetDictionaryValue(tags, "albumartist") ?? GetDictionaryValue(tags, "album artist") ?? GetDictionaryValue(tags, "album_artist");
|
||||
|
||||
Reference in New Issue
Block a user