Skip to content

Commit

Permalink
Merge branch 'feature/music'
Browse files Browse the repository at this point in the history
  • Loading branch information
nomad2k committed Nov 23, 2014
2 parents f94ca98 + b05082a commit 3d6ba9c
Show file tree
Hide file tree
Showing 14 changed files with 526 additions and 1,194 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[B]WIMM Change log[/B]

4.1.12
- Massive clean up of the music section

4.1.11
- Add support for tags to TV shows
Expand Down
226 changes: 0 additions & 226 deletions resources/js/app/common/images.js

This file was deleted.

8 changes: 6 additions & 2 deletions resources/js/app/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,16 @@ XWMM.util.toTitleCase = function(str) {
* @param {array} value The array to convert.
* @return {string} The list.
*/
XWMM.util.convertArrayToList = function(value) {
XWMM.util.convertArrayToList = function(value, delim) {
if (value === undefined || value.length === 0) {
return '';
}
else {
return value.join(' / ');
if (delim === undefined) {
delim = ' / ';
}

return value.join(delim);
}
};

Expand Down
55 changes: 1 addition & 54 deletions resources/js/app/music/albumgenres.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,57 +20,4 @@
* along with WIMM. If not, see <http://www.gnu.org/licenses/>.
*/

var AlbumcolModel = new Ext.grid.ColumnModel([
{header: '#', dataIndex: 'albumid', hidden: true},
{header: 'Album', dataIndex: 'strAlbum', width: 150},
{header: 'Artist', dataIndex: 'strArtist', hidden: true},
{header: 'Genre', dataIndex: 'strGenre', hidden: true},
{header: 'Year', dataIndex: 'iYear', hidden: true}
]);

var AlbumRecord = Ext.data.Record.create([
{name: 'albumid'},
{name: 'strAlbum', mapping:'label'},
{name: 'strArtist', mapping:'artist'},
{name: 'strGenre', mapping:'genre', convert:convertGenre},
{name: 'year'}, {name: 'currentThumbnail', mapping:'thumbnail'}
]);

var AlbumStore = new Ext.data.GroupingStore({
sortInfo: {field: 'strAlbum', direction: 'ASC'},
autoLoad: true,
groupField: 'strGenre',
proxy: new Ext.data.XBMCProxy({
jsonData : {'jsonrpc': '2.0', 'method': 'AudioLibrary.GetAlbums', 'params': {'properties': ['genre', 'artist', 'year', 'thumbnail']},'id': 1}
}),
reader: new Ext.data.JsonReader({
root:'result.albums'
}, AlbumRecord)
});

function convertGenre(v, record) {
return v.join(',');
}

AlbumGrid = new Ext.grid.GridPanel({
cm: AlbumcolModel,
id: 'albumGrid',
enableDragDrop: false,
stripeRows: true,
viewconfig: {forceFit: true},
view: new Ext.grid.GroupingView({
forceFit:true,
width: 260,
startCollapsed: true,
showGroupName : false,
// enableGrouping: false,
enableGroupingMenu : true,
//enableNoGroups: false,
groupTextTpl: '{text} '}),
selModel: new Ext.grid.RowSelectionModel({singleSelect: true}),
region: 'west',
width: 260,
split: true,
store: AlbumStore

});
Ext.getCmp('albumGrid').getStore().groupBy('genre');
Loading

0 comments on commit 3d6ba9c

Please sign in to comment.