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

Commit

Permalink
podcast category and genre fix
Browse files Browse the repository at this point in the history
  • Loading branch information
geoplanet committed Jul 29, 2016
1 parent 37d76d1 commit 31eeb5b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
9 changes: 8 additions & 1 deletion html/selection.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@
<div class="hidden">
<span id="pod-id">ID</span>
</div>

<div class="fieldrow">
<label data-t class="required">Category</label>
<select class="category_field"></select>
</div>
<div class="fieldrow">
<label data-t class="required">Genre</label>
<select class="genre_field"></select>
</div>
<div class="fieldrow">
<label data-t>Series</label>
<span id="pod-series"></span>
Expand Down
19 changes: 19 additions & 0 deletions js/assembler.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ OBModules.Programs.assembleTracklist = function(program_id,playlist_id,playlist_
{
OB.API.post('programs','get_program',{'pid':program_id},function(progdata){
OB.UI.openModalWindow('modules/programs/selection.html');

// fill category list
for(var i in OB.Settings.categories)
{
$('.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>');
}
$('#pod-id').text(program_id);
$('#pod-series').text(progdata.data.title);
$('#pod-artist').text(progdata.data.producer);
Expand Down Expand Up @@ -166,6 +184,7 @@ OBModules.Programs.getTrack = function(id,title)
item.artist = $('#pod-artist').text();
item.comments = $('#pod-comments').text();
/* these are hardcoded, need to fix */

item.category_id = '11';
item.genre_id = '996';
item.status = 'private';
Expand Down

0 comments on commit 31eeb5b

Please sign in to comment.