Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "fixed: broken order by movie set in smartplaylists (closes #1…

…2251)"

This reverts commit 23bfcba which caused movies being part of multiple 1-movie-sets to show up multiple times in the movie list.
The videodb version has been bumped (from 59 to 60) because reverting this commit changes the movieview.
  • Loading branch information...
commit a818eaa3a6bf0ee31f868d40e0ac06455b288f0a 1 parent 17c23a1
@Montellese Montellese authored
View
2  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 = "idSet"; // only used for order clauses
+ else if (field == FIELD_SET) result = "strSet";
return result;
}
else if (type == "musicvideos")
View
17 xbmc/video/VideoDatabase.cpp
@@ -363,21 +363,8 @@ void CVideoDatabase::CreateViews()
CLog::Log(LOGINFO, "create movieview");
m_pDS->exec("DROP VIEW IF EXISTS movieview");
- 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());
+ 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");
}
//********************************************************************************************************************************
View
2  xbmc/video/VideoDatabase.h
@@ -722,7 +722,7 @@ class CVideoDatabase : public CDatabase
*/
bool LookupByFolders(const CStdString &path, bool shows = false);
- virtual int GetMinVersion() const { return 59; };
+ virtual int GetMinVersion() const { return 60; };
virtual int GetExportVersion() const { return 1; };
const char *GetBaseDBName() const { return "MyVideos"; };
Please sign in to comment.
Something went wrong with that request. Please try again.