diff options
author | vdrfan <vdrfan-nospam-@xbmc.org> | 2011-12-04 16:01:40 +0100 |
---|---|---|
committer | vdrfan <vdrfan-nospam-@xbmc.org> | 2011-12-04 16:01:40 +0100 |
commit | 23bfcba640a7bc96d339ec619fcd4eaabe83f95f (patch) | |
tree | a3ad059e96512106b8c09995a34ffba5f3126ffc | |
parent | a456036c5e81f4cec27b83b93445678cf68b576b (diff) |
fixed: broken order by movie set in smartplaylists (closes #12251)
-rw-r--r-- | xbmc/playlists/SmartPlayList.cpp | 2 | ||||
-rw-r--r-- | xbmc/video/VideoDatabase.cpp | 17 | ||||
-rw-r--r-- | xbmc/video/VideoDatabase.h | 2 |
3 files changed, 17 insertions, 4 deletions
diff --git a/xbmc/playlists/SmartPlayList.cpp b/xbmc/playlists/SmartPlayList.cpp index f469e4ebe0..82803cb5b8 100644 --- a/xbmc/playlists/SmartPlayList.cpp +++ b/xbmc/playlists/SmartPlayList.cpp @@ -677,7 +677,7 @@ CStdString CSmartPlaylistRule::GetDatabaseField(DATABASE_FIELD field, const CStd else if (field == FIELD_PATH) result = "strPath"; else if (field == FIELD_RANDOM) result = "RANDOM()"; // only used for order clauses else if (field == FIELD_DATEADDED) result = "idMovie"; // only used for order clauses - else if (field == FIELD_SET) result = "strSet"; + else if (field == FIELD_SET) result = "idSet"; // only used for order clauses return result; } else if (type == "musicvideos") diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index adb6d4e3c4..e2960f7621 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -363,8 +363,21 @@ void CVideoDatabase::CreateViews() CLog::Log(LOGINFO, "create movieview"); m_pDS->exec("DROP VIEW IF EXISTS movieview"); - m_pDS->exec("create view movieview as select movie.*,files.strFileName as strFileName,path.strPath as strPath,files.playCount as playCount,files.lastPlayed as lastPlayed " - "from movie join files on files.idFile=movie.idFile join path on path.idPath=files.idPath"); + CStdString movieview = PrepareSQL("CREATE VIEW movieview AS SELECT " + "movie.*," + "files.strFileName AS strFileName," + "path.strPath AS strPath," + "files.playCount AS playCount," + "files.lastPlayed AS lastPlayed," + " NULLIF(setlinkmovie.idSet, 0) AS idSet " + "FROM movie" + " LEFT JOIN setlinkmovie ON" + " setlinkmovie.idMovie=movie.idMovie" + " LEFT JOIN files ON" + " files.idFile=movie.idFile" + " LEFT JOIN path ON" + " path.idPath=files.idPath"); + m_pDS->exec(movieview.c_str()); } //******************************************************************************************************************************** diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index 90475fbfdc..4b470a094b 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -721,7 +721,7 @@ private: */ bool LookupByFolders(const CStdString &path, bool shows = false); - virtual int GetMinVersion() const { return 57; }; + virtual int GetMinVersion() const { return 58; }; virtual int GetExportVersion() const { return 1; }; const char *GetBaseDBName() const { return "MyVideos"; }; |