mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-08 23:00:51 +02:00
fixes #769 - Artists pages don't include music videos
This commit is contained in:
parent
e8a88b41ab
commit
56c0d491f4
|
@ -1368,7 +1368,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
mediaUrl = streamInfo.Url;
|
mediaUrl = streamInfo.Url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(path) && File.Exists(path))
|
if (!string.IsNullOrEmpty(path))
|
||||||
{
|
{
|
||||||
state.MediaPath = path;
|
state.MediaPath = path;
|
||||||
state.IsRemote = false;
|
state.IsRemote = false;
|
||||||
|
@ -1381,7 +1381,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
state.RunTimeTicks = recording.RunTimeTicks;
|
state.RunTimeTicks = recording.RunTimeTicks;
|
||||||
|
|
||||||
if (recording.RecordingInfo.Status == RecordingStatus.InProgress && !state.IsRemote)
|
if (recording.RecordingInfo.Status == RecordingStatus.InProgress)
|
||||||
{
|
{
|
||||||
await Task.Delay(1000, cancellationToken).ConfigureAwait(false);
|
await Task.Delay(1000, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@ -1404,7 +1404,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
state.LiveTvStreamId = streamInfo.Id;
|
state.LiveTvStreamId = streamInfo.Id;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(streamInfo.Path) && File.Exists(streamInfo.Path))
|
if (!string.IsNullOrEmpty(streamInfo.Path))
|
||||||
{
|
{
|
||||||
state.MediaPath = streamInfo.Path;
|
state.MediaPath = streamInfo.Path;
|
||||||
state.IsRemote = false;
|
state.IsRemote = false;
|
||||||
|
|
|
@ -15,14 +15,12 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetArtists
|
/// Class GetArtists
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Artists", "GET")]
|
[Route("/Artists", "GET", Summary = "Gets all artists from a given item, folder, or the entire library")]
|
||||||
[Api(Description = "Gets all artists from a given item, folder, or the entire library")]
|
|
||||||
public class GetArtists : GetItemsByName
|
public class GetArtists : GetItemsByName
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("/Artists/{Name}", "GET")]
|
[Route("/Artists/{Name}", "GET", Summary = "Gets an artist, by name")]
|
||||||
[Api(Description = "Gets an artist, by name")]
|
|
||||||
public class GetArtist : IReturn<BaseItemDto>
|
public class GetArtist : IReturn<BaseItemDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -112,7 +110,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
protected override IEnumerable<MusicArtist> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)
|
protected override IEnumerable<MusicArtist> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)
|
||||||
{
|
{
|
||||||
return items
|
return items
|
||||||
.OfType<Audio>()
|
.OfType<IHasArtist>()
|
||||||
.SelectMany(i => i.AllArtists)
|
.SelectMany(i => i.AllArtists)
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
.Select(name =>
|
.Select(name =>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities.Audio
|
namespace MediaBrowser.Controller.Entities.Audio
|
||||||
{
|
{
|
||||||
public interface IHasAlbumArtist
|
public interface IHasAlbumArtist
|
||||||
|
@ -9,5 +10,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||||
public interface IHasArtist
|
public interface IHasArtist
|
||||||
{
|
{
|
||||||
bool HasArtist(string name);
|
bool HasArtist(string name);
|
||||||
|
|
||||||
|
List<string> AllArtists { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@ using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
|
@ -33,6 +35,23 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// <value>The revenue.</value>
|
/// <value>The revenue.</value>
|
||||||
public double? Revenue { get; set; }
|
public double? Revenue { get; set; }
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public List<string> AllArtists
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var list = new List<string>();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Artist))
|
||||||
|
{
|
||||||
|
list.Add(Artist);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the specified name has artist.
|
/// Determines whether the specified name has artist.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in a new issue