|
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.) |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
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? |
#2
|
|||
|
|||
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) } } 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... |
#3
|
||||
|
||||
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? |
#4
|
|||
|
|||
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... |
#5
|
||||
|
||||
I'm using mc2xml with Schedules Direct.
|
#6
|
|||
|
|||
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... |
#7
|
|||
|
|||
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?
|
#8
|
|||
|
|||
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... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
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 |