aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-22 19:34:29 -0500
committerGitHub <noreply@github.com>2019-01-22 19:34:29 -0500
commit090fea21ea787cf77e0d7511c2d806b37e778db7 (patch)
tree369bde436c33157941a00dc78b71f5ada882a3b3
parent52dd570142b20b48e41c335c3e8e6891b309a830 (diff)
parent490e22c790fb89b670fbd2fc8a8c4041129dd3c9 (diff)
Merge pull request #668 from hawken93/prepare_for_reports_module
Return Audio objects from MusicAlbum.Tracks
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs14
-rw-r--r--MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs2
2 files changed, 14 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 492adef6a..21294f96f 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -4712,9 +4712,21 @@ namespace Emby.Server.Implementations.Data
continue;
}
- var paramName = "@HasAnyProviderId" + index;
+ // TODO this seems to be an idea for a better schema where ProviderIds are their own table
+ // buut this is not implemented
//hasProviderIds.Add("(COALESCE((select value from ProviderIds where ItemId=Guid and Name = '" + pair.Key + "'), '') <> " + paramName + ")");
+
+ // TODO this is a really BAD way to do it since the pair:
+ // Tmdb, 1234 matches Tmdb=1234 but also Tmdb=1234567
+ // and maybe even NotTmdb=1234.
+
+ // this is a placeholder for this specific pair to correlate it in the bigger query
+ var paramName = "@HasAnyProviderId" + index;
+
+ // this is a search for the placeholder
hasProviderIds.Add("ProviderIds like " + paramName + "");
+
+ // this replaces the placeholder with a value, here: %key=val%
if (statement != null)
{
statement.TryBind(paramName, "%" + pair.Key + "=" + pair.Value + "%");
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
index a3e05f0d2..5b2939b75 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
@@ -96,7 +96,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// </summary>
/// <value>The tracks.</value>
[IgnoreDataMember]
- public IEnumerable<BaseItem> Tracks => GetRecursiveChildren(i => i is Audio);
+ public IEnumerable<Audio> Tracks => GetRecursiveChildren(i => i is Audio).Cast<Audio>();
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
{