Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
geoplanet committed Jul 29, 2016
1 parent 31eeb5b commit 003ece9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
34 changes: 20 additions & 14 deletions js/assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,11 @@ OBModules.Programs.assembleTracklist = function(program_id,playlist_id,playlist_
{
$('.category_field').append('<option value="'+OB.Settings.categories[i].id+'" name="'+OB.Settings.categories[i].name+'">'+htmlspecialchars(OB.t('Media Categories',OB.Settings.categories[i].name))+'</option>');
}

$('.category_field option[name="Shows - Complete"]').prop('selected', true);
//Setup genre dropdown
var selected_category = $('.category_field').val();
$('.genre_field option').remove();

// fill genre list
for(var i in OB.Settings.genres)
{
if(OB.Settings.genres[i].media_category_id == selected_category)
$('.genre_field').append('<option value="'+OB.Settings.genres[i].id+'">'+htmlspecialchars(OB.t('Media Genres',OB.Settings.genres[i].name))+'</option>');
}
// tie together genre list with category list on change
$('.category_field').change(function() { updateGenre(); });
$('.category_field option[name="Shows - Complete"]').prop('selected', true);
$('.category_field option[name="Shows-Complete"]').prop('selected', true);
updateGenre();
$('#pod-id').text(program_id);
$('#pod-series').text(progdata.data.title);
$('#pod-artist').text(progdata.data.producer);
Expand Down Expand Up @@ -87,6 +80,19 @@ OBModules.Programs.assembleTracklist = function(program_id,playlist_id,playlist_
});
}

function updateGenre() {
//Setup genre dropdown
var selected_category = $('.category_field').val();
$('.genre_field option').remove();

// fill genre list
for(var i in OB.Settings.genres)
{
if(OB.Settings.genres[i].media_category_id == selected_category)
$('.genre_field').append('<option value="'+OB.Settings.genres[i].id+'">'+htmlspecialchars(OB.t('Media Genres',OB.Settings.genres[i].name))+'</option>');
}
}

function shuffle(array) {
var m = array.length, t, i;

Expand Down Expand Up @@ -185,8 +191,8 @@ OBModules.Programs.getTrack = function(id,title)
item.comments = $('#pod-comments').text();
/* these are hardcoded, need to fix */

item.category_id = '11';
item.genre_id = '996';
item.category_id = $('.category_field').val();
item.genre_id = $('.genfre_field').val();;
item.status = 'private';
item.is_copyright_owner = '1';
item.is_approved = '1';
Expand Down
2 changes: 1 addition & 1 deletion module.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function install()
$this->db->query('CREATE TABLE IF NOT EXISTS `program_keywords` (
`program_id` int(11) unsigned NOT NULL,
`tag` varchar(255) NOT NULL,
PRIMARY KEY (`program_id`)
KEY (`program_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;'
);

Expand Down

0 comments on commit 003ece9

Please sign in to comment.