Re: [PATCH] Hack to enable finding programmes through programme schedules

2014-11-02 Thread Ian Smith

On 01/11/14 15:14, Jon Davies wrote:

below is a hack that uses last week's schedules (and stuff before
today in this week's schedules) to enable some degree of searching for
tv programmes.  Dinkypumpkin's proposed updates will almost certainly
provide a better solution, but this seems to be making the pvr work
again for me.  YMMV


I tried this and while it updated the radio cache it added
some index numbers over 2, which given that the search
only works up to 1, wasn't a total success. Increased
index_max to 2 and all worked fine.

Ian

___
get_iplayer mailing list
get_iplayer@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer


[PATCH] Hack to enable finding programmes through programme schedules

2014-11-01 Thread Jon Davies
below is a hack that uses last week's schedules (and stuff before
today in this week's schedules) to enable some degree of searching for
tv programmes.  Dinkypumpkin's proposed updates will almost certainly
provide a better solution, but this seems to be making the pvr work
again for me.  YMMV

for Ubuntu users I'm in the process of rolling this into my ppa at
get-iplayer-testing and it should pop out of there in the next couple
of hours.  To use the -testing ppa follow the instructions at
https://github.com/dinkypumpkin/get_iplayer/wiki/ubuntu but substitute
"jon-hedgerows/get-iplayer" for "jon-hedgerows/get-iplayer-testing".

You can download a patched copy of the get_iplayer script here:
http://packages.hedgerows.org.uk/gip/

Jon

diff --git a/get_iplayer b/get_iplayer
index bc2e569..d835b82 100755
--- a/get_iplayer
+++ b/get_iplayer
@@ -7414,13 +7414,15 @@ sub get_links {
# Get future schedules if required
# http://www.bbc.co.uk/cbbc/programmes/schedules/this_week.xml
# http://www.bbc.co.uk/cbbc/programmes/schedules/next_week.xml
-   if ( $opt->{refreshfuture} ) {
+   { # hack: always use schedules as feeds no longer work
# Hack to get correct 'channels' method because this
methods is being shared with Programme::radio
my %channels = %{
main::progclass($prog_type)->channels_filtered(
main::progclass($prog_type)->channels_schedule() ) };
# Only get schedules for real channels
@channel_list = keys %channels;
for my $channel_id ( @channel_list ) {
my @schedule_feeds = (
+   # last_week finds some old programmes
through schedules instead of feeds
+
"http://www.bbc.co.uk/${channel_id}/last_week.xml";,

"http://www.bbc.co.uk/${channel_id}/this_week.xml";,

"http://www.bbc.co.uk/${channel_id}/next_week.xml";,
);
@@ -7569,7 +7571,8 @@ sub get_links {

# Don't create this prog
instance if the availablity is in the past
# this prevents programmes
which never appear in iPlayer from being indexed
-   next if
Programme::get_time_string( $available ) < $now;
+   # don't skip old programmes,
feeds don't work
+   ###next if
Programme::get_time_string( $available ) < $now;

# build data structure
$prog->{$pid} =
main::progclass($prog_type)->new(

___
get_iplayer mailing list
get_iplayer@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/get_iplayer