Ticket #4517: upnp-sorting.patch
File upnp-sorting.patch, 3.6 KB (added by , 14 years ago) |
---|
-
upnpcds.cpp
../ 1210 1210 if (query.isConnected()) 1211 1211 { 1212 1212 QString sWhere( "" ); 1213 QString sOrder( "" );1214 1213 1215 1214 if ( sKey.length() > 0) 1216 1215 { … … 1218 1217 .arg( pInfo->column ); 1219 1218 } 1220 1219 1221 1222 QString orderColumn( pInfo->orderColumn );1223 if (orderColumn.length() != 0) {1224 sOrder = QString( "ORDER BY %1 " )1225 .arg( orderColumn );1226 }1227 1228 1220 if (pRequest->m_sObjectId.startsWith("Videos", true)) 1229 1221 { 1230 1222 if (pRequest->m_sParentId != "") … … 1263 1255 1264 1256 QString sSQL = QString( "%1 %2 LIMIT %3, %4" ) 1265 1257 .arg( GetItemListSQL( pInfo->column ) ) 1266 .arg( sWhere + ParentClause + sOrder)1258 .arg( sWhere + ParentClause ) 1267 1259 .arg( pRequest->m_nStartingIndex ) 1268 1260 .arg( pRequest->m_nRequestedCount ); 1269 1261 -
upnpcds.h
../ 111 111 char *column; 112 112 char *sql; 113 113 char *where; 114 char *orderColumn;115 114 116 115 } UPnpCDSRootInfo; 117 116 -
upnpcdsmusic.cpp
../ 50 50 "FROM music_songs song " 51 51 "%1 " 52 52 "ORDER BY name", 53 "" , ""},53 "" }, 54 54 55 55 /* 56 56 This is currently broken... need to handle list of items with single parent -
upnpcdstv.cpp
(like 'All Music') @@ -74,7 +74,7 @@ "%1 " "GROUP BY a.album_id " "ORDER BY a.album_name", - "WHERE song.album_id=:KEY","" }, + "WHERE song.album_id=:KEY" }, /* { "By Artist",
../ 44 44 "FROM recorded " 45 45 "%1 " 46 46 "ORDER BY starttime DESC", 47 "" , ""},47 "" }, 48 48 49 49 { "By Title", 50 50 "title", … … 55 55 "%1 " 56 56 "GROUP BY title " 57 57 "ORDER BY title", 58 "WHERE title=:KEY" , ""},58 "WHERE title=:KEY" }, 59 59 60 60 { "By Genre", 61 61 "category", … … 66 66 "%1 " 67 67 "GROUP BY category " 68 68 "ORDER BY category", 69 "WHERE category=:KEY" , ""},69 "WHERE category=:KEY" }, 70 70 71 71 { "By Date", 72 72 "DATE_FORMAT(starttime, '%Y-%m-%d')", … … 77 77 "%1 " 78 78 "GROUP BY name " 79 79 "ORDER BY starttime DESC", 80 "WHERE DATE_FORMAT(starttime, '%Y-%m-%d') =:KEY" , ""},80 "WHERE DATE_FORMAT(starttime, '%Y-%m-%d') =:KEY" }, 81 81 82 82 { "By Channel", 83 83 "chanid", … … 89 89 "%1 " 90 90 "GROUP BY name " 91 91 "ORDER BY channel.chanid", 92 "WHERE channel.chanid=:KEY" , ""},92 "WHERE channel.chanid=:KEY" }, 93 93 94 94 95 95 { "By Group", … … 100 100 "%1 " 101 101 "GROUP BY recgroup " 102 102 "ORDER BY recgroup", 103 "WHERE recgroup=:KEY" , ""}103 "WHERE recgroup=:KEY" } 104 104 }; 105 105 106 106 int UPnpCDSTv::g_nRootCount = sizeof( g_RootNodes ) / sizeof( -
upnpcdsvideo.cpp
UPnpCDSRootInfo );
../ 22 22 "1 as children " 23 23 "FROM upnpmedia " 24 24 "%1 " 25 "ORDER BY title ASC",26 "" , "title"}25 "ORDER BY title DESC", 26 "" } 27 27 28 28 };