Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't allow smartplaylists to be sorted by set and clean up other una…

…vailable sorting fields
  • Loading branch information...
commit fff65738fb7111a4a147e91f1e0ba830f7ec0cd8 1 parent a818eaa
@Montellese Montellese authored
Showing with 11 additions and 6 deletions.
  1. +11 −6 xbmc/playlists/SmartPlayList.cpp
View
17 xbmc/playlists/SmartPlayList.cpp
@@ -264,12 +264,15 @@ vector<CSmartPlaylistRule::DATABASE_FIELD> CSmartPlaylistRule::GetFields(const C
fields.push_back(FIELD_AIRDATE);
fields.push_back(FIELD_PLAYCOUNT);
fields.push_back(FIELD_LASTPLAYED);
- fields.push_back(FIELD_INPROGRESS);
if (!sortOrders)
+ {
+ fields.push_back(FIELD_INPROGRESS);
fields.push_back(FIELD_GENRE);
+ }
fields.push_back(FIELD_YEAR); // premiered
fields.push_back(FIELD_DIRECTOR);
- fields.push_back(FIELD_ACTOR);
+ if (!sortOrders)
+ fields.push_back(FIELD_ACTOR);
fields.push_back(FIELD_EPISODE);
fields.push_back(FIELD_SEASON);
fields.push_back(FIELD_FILENAME);
@@ -291,7 +294,8 @@ vector<CSmartPlaylistRule::DATABASE_FIELD> CSmartPlaylistRule::GetFields(const C
fields.push_back(FIELD_WRITER);
fields.push_back(FIELD_PLAYCOUNT);
fields.push_back(FIELD_LASTPLAYED);
- fields.push_back(FIELD_INPROGRESS);
+ if (!sortOrders)
+ fields.push_back(FIELD_INPROGRESS);
fields.push_back(FIELD_GENRE);
fields.push_back(FIELD_COUNTRY);
fields.push_back(FIELD_YEAR); // premiered
@@ -304,7 +308,8 @@ vector<CSmartPlaylistRule::DATABASE_FIELD> CSmartPlaylistRule::GetFields(const C
fields.push_back(FIELD_HASTRAILER);
fields.push_back(FIELD_FILENAME);
fields.push_back(FIELD_PATH);
- fields.push_back(FIELD_SET);
+ if (!sortOrders)
+ fields.push_back(FIELD_SET);
isVideo = true;
// fields.push_back(FIELD_DATEADDED); // no date added yet in db
}
@@ -677,7 +682,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 = "cant_order_by_set";
return result;
}
else if (type == "musicvideos")
@@ -719,7 +724,7 @@ CStdString CSmartPlaylistRule::GetDatabaseField(DATABASE_FIELD field, const CStd
else if (field == FIELD_PLAYCOUNT) result = "watched";
else if (field == FIELD_RANDOM) result = "RANDOM()"; // only used for order clauses
else if (field == FIELD_DATEADDED) result = "idShow"; // only used for order clauses
- else if (field == FIELD_PATH) return "strPath";
+ else if (field == FIELD_PATH) result = "strPath";
return result;
}
if (type == "episodes")
Please sign in to comment.
Something went wrong with that request. Please try again.