lib/simple_pvr/model/programme.rb in simple_pvr-0.0.2 vs lib/simple_pvr/model/programme.rb in simple_pvr-0.0.3
- old
+ new
@@ -12,9 +12,17 @@
property :duration, Integer
property :episode_num, String, index: true
belongs_to :channel
+ def end_time
+ @start_time.advance(seconds: duration)
+ end
+
+ def outdated?
+ end_time < Time.now
+ end
+
def self.clear
Programme.destroy
end
def self.add(channel, title, subtitle, description, start_time, duration, episode_num)
\ No newline at end of file