From 0fbd8c55a6e3b6f2857deae4b32cdf5801037ba5 Mon Sep 17 00:00:00 2001 From: wildcat2020 Date: Mon, 7 Jan 2019 00:56:11 +0200 Subject: [database] Correct tvshow_view after PR #15185 merge to make sure it only returns one row per tvshow with correct strPath and idParentPath. Added subquery in FROM clause in place of tvshowlinkpath table to return only the maximum strPath. --- xbmc/video/VideoDatabase.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 5bd5ff07a7..a924a263c0 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -410,7 +410,9 @@ void CVideoDatabase::CreateViews() " uniqueid.value AS uniqueid_value, " " uniqueid.type AS uniqueid_type " "FROM tvshow" - " LEFT JOIN tvshowlinkpath ON" + " LEFT JOIN (SELECT idShow, MAX(idPath) as idPath " + " FROM tvshowlinkpath " + " GROUP BY tvshowlinkpath.idShow) AS tvshowlinkpath ON " " tvshowlinkpath.idShow=tvshow.idShow" " LEFT JOIN path ON" " path.idPath=tvshowlinkpath.idPath" @@ -5453,7 +5455,7 @@ void CVideoDatabase::UpdateTables(int iVersion) int CVideoDatabase::GetSchemaVersion() const { - return 114; + return 115; } bool CVideoDatabase::LookupByFolders(const std::string &path, bool shows) -- cgit v1.2.3