mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 06:48:35 +01:00
fixes #689 - Support grouping latest items
This commit is contained in:
@@ -14,11 +14,11 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
/// <summary>
|
||||
/// Class Audio
|
||||
/// </summary>
|
||||
public class Audio : BaseItem,
|
||||
IHasAlbumArtist,
|
||||
IHasArtist,
|
||||
IHasMusicGenres,
|
||||
IHasLookupInfo<SongInfo>,
|
||||
public class Audio : BaseItem,
|
||||
IHasAlbumArtist,
|
||||
IHasArtist,
|
||||
IHasMusicGenres,
|
||||
IHasLookupInfo<SongInfo>,
|
||||
IHasTags,
|
||||
IHasMediaSources
|
||||
{
|
||||
@@ -64,7 +64,15 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
{
|
||||
get
|
||||
{
|
||||
return Parents.OfType<MusicAlbum>().FirstOrDefault() ?? new MusicAlbum { Name = "<Unknown>" };
|
||||
return LatestItemsIndexContainer ?? new MusicAlbum { Name = "Unknown Album" };
|
||||
}
|
||||
}
|
||||
|
||||
public override Folder LatestItemsIndexContainer
|
||||
{
|
||||
get
|
||||
{
|
||||
return Parents.OfType<MusicAlbum>().FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +212,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
private static MediaSourceInfo GetVersionInfo(Audio i, bool enablePathSubstituion)
|
||||
{
|
||||
var locationType = i.LocationType;
|
||||
|
||||
|
||||
var info = new MediaSourceInfo
|
||||
{
|
||||
Id = i.Id.ToString("N"),
|
||||
|
||||
@@ -796,6 +796,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public virtual Folder LatestItemsIndexContainer
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data key.
|
||||
/// </summary>
|
||||
|
||||
@@ -95,6 +95,14 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
}
|
||||
|
||||
public override Folder LatestItemsIndexContainer
|
||||
{
|
||||
get
|
||||
{
|
||||
return Series;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data key.
|
||||
/// </summary>
|
||||
|
||||
@@ -5,13 +5,13 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
public static class NameParser
|
||||
{
|
||||
static readonly Regex[] NameMatches = new[] {
|
||||
static readonly Regex[] NameMatches =
|
||||
{
|
||||
new Regex(@"(?<name>.*)\((?<year>\d{4})\)"), // matches "My Movie (2001)" and gives us the name and the year
|
||||
new Regex(@"(?<name>.*)(\.(?<year>\d{4})(\.|$)).*$"),
|
||||
new Regex(@"(?<name>.*)") // last resort matches the whole string as the name
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Parses the name.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user