SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-06-2007, 07:08 AM
robhix robhix is offline
Sage Advanced User
 
Join Date: Feb 2007
Posts: 105
How to tell is Sage is recording....

One more question for the collective knowledge base.

Is there any way through scripts, etc to tell if Sage is currently recording a program?

I am in the process of setting up some system maintenance and backup scripts. Some of these scripts may need to reboot the computer. I would like to fix it so that the scripts can be aware that Sage is currently recording. This way I can set it up so that when the computer reboots I will not stomp all over a recording.

The ideal situation would have me being able to check the Sage recording schedule and then setting off tasks as needed based on the schedule. Any ideas on this?

Thanks in advance,
Rob Hix
Reply With Quote
  #2  
Old 07-06-2007, 11:46 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
This question comes up periodically. While there have been various hacks posted to try to detect whether recording is progress (see this thread for instance), that's not really the right question. What you want to know is whether there are any recordings scheduled during the next few minutes that it will take you to do your chores and reboot. For that, you need an STVI or Java plugin that can interrogate the recording schedule and write it out to an external file that reboot scripts can check. I don't know of any such plugin, but you could check the Downloads area to make sure.
__________________
-- Greg
Reply With Quote
  #3  
Old 07-07-2007, 09:45 AM
robogeek robogeek is offline
Sage Expert
 
Join Date: Apr 2003
Location: Appleton, WI USA
Posts: 568
Couple of possiblities:

1. There is a property in the .properties file that might work:

Code:
scheduler_export_file - set to write a file out with the current Sage recording schedule, can be used to create a simple web page to show SageTV's current scheduled recordings
I don't use it so I don't know if it handles recordings in progress or live tv recordings. I believe it should be set like this:

scheduler_export_file=C\:\\scheduled_recordings.txt

Just change the path to where you want the file and don't forget to escape the : and \ with a \ in the pathnames. If that doesn't work then try setting that property to true instead of using a path name, and then look in the SageTV directory for a new text or xml file.

2. Probably the most reliable way would be to install nielms Web User Interface plugin. You can then use:
Code:
http://user:password@localhost:8080/sage/Home?xml=currrecording
to get an xml file of anything that is currently recording, including live tv recordings. And use:
Code:
http://user:password@localhost:8080/sage/Home?xml=nextrecordings
to check for upcomming recordings.

Just change
Code:
user:password@localhost:8080
to match your configuration. One other note... by default, I don't think you will be able to use user : password@ in IE6 or IE7 due to security restrictions implemented. If you are using simple scripting only, google around for the Windows version of WGET to fetch these xml pages from the Web User Interface. Parsing these xml pages with VBScript is another story...I leave that for someone else to explain.
__________________
--Jason

Server Hardware: GIGABYTE GA-EP45-UD3R, Intel Q9550 CPU 2.83GHz, 11GB RAM, 1xHDHR, 1xHVR1600, 1xHVR2250
29TB Server Storage: 1TB SSD (OS), 1TB (data), 2x6TB+2x10TB (22TB FlexRaid storage pool), 2x2TB (recordings), 1x750GB (VMs).
Server Software: Win10 Pro x64 OS, SageTV 64bit v9.2.0.441, Java 1.8 u241, PlayOn, Comskip (Donator) v0.82.003, WampServer v2.5.
Clients: 3xHD300s, 2xHD100, 2xPlaceshifters
Reply With Quote
  #4  
Old 07-07-2007, 11:18 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Here is something quick. that can parse the title and start time.

getrecordings.bat
Code:
C:\wget\wget.exe h**p://user:password@sageserver:8080/sage/Home?xml=nextrecordings

parserecordings.vbs
Code:
set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
 
xmlDoc.load("C:\wget\Home@xml=nextrecordings") 

Set ElemList = xmlDoc.getElementsByTagName("title") 
title = ElemList.item(0).Text 
MsgBox title
Set ElemList = xmlDoc.getElementsByTagName("airing") 
startTime = ElemList.item(0).getAttribute("startTime") 
MsgBox startTime
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.

Last edited by nyplayer; 07-07-2007 at 11:31 AM.
Reply With Quote
  #5  
Old 07-10-2007, 12:31 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Script to check if Sage is Recording.

Hi all,

I have written a VBScript that will check Sagetv to find out if it is recording. You tell it how many minutes of Idle time you need and the task to run and it will do just that.

For best performance subtract a least 5 mins from your required time. for. ex 60 mins make it 55... 120 make it 115. It can run On server or from any PC on your network

Requirements.
1. Nielms Webserver
2. Wget.

It will not run your task if Sage is recording or if the next recording is in fewer minutes than you specified.
Below you will find a log of a test shot. It will not hammer Sage with web requests. It will check again when the show has finished recording based on duration.


7/10/2007 8:21:40 AM Will Not Run C:\wget\test.bat requested Idle minutes 54 Next Recording in 39 mins.
A Baby Story
7/10/2007 8:21:40 AM Next Check in 40 mins
7/10/2007 9:01:42 AM Will Not Run C:\wget\test.bat Recording ... A Baby Story Next Check in 30 mins
7/10/2007 9:31:42 AM Will Not Run C:\wget\test.bat Recording ... A Baby Story Next Check in 30 mins
7/10/2007 10:01:46 AM Will Not Run C:\wget\test.bat Recording ... Deadliest Catch Next Check in 60 mins
Ran C:\wget\test.bat @ 7/10/2007 11:01:49 AM
Exiting Script

VbScript below - don't change anything below the ****
Code:
idleminutes=54                         'Minimum time required between recordings (in Minutes).
TasktoRun="C:\wget\test.bat"           'Your Batchfile or task to run
wgetpath="c:\wget"                     'Path that contains WGET
user="xxxxx"                           'Your User Name
password="xxxxx"                     'Your password
Servername="xxxxx"               'Server name or IP
serverport="8080"                      'Server Port #

                   



'**************************************************************************************************************************************
Attached Files
File Type: zip CheckrecordingProg.zip (1.8 KB, 219 views)
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.

Last edited by nyplayer; 08-01-2007 at 11:15 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin: Web User Interface for SageTV 2.2-6.6 (V2.25 18 Sep 2009) nielm SageTV Customizations 2644 10-24-2016 10:18 AM
help with four TV Sage setup Nate SageTV Software 9 10-18-2006 11:54 PM
Sage hanging with plextor M402U etk29321 Hardware Support 3 06-28-2006 08:04 AM
Recording that will not go away and I just installed sage FormatC: SageTV Software 1 06-12-2006 05:22 PM
Actively recording in Sage when in KDE. laurenglenn SageTV Linux 2 01-20-2006 08:21 PM


All times are GMT -6. The time now is 03:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.