Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Any matches on tv right now? now only gives matches in play:

  • Loading branch information...
commit 5e7b19d638eebc05e11f09ad801ab72922f7db26 1 parent d79d85a
ninja98 authored

Showing 1 changed file with 16 additions and 3 deletions. Show diff stats Hide diff stats

  1. +16 3 lib/siriproxy-dreambox.rb
19 lib/siriproxy-dreambox.rb
@@ -461,7 +461,16 @@ def get_live_schedule(fromdate, todate, onlylive=true, livenow=true, keyword="")
461 461 parsedtime = Time.new(date[0..3].to_i, date[5..6].to_i, date[8..9].to_i, date[11..12].to_i, date[14..15].to_i, date[17..18].to_i, date[20..22]+ ":" + date[23..24])
462 462 v["localtime"] = parsedtime.localtime
463 463 v[:localruntime] = parsedtime.localtime
464   - next if parsedtime.localtime < (Time.now - 3600 - 2700) #&& !v["livenow"] # skip if match ended
  464 + if parsedtime.localtime < (Time.now - 3600 - 2700) #&& !v["livenow"] # skip if match ended
  465 + puts "Expired... "
  466 + next
  467 + else
  468 + if parsedtime.localtime > Time.now
  469 + puts "Hasnt started yet : " + parsedtime.localtime.to_s
  470 + next if onlylive
  471 + end
  472 + end
  473 +
465 474 v["channels"].each do |channel_name,meta|
466 475 puts "Checking if #{channel_name.upcase} can be found (mapped or in epg)"
467 476 foundit = find(channel_name.upcase)
@@ -496,6 +505,7 @@ def get_live_schedule(fromdate, todate, onlylive=true, livenow=true, keyword="")
496 505 listen_for /match.*of (.*) on TV( right now|today| tomorrow| this week|.*)/i do |team,period|
497 506 puts "Looking up matches for #{team}"
498 507 puts "Period #{period}"
  508 + notonly = false
499 509 datefrom = Time.now
500 510 dateto = Time.now + (3600*24*7)
501 511
@@ -507,6 +517,7 @@ def get_live_schedule(fromdate, todate, onlylive=true, livenow=true, keyword="")
507 517 if period.match /right now/i
508 518 datefrom = Time.now
509 519 dateto = Time.now
  520 + nowonly = true
510 521 end
511 522
512 523 if period.match /tomorrow/i
@@ -519,7 +530,7 @@ def get_live_schedule(fromdate, todate, onlylive=true, livenow=true, keyword="")
519 530 end
520 531
521 532
522   - results = get_live_schedule(datefrom,dateto,false,true,team)
  533 + results = get_live_schedule(datefrom,dateto,nowonly,true,team)
523 534 matches = results[0]
524 535 fails = results[1]
525 536 if matches.size > 0
@@ -563,6 +574,7 @@ def get_live_schedule(fromdate, todate, onlylive=true, livenow=true, keyword="")
563 574 puts "Period #{period}"
564 575 datefrom = Time.now
565 576 dateto = Time.now + (3600*24*7)
  577 + livenow = false
566 578
567 579 if period.match /today/i
568 580 datefrom = Time.now
@@ -571,6 +583,7 @@ def get_live_schedule(fromdate, todate, onlylive=true, livenow=true, keyword="")
571 583 if period.match /right now/i
572 584 datefrom = Time.now
573 585 dateto = Time.now
  586 + livenow = true
574 587 end
575 588
576 589 if period.match /tomorrow/i
@@ -581,7 +594,7 @@ def get_live_schedule(fromdate, todate, onlylive=true, livenow=true, keyword="")
581 594 if period.match /this week/i
582 595 dateto = Time.now + (3600*24*7)
583 596 end
584   - results = get_live_schedule(datefrom,dateto,false)
  597 + results = get_live_schedule(datefrom,dateto,livenow)
585 598
586 599 matches = results[0]
587 600 fails = results[1]

0 comments on commit 5e7b19d

Please sign in to comment.
Something went wrong with that request. Please try again.