|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Using the Sage API
Well, I lost 1 TB (still have 3TB+ of other ones) of shows due to a major server crash. And now I was needing a way to list all Media files (Recorded TV shows anyway) on a single list, that shows me the physical file names of all the MediaFiles.
I see there are a few functions in the MediaFile API that might help me, such as, GetMediaFiles() GetSegmentsFiles() And IsTVFile Since I have 1000's of shows recorded now, I need to prepare this list so that I can go into the SageTV program and delete each of the shows that were recorded on the now dead server. I dont want to retain the shows in my SageTV recordings when then no longer exist in the real world. Plus I would like to export it as xml so I can print it off, and re-record them when possible. And check off my list as they are recorded. It might sound like using a tank to kill a knat...but I have done programming before and am also anxious to try my hand at making a little utility that would do this in SageTV. I was hoping someone could just give me a high level over view of what might be involved in doing so. Such as 1. download Java SDK, download eclipse, how to use Studio to do something like this? I dont mind spending the time learning everything. But the WAF approval rating is dropping now that we lost a lot of shows So it would be real nice if I can at least clean up the mess quickly, so she isnt trying to watch non existing shows. I know there is source code out there for the Neilm web server, I briefly looked at that too. So it seems there are two options, use Studio to make such a utility, or attempt to hack up the web server source code down to a tiny size that just runs the functions I want, or add an additional screen in the web server code to do what I explained above. Any guidence would be appreciated. If it matters I have Visual Studio.net enterprise 2002 and 2003 that I use for work. BUT I havent done much programming with java before. So I can understand the Class descriptions and functions/methods etc that I saw here http://download.sage.tv/api/index.html But trying to make a small program/utility to do this seems like climbing Mt. Everest from where I am sitting. |
#2
|
||||
|
||||
Do you mean the recording dir no longer exists due to a system crash? Recordings will automatically be removed from the database if SageTV can 'see' the drive where the files previously existed & thus it can tell they aren't there any more.
If the recording dir was using a drive letter, map that drive letter to some empty location. If it was a UNC path, I suppose that could be more difficult if the PC is no longer available. I would be tempted to try renaming some other system to use the missing server's name temporarily rather than trying to do a manual cleanup. (Makle bakcup copies of your wiz.bin first, of course.) You used to be able to set make_all_mediafiles_local=true to make it clean out such missing locations, but I think that property is always true now. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#3
|
|||
|
|||
If the shows were favorites and not set as watched, Sage will record them again the next time they air (assuming the favorite isn't set for first run only). The only shows that would require an effort on your part would be manual recordings and shows flagged as watched.
If it were me I'd make sure the watched status was cleared for the lost favorites, make a list of any manual recordings and first run only favorites and then do as Opus suggested to clear out the lost recordings. BTW I'm just assuming you can clear the watched status of the lost shows before removing them from the db. I've never tried it on lost recordings (never had any before). Last edited by blade; 10-28-2006 at 04:51 PM. |
#4
|
||||
|
||||
As Andy said, you don't need to write any code to clean up dead database entries. Just show Sage an empty folder where those files used to be and it will do the cleanup automatically.
If you're still interested in getting into customization, you can accomplish quite a lot in Studio without writing a line of Java code. (The entire default STV is written that way, for instance.) All the functions in the Sage API docs are directly callable from Studio code (which uses Java-like expression syntax but is not true Java). Writing real Java code is necessary only for functions that are too laborious or unwieldy to code directly in Studio, or if you want to write a background process (such as Niel's web server) that always runs regardless of which STV is loaded. For learning Studio, the best place to start is the Studio manual and tutorial. For learning Java, there are extensive API docs and tutorials at Sun's Java website. Links have been posted before, so search this forum and you should find them.
__________________
-- Greg |
#5
|
|||
|
|||
Quote:
I was assuming that SageTV was still retaining a list in its internal database of all those shows that got erased (I mean when the server went offline and had to be rebuilt ---its a long story) |
#6
|
|||
|
|||
Quote:
Thanks for the information. It sounds like I can just experiment a little with Studio (instead of writing java code) to show me the kind of information I want. Even though one of my servers crashed and I lost all the shows, I would still like to have a list I can export as xml, or at least show on the screen of all the SageTV recordings...and which server they were recorded on. PS Im also trying to track down a possible ghost in the machine...and determine if its related to one server or not. Having a list of all shows and which server they were recorded on, would be tremendously helpful to me. I have lots of file servers now, with a minimum of 1TB each of storage on each. Its a beast and I need to get it under control. :-O So I really need this type of a list. I have been anxious to make a little utility or widget in Studio, but never had a specific reason. But now I do. |
#7
|
|||
|
|||
Quote:
The thing is, that once I rebuilt it, I put it back into the list of video recording directories available to SageTV. So it started recording new shows to it. And I have no idea if it deal with the missing files when I first enabled the VADER\Video1-4 directories. I use UNC paths for all the directories listed in SageTV. So it was like \\VADER\Video1 - Video 4 that I lost when it died. And then I added them back into Sagetv's recording directories list, once the server was up and running. I have so many servers now, with SageTV files on them, its making me a little crazy. I created a beast with so many servers and hard drives and OS's to maintain. And lots of MVP's too :-O uuugh What have I done !!!! |
#8
|
|||
|
|||
Quote:
The problem is, that I have 1000's of shows now. I kind of went nut-so and have setup lots of servers and TB's of hard drives, and recorded entire series of shows since last year, and way too many movies ))) which is why I wanted to make a list automatically. So to go through them one at a time would take me way too long. Of course, based on what Andy said, maybe those shows that got erased when the server was rebuilt and put back online, might not even be in my sagetv database anymore. I dont know. Seems like I have created somewhat of a mess, when that server died!!! Thats what I get for having dozens of hard drives. Geeeze it started with one 400Gb, and that didnt take me long to realize I needed a few more. sigh |
#9
|
|||
|
|||
Quote:
To make matters slightly worse, I think that server is having some other issues after rebuilding it, so I took it out of the recording directories on sagetv. I need to do some serious troubleshooting before I put it back into full time production again. But the server IS running now, just not in the rotation for video recording directories. I use only UNC paths for all my files. So based on what you said to do, Im not sure where that would leave me. I just dont understand the real inner workings of what sagetv might have done, based on what I did. By that I mean, having the server crash, rebuilding it using same name, putting it back online using UNC paths, then letting sage start recording to it again (until I may have spotted a problem with shows recording to it -like slowness/jerkiness) so then I proceeded to take it out of the list of recording directories. Sooooo now I dont know what the heck to do about it. I would really like to query sagetv's database so I can have a printable list of all shows recorded to that server. (well a list of all shows with which server is really what I wanted in the first place) And one thing I saw happening is that I would try to watch the recordings (without realizing yet they were gone -due to the dead server) and sagetv of course reports some error message about the file not being there or whatever it says. So somehow, I think sagetv is still retaining a list of those old files from the dead server...and I figured if I just could have a list of all shows and their recording directory, then I can manually sit at the server and review each of the 4 directories to see what files are there or not. And if they are physically gone, then I need to make sagetv think they are gone. But thats a separate problem I can deal with later. Just need to find out whats going on in a little more detail with those files. Sorry for rambling on and on about this, but its pretty frustrating to have lost the server and all the files, and somehow I dont think sagetv recovered the way it was supposed to. And that could because of me messing around with things too much Last edited by steingra; 10-28-2006 at 10:07 PM. |
#10
|
|||
|
|||
Quote:
If Sage can access the directory and sees the recordings are no longer there it will delete them from its db. If you used a different recording directory after rebuilding the server the data should still be in Sage. If you used the exact same path Sage should have purged it. Of course what should happen and what does isn't always the same. |
#11
|
|||
|
|||
Quote:
|
#12
|
|||
|
|||
Quote:
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|