|
SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Automatically remove incomplete recordings?
Hello, Is there any way to make sagetv to look into all recordings and automatically remove any recording that has a "red bar" for beign incomplete? Maybe SJQ? or any other simpler solution?
__________________
Waiting for Sage 8. |
#2
|
|||
|
|||
To my knowledge, there is no setting in the Sage core to do this kind of thing. SJQv4 would be able to do this. But you've got to be careful when deciding which recordings are incomplete.
Basically you want to look at the length of media file and compare it to the length of the airing it was recording. If they aren't near equal then you'd consider it an incomplete recording and delete it. The tricky part is deciding what "near equal" means. For a 30 minute airing you will rarely, if ever, get a media file of length 30 minutes. Depending on your tuner type, IR blaster settings, etc. a 30 minute airing might, at best, produce a recording file of length 29m55s. So you only want to delete recordings if they are outside this "fudge factor". Here's a Groovy script that would do exactly what you're asking for. I'd definitely run it in test mode a few times and look at what it plans to do before flipping that TEST_MODE switch. You'll want to adjust the fudge factor accordingly. Code:
def TEST_MODE = true def FUDGE_FACTOR = 30L // seconds; you probably want to be conservative here MediaFileAPI.GetMediaFiles("T").each { def mfLength = MediaFileAPI.GetFileDuration(it) def airLength = AiringAPI.GetScheduleDuration(it) if(mfLength < airLength - (1000L * FUDGE_FACTOR)) { if(!TEST_MODE) { MediaFileAPI.DeleteFileWithoutPrejudice(it) print "DELETED: " } else print "SKIPPED (test mode): " println "${MediaFileAPI.GetMediaTitle(it)}/${MediaFileAPI.GetMediaFileID(it)} because the media file is ${(airLength - mfLength) / 1000} seconds shorter than the airing!" } } return 0 Code:
SKIPPED (test mode): Friends/1672838 because the media file is 62.664 seconds shorter than the airing! SKIPPED (test mode): Oz/2686686 because the media file is 72.476 seconds shorter than the airing!
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#3
|
||||
|
||||
Note that the above script as written won't detect recordings with gaps in the middle, since (if I'm not mistaken) GetFileDuration measures from the start of the first segment to the end of the last segment, ignoring gaps between segments.
To do it right, you'd want to add up the times of the individual segments. Or you might consider any recording with more than one segment to be incomplete, regardless of gap size. If I were doing this, I'd want to add a test to see if there were any future airings of that show in the schedule before deleting, since presumably the point of deleting it is so that it can record again.
__________________
-- Greg |
#4
|
|||
|
|||
Quote:
Quote:
* checking that there is at least one (maybe more) future airings that can be recorded; maybe actually scheduling a manual record and ensure no conflict arises, which guarantees the "bad" recording will be replaced with a new one (or at least guarantees an attempt will be made to replace it) * adding a MAX fudge factor to account for transcoded recordings where only a certain segment of the recording was transcoded; these wouldn't be bad recordings per se and therefore should not be deleted But I think it's certainly a good starting point and addresses the major concerns of the OP.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#5
|
||||
|
||||
Quote:
Never mind.
__________________
-- Greg |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Incomplete recordings | flavius | SageTV Software | 2 | 05-19-2009 08:32 PM |
Automatically Import Recordings | deadend5001 | SageTV Customizations | 0 | 02-24-2009 08:51 PM |
Incomplete recordings are unplayable | White94Cobra | SageTV Beta Test Software | 9 | 11-21-2006 07:19 PM |
Problem with incomplete recordings | GTwannabe | SageTV Software | 0 | 04-24-2005 02:51 PM |
incomplete recordings-- spastic | buzzerbee | SageTV Software | 2 | 07-29-2004 06:52 AM |