Sha256: ac4b75ad559253ffea4cf91eb5bfbf9b2ea01951d583ead7a1708a025319ab35
Contents?: true
Size: 1.63 KB
Versions: 1
Compression:
Stored size: 1.63 KB
Contents
module SimplePvr module Server class ProgrammesController < SecuredController get '/title_search' do Model::Programme.titles_containing(params['query']).to_json end get '/search' do Model::Programme.with_title_containing(params['query']).map {|programme| programme_hash(programme) }.to_json end get '/:id' do |id| programme = Model::Programme.get(id.to_i) programme_hash(programme).to_json end post '/:id/record_on_any_channel' do |id| programme = Model::Programme.get(id.to_i) Model::Schedule.add_specification(title: programme.title) reload_schedules programme_hash(programme).to_json end post '/:id/record_on_this_channel' do |id| programme = Model::Programme.get(id.to_i) Model::Schedule.add_specification(title: programme.title, channel: programme.channel) reload_schedules programme_hash(programme).to_json end post '/:id/record_just_this_programme' do |id| programme = Model::Programme.get(id.to_i) Model::Schedule.add_specification(title: programme.title, channel: programme.channel, start_time: programme.start_time, end_time: programme.end_time) reload_schedules programme_hash(programme).to_json end post '/:id/exclude' do |id| programme = Model::Programme.get(id.to_i) Model::Schedule.create(type: :exception, title: programme.title, channel: programme.channel, start_time: programme.start_time, end_time: programme.end_time) reload_schedules programme_hash(programme).to_json end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simple_pvr-1.1.0 | lib/simple_pvr/server/programmes_controller.rb |