diff options
-rwxr-xr-x | linhes/linhes-system/PKGBUILD | 17 | ||||
-rwxr-xr-x | linhes/linhes-system/misc_recent_recordings.pl | 194 | ||||
-rwxr-xr-x | linhes/linhes-system/misc_status_config.py | 41 | ||||
-rwxr-xr-x | linhes/linhes-system/misc_status_info.sh | 23 | ||||
-rwxr-xr-x | linhes/linhes-system/misc_upcoming_recordings.pl | 334 | ||||
-rwxr-xr-x | linhes/linhes-system/misc_which_recorder.pl | 107 | ||||
-rw-r--r-- | linhes/linhes-system/rc6_mce.toml | 70 |
7 files changed, 783 insertions, 3 deletions
diff --git a/linhes/linhes-system/PKGBUILD b/linhes/linhes-system/PKGBUILD index c2d8499..636959a 100755 --- a/linhes/linhes-system/PKGBUILD +++ b/linhes/linhes-system/PKGBUILD @@ -1,6 +1,6 @@ pkgname=linhes-system pkgver=9.0.0 -pkgrel=23 +pkgrel=24 arch=('x86_64') #install=$pkgname.install pkgdesc="Everything that makes LinHES a system" @@ -11,6 +11,8 @@ binfiles="add_storage.py balance_storage_groups.py empty_storage_groups.py remov checkXFSfrag.sh enableIRWake.sh idle.py lh_system_start.sh lh_notify-send lh_home_check.sh jobqueue_helper.py diskspace.sh find_orphans.py optimize_mythdb.py + misc_recent_recordings.pl misc_status_config.py misc_status_info.sh + misc_upcoming_recordings.pl misc_which_recorder.pl create_media_dirs.sh be_check.py myth2mkv myth2mp3" source=($binfiles @@ -19,7 +21,7 @@ source=($binfiles '79-cronie.hook' 'fstrim.hook' 'openssh.hook' '10-monitor.conf' 'x11vnc.override.conf' 'lh_lighttpd.conf' 'lh_php.ini' 'system-sudo.rules' 'linhes-profile.sh' 'lh_sqlserver.cnf' - 'lh_system_start.sh.desktop') + 'lh_system_start.sh.desktop' 'rc6_mce.toml') sha256sums=('7f91d2afcb76e8e9063c6bbe05f5c3d134a6f67541aead8894d342c32d34ad98' 'b0e8fe4d04e1f779d52a28156489fb51efc13e173efccba2d6d458044bf35904' '4ab36bbabf0964f666278c225f4c2d41f4277acb42e9023163fa3a9599282466' @@ -34,6 +36,11 @@ sha256sums=('7f91d2afcb76e8e9063c6bbe05f5c3d134a6f67541aead8894d342c32d34ad98' 'ebdb3ee0212e0cc72526bb5e50a032573e1894acb7bf75617243b0b49aa1f8f2' '4d006f0fe3b13e67de1b961d611e81911905a30d140849dfdb8e5c0dc4da2f7c' 'e371c6a289c68fe200d7da856c20a8c579efa23178f4d62235f7359d7f6e49a1' + 'd2d69b2bf6315bd37ff5f5b2f0cde8ab2fb89bae18f8796dc5208ffc1a9d743e' + 'a3f8ba840853e4a189dd52520a6958f4030e1cc3391200a6aeef055fb469f0b4' + '6a700f73241de796447bbaf9475b627ae5e662aec3f7fd42b7efa28333aa8801' + '62a5a195ddfaa13bbc7b5bc627cdd748f5d697d178a5238b71a703533bfdd587' + '1d12a128a01dbf6327a80daab9edfdc57d393d02074d19c6a5bd54560cc6b0c0' 'bffcc13e4b480f720feb2b3c781bc4247c63303250c3d885022c699573d45a33' '51093acab5e5a4de51a55f4bdf7b935f4f69edf3d84f1c37db710853ec95eca8' '9ea1b5583cd38f53bb79d9e4ccae91a028db0b6850162d7991b19122c564b9c9' @@ -53,7 +60,8 @@ sha256sums=('7f91d2afcb76e8e9063c6bbe05f5c3d134a6f67541aead8894d342c32d34ad98' 'a9d0a94ff442453f0bec0b2e8afd591cf17b2845b6ae45ff300530114efd30af' '47ace62d7e7e651f25dc7c0a2e96d0862f5efe1a583eeda2843b1fc1499141fe' '3ed91fb5a7894f82fb4895e06d2e3f1df3ac4f82e46c970d4a85aaa4edc24cf1' - '0b9868a563036c81f8fdb8ab8bbad51934aca2a07e9d7634e24214791afda8e2') + '0b9868a563036c81f8fdb8ab8bbad51934aca2a07e9d7634e24214791afda8e2' + '1b965b5e7eeafdf3815c8f2722587a560693dd780327cca9910dc47fba0f1aef') package() { cd $srcdir @@ -84,6 +92,9 @@ package() { #lighttpd files install -Dm644 $srcdir/lh_lighttpd.conf $pkgdir/etc/lighttpd/conf.d/lh_lighttpd.conf + #remote files + install -Dm644 $srcdir/rc6_mce.toml $pkgdir/etc/rc_keymaps/rc6_mce.toml + #readme files install -Dm644 $srcdir/readme_is_xml $pkgdir/etc/gen_is_xml.d/readme_is_xml install -Dm644 $srcdir/readme_is_xml $pkgdir/etc/gen_lib_xml.d/readme_gen_xml diff --git a/linhes/linhes-system/misc_recent_recordings.pl b/linhes/linhes-system/misc_recent_recordings.pl new file mode 100755 index 0000000..92dda8a --- /dev/null +++ b/linhes/linhes-system/misc_recent_recordings.pl @@ -0,0 +1,194 @@ +#!/usr/bin/perl -w +# +# Outputs information about the most-recently-recorded shows. +# +# Automatically detects database settings. +# + +# Includes + use DBI; + use Getopt::Long; + use MythTV; + +# Some variables we'll use here + our ($num_recordings, $live, $heading, $plain_text, $text_format, $usage); + our ($hours, $minutes, $seconds); + our ($dnum_recordings, $dheading, $dtext_format); + our ($dhours, $dminutes, $dseconds); + our ($status_text_format, $status_value_format); + our ($dstatus_text_format, $dstatus_value_format); + +# Default number of recent recordings to show + $dnum_recordings = 5; +# Default period in which to show recordings + $dhours = -1; + $dminutes = -1; + $dseconds = -1; +# Default status output heading + $dheading='Recent Recordings:\n'; +# Default format of plain-text output + $dtext_format='%n/%j, %g:%i %A - %cc\n%T - %S\n%R\n\n'; +# Default format of status output display text + $dstatus_text_format= '<a href="javascript:void(0)">%n/%j %g:%i %A - %cc - %T - %S<br />'. + '<span><strong>%T</strong> %n/%j, %g:%i %A<br />'. + '<em>%S</em><br /><br />%R<br /></span></a><hr />'; +# Default format of status output value + $dstatus_value_format = '%n/%j, %g:%i %A - %T - %S'; + +# Provide default values for GetOptions + $num_recordings = $dnum_recordings; + $hours = $dhours; + $minutes = $dminutes; + $seconds = $dseconds; + $heading = $dheading; + $text_format = $dtext_format; + $status_text_format = $dstatus_text_format; + $status_value_format = $dstatus_value_format; + +# Load the cli options + GetOptions('num_recordings|recordings=s' => \$num_recordings, + 'hours|o=i' => \$hours, + 'minutes=i' => \$minutes, + 'seconds|e=i' => \$seconds, + 'live' => \$live, + 'heading=s' => \$heading, + 'plain_text' => \$plain_text, + 'text_format=s' => \$text_format, + 'status_text_format=s' => \$status_text_format, + 'status_value_format=s' => \$status_value_format, + 'usage|help' => \$usage + ); + +# Print usage + if ($usage) { + print <<EOF; +$0 usage: + +options: + +--recordings [number of recordings] + + Outputs information on the last [number of recordings] shows recorded by + MythTV. To output information on all recordings, specify -1. + + default: $dnum_recordings + +--hours [number of hours] + + Outputs information on recordings that occurred within [number of hours]. + This option may be specified in conjunction with --minutes and --seconds. + To output information on all matching recordings regardless of start time, + specify -1 for --hours, --minutes, and --seconds. + + default: $dhours + +--minutes [number of minutes] + + Outputs information on recordings that occurred within [number of minutes]. + This option may be specified in conjunction with --hours and --seconds. + To output information on all matching recordings regardless of start time, + specify -1 for --hours, --minutes, and --seconds. + + default: $dminutes + +--seconds [number of seconds] + + Outputs information on recordings that occurred within [number of seconds]. + This option may be specified in conjunction with --hours and --minutes. + To output information on all matching recordings regardless of start time, + specify -1 for --hours, --minutes, and --seconds. + + default: $dseconds + +--live + Include information on recent LiveTV recordings. + +--heading [heading] + Output the [heading] before printing information about recordings. + + default: \'$dheading\' + +--plain_text + Output information in plain text format (i.e. for inclusion in an e-mail + notification). + +--text_format [format] + Use the provided [format] to display information on the recordings. The + format should use the same format specifiers used by mythlink.pl, but + may also use \\r and/or \\n for line breaks. This option is ignored + if --plain_text is not used. + + default: \'$dtext_format\' + +--help + + Show this help text. + +EOF + exit; + } + +# Determine the period of interest + my $now = time(); + my $start_after = $now; + $start_after = $start_after - ($hours * 3600) if ($hours > 0); + $start_after = $start_after - ($minutes * 60) if ($minutes > 0); + $start_after = $start_after - $seconds if ($seconds > 0); + $start_after = 0 if (!($start_after < $now)); + +# Fix the heading. + if (defined($plain_text)) { + $heading =~ s/\\r/\r/g; + $heading =~ s/\\n/\n/g; + } + else { + # Remove line break format specifiers from heading for status output + $heading =~ s/(\\r|\\n)//g; + } + +# Connect to mythbackend + my $Myth = new MythTV(); + +# Get the list of recordings + my $count = 0; + my %rows = $Myth->backend_rows('QUERY_RECORDINGS Delete'); + our $show; + foreach my $row (@{$rows{'rows'}}) { + last unless (($count < $num_recordings) || ($num_recordings < 0)); + $show = new MythTV::Program(@$row); + # Skip LiveTV recordings? + next unless (defined($live) || $show->{'recgroup'} ne 'LiveTV'); + # Within the period of interest? + last if (($start_after) && ($show->{'recstartts'} < $start_after)); + # Print the recording information in the desired format + if (defined($plain_text)) { + text_print($count); + } + else { + status_print($count); + } + $count++; + } + +# Print the output for use in the backend status page. + sub status_print { + my $count = shift; + my $text = $show->format_name($status_text_format, ' ', ' ', 1, 0 ,1); + my $value = $show->format_name($status_value_format, ' ', ' ', + 1, 0 ,1); + print("$heading<div class=\"schedule\">") if ($count == 0); + print("$text"); + print("</div>") if ($count == ($num_recordings - 1)); + print("[]:[]recording$count"); + print("[]:[]$value\n"); + } + +# Print the output in plain text format + sub text_print { + my $count = shift; + my $text = $show->format_name($text_format, ' ', ' ', 1, 0 ,1); + $text =~ s/\\r/\r/g; + $text =~ s/\\n/\n/g; + print("$heading") if ($count == 0); + print("$text"); + } diff --git a/linhes/linhes-system/misc_status_config.py b/linhes/linhes-system/misc_status_config.py new file mode 100755 index 0000000..80205cd --- /dev/null +++ b/linhes/linhes-system/misc_status_config.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# This script will configure the myth db to use the misc_status_info scripts + +from socket import gethostname +from MythTV import MythDB +mythdb = MythDB() +localhostname = gethostname() +import sys + +# Function to set db setting. This setting is set in mythtv-setup. +def dbSettingChange(): + if mythdb.settings[localhostname].MiscStatusScript == u'': + mythdb.settings[localhostname].MiscStatusScript = u'/usr/bin/misc_status_info.sh' + print 'The MythTV database setting MiscStatusScript was updated to /usr/bin/misc_status_info.sh.' + else: + print 'The MythTV database setting MiscStatusScript is already set and will not be updated.' + return + +#taken from systemconfig.py +#this is how you populate the dict +systemconfig = {} +file_name = "/etc/systemconfig" +try: + config_file = open(file_name) +except: + print file_name + " could not be opened" + sys.exit(1) + +for line in config_file: + line = line.strip() + if line and line[0] is not "#" and line[-1] is not "=": + var, val = line.rsplit("=", 1) + val = val.strip('"') + systemconfig[var.strip()] = val.strip() + +#this is how you reference a value from mv_hostype.py +if (systemconfig.get("SystemType") == "Standalone"): + dbSettingChange() +elif systemconfig.get("SystemType") == "Master_backend": + dbSettingChange() diff --git a/linhes/linhes-system/misc_status_info.sh b/linhes/linhes-system/misc_status_info.sh new file mode 100755 index 0000000..347fb93 --- /dev/null +++ b/linhes/linhes-system/misc_status_info.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Show all upcoming conflicts +/usr/LH/bin/misc_upcoming_recordings.pl --recordings -1 \ + --no_show_scheduled \ + --heading '<h3>Recording Conflicts</h3>' \ + --no_conflicts_message '<h3>No Recording Conflicts</h3>' + +# Show all the shows recorded today +/usr/LH/bin/misc_recent_recordings.pl --recordings=-1 --hours=24 \ + --heading '<h3>Shows Recorded In The Last 24 Hours</h3>' + +# Get Encoder that was used for recordings from the backend log +firstrun=1 +loglist=`find /var/log/ -name *_mythbackend*.log*` +for i in `ls -t $loglist` +do + if [ $firstrun -eq 1 ]; then + echo "<h3>Encoder Information</h3><div class=\"schedule\"" + firstrun=0 + fi + /usr/LH/bin/misc_which_recorder.pl --noheader $i +done diff --git a/linhes/linhes-system/misc_upcoming_recordings.pl b/linhes/linhes-system/misc_upcoming_recordings.pl new file mode 100755 index 0000000..26ec1b4 --- /dev/null +++ b/linhes/linhes-system/misc_upcoming_recordings.pl @@ -0,0 +1,334 @@ +#!/usr/bin/perl -w +# +# Provides notification of upcoming recordings. +# +# Automatically detects database settings. +# + +# Includes + use DBI; + use Getopt::Long; + use MythTV; + +# Some variables we'll use here + our ($num_recordings, $heading, $plain_text, $text_format, $usage); + our ($hours, $minutes, $seconds, $no_conflicts_message); + our ($scheduled, $duplicates, $deactivated, $conflicts); + our ($dnum_recordings, $dheading, $dtext_format); + our ($dhours, $dminutes, $dseconds, $dno_conflicts_message); + our ($dscheduled, $dduplicates, $ddeactivated, $dconflicts); + our ($status_text_format, $status_value_format); + our ($dstatus_text_format, $dstatus_value_format); + +# Default number of upcoming recordings to show + $dnum_recordings = 5; +# Default period in which to show recordings + $dhours = -1; + $dminutes = -1; + $dseconds = -1; +# Default recording status types to show + $dscheduled = 1; + $dduplicates = 0; + $ddeactivated = 0; + $dconflicts = 1; +# Default status output heading + $dheading='Upcoming Recordings:\n'; +# Default format of plain-text output + $dtext_format='%rs\n%n/%j, %g:%i %A - %cc\n%T - %S\n%R\n\n'; +# Default "no conflicts" message + $dno_conflicts_message='No conflicts.\n'; +# Default format of status output display text + $dstatus_text_format= '<a href="javascript:void(0)">%rs - %n/%j %g:%i %A - %cc - '. + '%T - %S<br />'. + '<span><strong>%T</strong> %n/%j, %g:%i %A<br />'. + '<em>%S</em><br /><br />%R<br /></span></a><hr />'; +# Default format of status output value + $dstatus_value_format = '%n/%j %g:%i %A - %T - %S'; + +# Provide default values for GetOptions + $num_recordings = $dnum_recordings; + $hours = $dhours; + $minutes = $dminutes; + $seconds = $dseconds; + $scheduled = $dscheduled; + $duplicates = $dduplicates; + $deactivated = $ddeactivated; + $conflicts = $dconflicts; + $heading = $dheading; + $text_format = $dtext_format; + $no_conflicts_message = $dno_conflicts_message; + $status_text_format = $dstatus_text_format; + $status_value_format = $dstatus_value_format; + +# Load the cli options + GetOptions('num_recordings|recordings=s' => \$num_recordings, + 'hours|o=i' => \$hours, + 'minutes=i' => \$minutes, + 'seconds|s=i' => \$seconds, + 'show_scheduled|_show_scheduled|scheduled|_scheduled|e!' + => \$scheduled, + 'show_duplicates|_show_duplicates|duplicates|_duplicates|p!' + => \$duplicates, + 'show_deactivated|_show_deactivated|deactivated|_deactivated|v!' + => \$deactivated, + 'show_conflicts|_show_conflicts|conflicts|_conflicts!' + => \$conflicts, + 'heading=s' => \$heading, + 'plain_text' => \$plain_text, + 'text_format=s' => \$text_format, + 'no_conflicts_message=s' => \$no_conflicts_message, + 'status_text_format=s' => \$status_text_format, + 'status_value_format=s' => \$status_value_format, + 'usage|help' => \$usage + ); + +# Print usage + if ($usage) { + # Make default "--show_*" options readable + $dscheduled = ($dscheduled ? '--show_scheduled' : + '--no_show_scheduled'); + $dduplicates = ($dduplicates ? '--show_duplicates' : + '--no_show_duplicates'); + $ddeactivated = ($ddeactivated ? '--show_deactivated' : + '--no_show_deactivated'); + $dconflicts = ($dconflicts ? '--show_conflicts' : + '--no_show_conflicts'); + print <<EOF; +$0 usage: + +options: + +--recordings [number of recordings] + + Outputs information on the next [number of recordings] shows to be recorded + by MythTV and that match the criteria specified for --scheduled, + --duplicates, --deactivated, and --conflicts. To output information on all + matching recordings, specify -1. + + default: $dnum_recordings + +--hours [number of hours] + + Outputs information on recordings starting in the next [number of hours] + and that match the criteria specified for --scheduled, --duplicates, + --deactivated, and --conflicts. This option may be specified in + conjunction with --minutes and --seconds. To output information on all + matching recordings regardless of start time, specify -1 for --hours, + --minutes, and --seconds. + + default: $dhours + +--minutes [number of minutes] + + Outputs information on recordings starting in the next [number of minutes] + and that match the criteria specified for --scheduled, --duplicates, + --deactivated, and --conflicts. This option may be specified in + conjunction with --hours and --seconds. To output information on all + matching recordings regardless of start time, specify -1 for --hours, + --minutes, and --seconds. + + default: $dminutes + +--seconds [number of seconds] + + Outputs information on recordings starting in the next [number of seconds] + and that match the criteria specified for --scheduled, --duplicates, + --deactivated, and --conflicts. This option may be specified in + conjunction with --hours and --minutes. To output information on all + matching recordings regardless of start time, specify -1 for --hours, + --minutes, and --seconds. + + default: $dseconds + +--show_scheduled|--no_show_scheduled + + Outputs information about scheduled recordings. Scheduled recordings are + those that MythTV plans to actually record. + + default: $dscheduled + +--show_duplicates|--no_show_duplicates + + Outputs information about duplicate recordings. Duplicate recordings are + those that will not be recorded because of the specified duplicate matching + policy for the rule. + + default: $dduplicates + +--show_deactivated|--no_show_deactivated + + Outputs information about deactivated recordings. Deactivated recordings + are those that MythTV will not record because the schedule is inactive, + because the showing was set to never record, because the show is being + recorded in an earlier or later showing, because there are too many + recordings or not enough disk space to allow the recording, or because + the show you\'ve specified for recording is not listed in the timeslot + specified. + + default: $ddeactivated + +--show_conflicts|--no_show_conflicts + + Outputs information about conflicts (those shows that MythTV cannot record + because of other higher-priority scheduled recordings). + + default: $dconflicts + +--heading [heading] + Output the [heading] before printing information about recordings. + + default: \'$dheading\' + +--plain_text + Output information in plain text format (i.e. for inclusion in an e-mail + notification). + +--text_format [format] + Use the provided [format] to display information on the recordings. The + format should use the same format specifiers used by mythlink.pl, but + may also use \\r and/or \\n for line breaks and %rs for recording status. + This option is ignored if --plain_text is not used. + + default: \'$dtext_format\' + +--no_conflicts_message [message] + Use the provided [message] to specify there are no conflicts. This option + is used when only information about conflicts is requested and there are + no conflicts. I.e. it is only used with the combination of show_* + options --show_conflicts, --no_show_scheduled, --no_show_deactivated, + and --no_show_duplicates . + + default: \'$dno_conflicts_message\' + +--help + + Show this help text. + +EOF + exit; + } + +# Determine the period of interest + my $now = time(); + my $start_before = $now; + $start_before = $start_before + ($hours * 3600) if ($hours > 0); + $start_before = $start_before + ($minutes * 60) if ($minutes > 0); + $start_before = $start_before + $seconds if ($seconds > 0); + $start_before = 0 if (!($start_before > $now)); + +# Fix the heading. + if (defined($plain_text)) { + $heading =~ s/\\r/\r/g; + $heading =~ s/\\n/\n/g; + } + else { + # Remove line break format specifiers from heading for status output + $heading =~ s/(\\r|\\n)//g; + } + +# Connect to mythbackend + my $Myth = new MythTV(); + +# Get the list of recordings + my $count = 0; + my %rows = $Myth->backend_rows('QUERY_GETALLPENDING', 2); + my $has_conflicts = $rows{'offset'}[0]; + if ((!$has_conflicts) && + (($conflicts) && + (!(($scheduled) || ($duplicates) || ($deactivated))))) { + $no_conflicts_message =~ s/\\r/\r/g; + $no_conflicts_message =~ s/\\n/\n/g; + print "$no_conflicts_message"; + exit 0; + } + my $num_scheduled = $rows{'offset'}[1]; + our $show; + foreach my $row (@{$rows{'rows'}}) { + last unless (($count < $num_recordings) || ($num_recordings < 0)); + $show = new MythTV::Program(@$row); + last if (($start_before) && ($show->{'recstartts'} > $start_before)); + next if ((!$scheduled) && (is_scheduled($show->{'recstatus'}))); + next if ((!$duplicates) && (is_duplicate($show->{'recstatus'}))); + next if ((!$deactivated) && (is_deactivated($show->{'recstatus'}))); + next if ((!$conflicts) && (is_conflict($show->{'recstatus'}))); + + # Print the recording information in the desired format + if (defined($plain_text)) { + text_print($count); + } + else { + status_print($count); + } + $count++; + } + +# Returns true if the show is scheduled to record + sub is_scheduled { + my $recstatus = (shift() or 0); + return (($MythTV::recstatus_willrecord == $recstatus) || + ($MythTV::recstatus_recorded == $recstatus) || + ($MythTV::recstatus_recording == $recstatus)); + } + +# Returns true if the show is a duplicate + sub is_duplicate { + my $recstatus = (shift() or 0); + return (($MythTV::recstatus_repeat == $recstatus) || + ($MythTV::recstatus_previousrecording == $recstatus) || + ($MythTV::recstatus_currentrecording == $recstatus)); + } + +# Returns true if the recording is deactivated + sub is_deactivated { + my $recstatus = (shift() or 0); + return (($MythTV::recstatus_inactive == $recstatus) || + ($MythTV::recstatus_toomanyrecordings == $recstatus) || + ($MythTV::recstatus_cancelled == $recstatus) || + ($MythTV::recstatus_deleted == $recstatus) || + ($MythTV::recstatus_aborted == $recstatus) || + ($MythTV::recstatus_notlisted == $recstatus) || + ($MythTV::recstatus_dontrecord == $recstatus) || + ($MythTV::recstatus_lowdiskspace == $recstatus) || + ($MythTV::recstatus_tunerbusy == $recstatus) || + ($MythTV::recstatus_neverrecord == $recstatus) || + ($MythTV::recstatus_earliershowing == $recstatus) || + ($MythTV::recstatus_latershowing == $recstatus)); + } + +# Returns true if the show cannot be recorded due to a conflict + sub is_conflict { + my $recstatus = (shift() or 0); + return ($MythTV::recstatus_conflict == $recstatus); + } + +# Print the output for use in the backend status page. + sub status_print { + my $count = shift; + my $text = $show->format_name($status_text_format, ' ', ' ', 1, 0 ,1); + { + no warnings 'uninitialized'; + $text =~ s/%rs/$MythTV::RecStatus_Types{$show->{'recstatus'}}/g; + } + my $value = $show->format_name($status_value_format, ' ', ' ', + 1, 0 ,1); + $value =~ s/%rs/$MythTV::RecStatus_Types{$show->{'recstatus'}}/g; + print("$heading<div class=\"schedule\">") if ($count == 0); + print("$text"); + print("</div>") if ($count == ($num_recordings - 1)); + print("[]:[]recording$count"); + print("[]:[]$value\n"); + } + +# Print the output in plain text format + sub text_print { + my $count = shift; + my $text = $show->format_name($text_format, ' ', ' ', 1, 0 ,1); + { + no warnings 'uninitialized'; + $text =~ s/%rs/$MythTV::RecStatus_Types{$show->{'recstatus'}}/g; + } + $text =~ s/\\r/\r/g; + $text =~ s/\\n/\n/g; + print("$heading") if ($count == 0); + print("$text"); + } diff --git a/linhes/linhes-system/misc_which_recorder.pl b/linhes/linhes-system/misc_which_recorder.pl new file mode 100755 index 0000000..05c8600 --- /dev/null +++ b/linhes/linhes-system/misc_which_recorder.pl @@ -0,0 +1,107 @@ +#!/usr/bin/perl -w +# +# Parses the backend log file and includes information on which encoder was used to record shows. + +my ($time, $title, $subtitle, $chanid, $cardid, $sourceid); +my $index = 0; + +sub print_text +{ + print "$time - $title"; + print ": $subtitle" if ($subtitle); + print "\n"; + print " - Encoder ID: $cardid\n"; + print " - Video Source ID: $sourceid\n"; + print " - Channel ID: $chanid\n"; +} + +sub print_xml +{ + print "<a href=\"javascript:void(0)\">$time - $title"; + print ": $subtitle" if ($subtitle); + print " - Encoder: $cardid<br />". + "<span><strong>$title</strong> $time<br />"; + print "<em>$subtitle</em><br />" if ($subtitle); + print "<br />Channel ID: $chanid<br />Encoder ID: $cardid<br />". + "Video Source ID: $sourceid<br /></span></a><hr />"; + # For XML parsers + print "[]:[]capture_info$index\[]:[]time='$time':title='$title'". + ":subtitle='$subtitle':chanid='$chanid':cardid='$cardid'". + ":sourceid='$sourceid'\n"; +} + +my $mode = shift; +my $log_file = shift; + +if (($mode ne "--text") && ($mode ne "--noheader")) +{ + $log_file = $mode; +} + +if ($log_file =~ m/^--.*/i) +{ + die ("Only one option can be used at a time.\n"); +} + +if ($log_file =~ /\.gz$/) +{ +# read top down +# open($fh, "gunzip -c $log_file |") or die "Unable to open log file '$log_file', stopping:"; +# read bottom up + open($fh, "gunzip -c $log_file |tac |") or die "Unable to open log file '$log_file', stopping:"; +} +else +{ +# read top down +# open($fh, "<$log_file") or die "Unable to open log file '$log_file', stopping:"; +# read bottom up + open($fh, "tac $log_file |") or die "Unable to open log file '$log_file', stopping:"; +} + +while (<$fh>) +{ +# Myth .25 & .27 regex to find start of recording for digital and analog MPEG + if (/^(\d+-\d+-\d+T\d+\:\d+\:\d+)(?:.*) (?:Started|Tuning) recording: (.*): channel (\d+) on cardid \[(\d+)\], sourceid (\d+)/ || /^(\d+-\d+-\d+T\d+\:\d+\:\d+)(?:.*) \(UpdateRecStatus\) Updating status for (.*)() on cardid \[(\d+)\] \(Will Record => Recording\)()/) + { + if ($mode eq "--noheader") + { + print "<div class=\"schedule\">" + if (($index == 0) && ($mode ne "--text")); + } + else + { + print "<h3>Encoder Information</h3><div class=\"schedule\">" + if (($index == 0) && ($mode ne "--text")); + } + $index++; + + ($time, $title, $chanid, $cardid, $sourceid) = ($1, $2, $3, $4, $5); + $time =~ s/T/' '/; + $time = `date -d $time +%a' '%m/%d' '%l:%M' '%p`; + chomp ($time); + if (($title =~ /"?(.+)"?:"?(.*)"?/) || ($title =~ /(.+) "(.*)"/)) + { + $title = $1; + $subtitle = $2; + } + else + { + $subtitle = ''; + } + $title =~ s/^"//; + $subtitle =~ s/^"//; + $title =~ s/"$//; + $subtitle =~ s/"$//; + if ($mode eq "--text") + { + print_text; + } + else + { + print_xml; + } + } +} +print "</div>" if (($index > 0) && ($mode ne "--text")); + +close $fh; diff --git a/linhes/linhes-system/rc6_mce.toml b/linhes/linhes-system/rc6_mce.toml new file mode 100644 index 0000000..9ba3cb8 --- /dev/null +++ b/linhes/linhes-system/rc6_mce.toml @@ -0,0 +1,70 @@ +# Generated with gen_keytables.pl from drivers/media/rc/keymaps/rc-rc6-mce.c +[[protocols]] +name = "rc6_mce" +protocol = "rc6" +variant = "rc6_mce" +[protocols.scancodes] +0x800f0400 = "KEY_NUMERIC_0" +0x800f0401 = "KEY_NUMERIC_1" +0x800f0402 = "KEY_NUMERIC_2" +0x800f0403 = "KEY_NUMERIC_3" +0x800f0404 = "KEY_NUMERIC_4" +0x800f0405 = "KEY_NUMERIC_5" +0x800f0406 = "KEY_NUMERIC_6" +0x800f0407 = "KEY_NUMERIC_7" +0x800f0408 = "KEY_NUMERIC_8" +0x800f0409 = "KEY_NUMERIC_9" +0x800f040a = "KEY_DELETE" +0x800f040b = "KEY_ENTER" +0x800f040c = "KEY_SLEEP" +0x800f040d = "KEY_M" +0x800f040e = "KEY_MUTE" +0x800f040f = "KEY_I" +0x800f0410 = "KEY_VOLUMEUP" +0x800f0411 = "KEY_VOLUMEDOWN" +0x800f0412 = "KEY_CHANNELUP" +0x800f0413 = "KEY_CHANNELDOWN" +0x800f0414 = "KEY_FASTFORWARD" +0x800f0415 = "KEY_REWIND" +0x800f0416 = "KEY_SPACE" +0x800f0417 = "KEY_RECORD" +0x800f0418 = "KEY_SPACE" +0x800f0419 = "KEY_X" +0x800f041a = "KEY_END" +0x800f041b = "KEY_HOME" +0x800f041c = "KEY_NUMERIC_POUND" +0x800f041d = "KEY_NUMERIC_STAR" +0x800f041e = "KEY_UP" +0x800f041f = "KEY_DOWN" +0x800f0420 = "KEY_LEFT" +0x800f0421 = "KEY_RIGHT" +0x800f0422 = "KEY_ENTER" +0x800f0423 = "KEY_BACK" +0x800f0424 = "KEY_DVD" +0x800f0425 = "KEY_TUNER" +0x800f0426 = "KEY_EPG" +0x800f0427 = "KEY_ZOOM" +0x800f0432 = "KEY_MODE" +0x800f0433 = "KEY_PRESENTATION" +0x800f0434 = "KEY_EJECTCD" +0x800f043a = "KEY_BRIGHTNESSUP" +0x800f0446 = "KEY_TV" +0x800f0447 = "KEY_AUDIO" +0x800f0448 = "KEY_PVR" +0x800f0449 = "KEY_CAMERA" +0x800f044a = "KEY_VIDEO" +0x800f044c = "KEY_LANGUAGE" +0x800f044d = "KEY_TITLE" +0x800f044e = "KEY_PRINT" +0x800f0450 = "KEY_RADIO" +0x800f045a = "KEY_SUBTITLE" +0x800f045b = "KEY_RED" +0x800f045c = "KEY_GREEN" +0x800f045d = "KEY_YELLOW" +0x800f045e = "KEY_BLUE" +0x800f0465 = "KEY_POWER2" +0x800f0469 = "KEY_MESSENGER" +0x800f046e = "KEY_PLAYPAUSE" +0x800f046f = "KEY_PLAYER" +0x800f0480 = "KEY_BRIGHTNESSDOWN" +0x800f0481 = "KEY_PLAYPAUSE" |