mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-20 05:04:18 +01:00
made Audio.Artist plural and removed duplicated of artists into the people collection
This commit is contained in:
@@ -3,6 +3,7 @@ using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@@ -551,6 +552,17 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
return GetImagesByNameItem<Genre>(ConfigurationManager.ApplicationPaths.GenrePath, name, CancellationToken.None, allowSlowProviders);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a Genre
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <param name="allowSlowProviders">if set to <c>true</c> [allow slow providers].</param>
|
||||
/// <returns>Task{Genre}.</returns>
|
||||
public Task<Artist> GetArtist(string name, bool allowSlowProviders = false)
|
||||
{
|
||||
return GetImagesByNameItem<Artist>(ConfigurationManager.ApplicationPaths.ArtistsPath, name, CancellationToken.None, allowSlowProviders);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The us culture
|
||||
/// </summary>
|
||||
|
||||
@@ -18,6 +18,9 @@ namespace MediaBrowser.Server.Implementations
|
||||
{
|
||||
}
|
||||
#else
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ServerApplicationPaths"/> class.
|
||||
/// </summary>
|
||||
public ServerApplicationPaths()
|
||||
: base(false)
|
||||
{
|
||||
@@ -345,5 +348,30 @@ namespace MediaBrowser.Server.Implementations
|
||||
return _downloadedImagesDataPath;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The _music artists path
|
||||
/// </summary>
|
||||
private string _musicArtistsPath;
|
||||
/// <summary>
|
||||
/// Gets the artists path.
|
||||
/// </summary>
|
||||
/// <value>The artists path.</value>
|
||||
public string ArtistsPath
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_musicArtistsPath == null)
|
||||
{
|
||||
_musicArtistsPath = Path.Combine(ImagesByNamePath, "Artists");
|
||||
if (!Directory.Exists(_musicArtistsPath))
|
||||
{
|
||||
Directory.CreateDirectory(_musicArtistsPath);
|
||||
}
|
||||
}
|
||||
|
||||
return _musicArtistsPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Sorting;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Sorting
|
||||
{
|
||||
@@ -31,7 +32,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||
{
|
||||
var audio = x as Audio;
|
||||
|
||||
return audio == null ? string.Empty : audio.Artist;
|
||||
return audio == null ? string.Empty : audio.Artists.OrderBy(i => i).FirstOrDefault() ?? string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user