add soundtracks to theme media result

This commit is contained in:
Luke Pulverenti
2013-11-12 10:36:08 -05:00
parent 8349b1f83a
commit 9758adb8a5
15 changed files with 125 additions and 31 deletions

View File

@@ -11,9 +11,12 @@ namespace MediaBrowser.Controller.Entities.Audio
/// </summary>
public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres
{
public List<Guid> SoundtrackIds { get; set; }
public MusicAlbum()
{
Artists = new List<string>();
SoundtrackIds = new List<Guid>();
}
public string LastFmImageUrl { get; set; }

View File

@@ -25,11 +25,6 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
public abstract class BaseItem : IHasProviderIds, ILibraryItem
{
/// <summary>
/// MusicAlbums in the library that are the soundtrack for this item
/// </summary>
public List<Guid> SoundtrackIds { get; set; }
protected BaseItem()
{
Genres = new List<string>();
@@ -43,7 +38,6 @@ namespace MediaBrowser.Controller.Entities
Tags = new List<string>();
ThemeSongIds = new List<Guid>();
ThemeVideoIds = new List<Guid>();
SoundtrackIds = new List<Guid>();
LocalTrailerIds = new List<Guid>();
LockedFields = new List<MetadataFields>();
Taglines = new List<string>();

View File

@@ -1,13 +1,17 @@
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{
public class Game : BaseItem
public class Game : BaseItem, IHasSoundtracks
{
public List<Guid> SoundtrackIds { get; set; }
public Game()
{
MultiPartGameFiles = new List<string>();
SoundtrackIds = new List<Guid>();
}
/// <summary>

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{
/// <summary>
/// Interface IHasSoundtracks
/// </summary>
public interface IHasSoundtracks
{
/// <summary>
/// Gets or sets the soundtrack ids.
/// </summary>
/// <value>The soundtrack ids.</value>
List<Guid> SoundtrackIds { get; set; }
}
}

View File

@@ -11,13 +11,16 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <summary>
/// Class Movie
/// </summary>
public class Movie : Video, IHasCriticRating
public class Movie : Video, IHasCriticRating, IHasSoundtracks
{
public List<Guid> SpecialFeatureIds { get; set; }
public List<Guid> SoundtrackIds { get; set; }
public Movie()
{
SpecialFeatureIds = new List<Guid>();
SoundtrackIds = new List<Guid>();
}
/// <summary>

View File

@@ -193,6 +193,7 @@ namespace MediaBrowser.Controller.Entities.TV
return false;
}
[IgnoreDataMember]
public bool IsMissingEpisode
{
get
@@ -201,11 +202,13 @@ namespace MediaBrowser.Controller.Entities.TV
}
}
[IgnoreDataMember]
public bool IsUnaired
{
get { return PremiereDate.HasValue && PremiereDate.Value.ToLocalTime().Date >= DateTime.Now.Date; }
}
[IgnoreDataMember]
public bool IsVirtualUnaired
{
get { return LocationType == Model.Entities.LocationType.Virtual && IsUnaired; }

View File

@@ -149,21 +149,25 @@ namespace MediaBrowser.Controller.Entities.TV
return IndexNumber != null ? IndexNumber.Value.ToString("0000") : Name;
}
[IgnoreDataMember]
public bool IsMissingSeason
{
get { return LocationType == Model.Entities.LocationType.Virtual && Children.OfType<Episode>().All(i => i.IsMissingEpisode); }
}
[IgnoreDataMember]
public bool IsUnaired
{
get { return Children.OfType<Episode>().All(i => i.IsUnaired); }
}
[IgnoreDataMember]
public bool IsVirtualUnaired
{
get { return LocationType == Model.Entities.LocationType.Virtual && IsUnaired; }
}
[IgnoreDataMember]
public bool IsMissingOrVirtualUnaired
{
get { return LocationType == Model.Entities.LocationType.Virtual && Children.OfType<Episode>().All(i => i.IsVirtualUnaired || i.IsMissingEpisode); }

View File

@@ -11,9 +11,10 @@ namespace MediaBrowser.Controller.Entities.TV
/// <summary>
/// Class Series
/// </summary>
public class Series : Folder
public class Series : Folder, IHasSoundtracks
{
public List<Guid> SpecialFeatureIds { get; set; }
public List<Guid> SoundtrackIds { get; set; }
public int SeasonCount { get; set; }
@@ -22,6 +23,7 @@ namespace MediaBrowser.Controller.Entities.TV
AirDays = new List<DayOfWeek>();
SpecialFeatureIds = new List<Guid>();
SoundtrackIds = new List<Guid>();
}
/// <summary>

View File

@@ -1,4 +1,5 @@
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
@@ -7,12 +8,15 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Trailer
/// </summary>
public class Trailer : Video, IHasCriticRating
public class Trailer : Video, IHasCriticRating, IHasSoundtracks
{
public List<Guid> SoundtrackIds { get; set; }
public Trailer()
{
RemoteTrailers = new List<MediaUrl>();
Taglines = new List<string>();
SoundtrackIds = new List<Guid>();
}
/// <summary>

View File

@@ -90,6 +90,7 @@
<Compile Include="Entities\GameSystem.cs" />
<Compile Include="Entities\IByReferenceItem.cs" />
<Compile Include="Entities\IHasCriticRating.cs" />
<Compile Include="Entities\IHasSoundtracks.cs" />
<Compile Include="Entities\IItemByName.cs" />
<Compile Include="Entities\ILibraryItem.cs" />
<Compile Include="Entities\ImageSourceInfo.cs" />