SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-17-2012, 11:57 AM
Robert Wise's Avatar
Robert Wise Robert Wise is offline
Sage User
 
Join Date: Aug 2010
Location: Toronto
Posts: 62
Duplicate recordings

I've got quite a few duplicate recordings and it's very time consuming to clean them up. I've reviewed my settings and I think they're OK, so I assume it's a guide issue.

I'd like to write a script to delete duplicates based strictly on the episode #, eg. if I've got three episode 48s, kill two of them. I'd also like to kill those with no episode #, although this would likely need to be show dependent. It would be nice not to even record these shows with incomplete guide info.

I'm not sure what Plugins already exist that might help me or if someone else has already written a script like this?

Or is it easier to clean these up in Explorer and rebuild the show list?
Reply With Quote
  #2  
Old 11-17-2012, 12:30 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Preventing favs from recording episodes with incomplete/generic data is nice and easy:

For each fav you want to apply this logic to, just add a keyword to the fav (leaving the title or whatever else you used to create the fav) intact.

The keyword should be: "EP\d+" (include the quotes).

That will restrict the fav to only record episodes with episode info.

Now, if you want to delete duplicate recordings or recordings with generic show data then a script to do it is also possible. My suggestion: Install sagex-services plugin on your server and run the following groovy script against your server:

Code:
import sagex.api.*

def testMode = true
def existing = new HashSet()
MediaFileAPI.GetMediaFiles('T').each {
    def id = ShowAPI.GetShowExternalID(it)
    if(id.startsWith('SH') || !existing.add(id)) {
        if(testMode)
            println "Would delete: ${MediaFileAPI.GetMediaTitle(it)} ($id)"
        else
            MediaFileAPI.DeleteFileWithoutPrejudice(it)
    }
}
This script finds all duplicate recordings plus recordings with generic show info and either lists them or actually deletes them. Definitely run this script with testMode=true to start with just to make sure it's deleting what you expect it to. Flip that switch to false to actually have the script delete the recordings.

Alternatively, if you have the web server UI plugin installed, you could just install this script as a new web page and run it via your web browser.

WARNING: Use this script at your own risk! I haven't ever used it or even tested it (I just wrote it now). Don't flip that testMode switch until your 100% sure it's only going to delete what you want it to.
__________________
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...
Reply With Quote
  #3  
Old 11-17-2012, 03:22 PM
Robert Wise's Avatar
Robert Wise Robert Wise is offline
Sage User
 
Join Date: Aug 2010
Location: Toronto
Posts: 62
Thanks I will definitely try in Test Mode first. :-)

What are the odds that the showIDs are not unique due to guide issues?

So what if I wanted to build a list of Episode #s by show? I assume I could build a Hashset of show names then iterate through those to build my Episode Hashset?
Reply With Quote
  #4  
Old 11-17-2012, 06:18 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Sure. Where are you getting you're guide data? I'm assuming from Sage EPG service? If not, the script I provided may not be applicable. But, yeah, you can build up a set of ids, titles, whatever you want to narrow what it inspects and deletes. Test mode will be your friend.
__________________
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...
Reply With Quote
  #5  
Old 11-17-2012, 07:09 PM
Robert Wise's Avatar
Robert Wise Robert Wise is offline
Sage User
 
Join Date: Aug 2010
Location: Toronto
Posts: 62
I'm using mc2xml with Schedules Direct.
Reply With Quote
  #6  
Old 11-17-2012, 07:17 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Then the script is good (pending your testing and validation of it ). I'm not sure how many recordings you're going to end up deleting, but that script will find recordings that don't have specific episode data (ShowID=SH*) and duplicates. But you shouldn't have specific episode duplicates (ShowID=EP*) because Sage shouldn't record such episodes more than once, unless you forced it with manual recordings.
__________________
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...
Reply With Quote
  #7  
Old 11-17-2012, 07:38 PM
Dargason Dargason is offline
Sage Expert
 
Join Date: Oct 2003
Posts: 516
Groovy seems like an untapped treasure of sagex.... is there a place where people have posted useful groovy scripts like the one you posted above?
Reply With Quote
  #8  
Old 11-17-2012, 08:26 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by Dargason View Post
Groovy seems like an untapped treasure of sagex.... is there a place where people have posted useful groovy scripts like the one you posted above?
Check the SJQv4 thread. Note, however, that SJQv4 groovy scripts won't quite run in plain old groovy without some tweaks, but it should at least give you a starting point to some ideas. But, ultimately, with Groovy the only real limitation is your imagination. There's not much you can't do with your Sage system via groovy.
__________________
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...
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
duplicate recordings cat6man SageTV Software 0 02-15-2011 03:19 PM
Duplicate recordings Ken C SageTV Software 15 01-13-2009 12:24 AM
Duplicate recordings kzawicki SageTV Software 3 09-07-2008 04:38 AM
Duplicate SD/HD recordings GTwannabe SageTV Software 5 04-21-2008 08:01 AM
Duplicate Recordings rsagetv99 SageTV EPG Service 3 02-24-2006 04:41 PM


All times are GMT -6. The time now is 07:07 AM.


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