|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Change a recordings file name
Hi,
I have a recording say "house - who am i". the filename it was recorded in was "sageXXX-2.mpg" I would like to change that filename. I am using the sagex.api classes, and I have a refrerence to the mediafile after searching for all tv shows and filtering by show title. Now what? how do I change the file name in the db? Tried this: Code:
public static void main(String[] args) { Object files[] = MediaFileAPI.GetMediaFiles("T"); if (files == null) return; for (int i = 0; i < files.length; i++) { RemoteObjectRef mf = (RemoteObjectRef) files[i]; String title = MediaFileAPI.GetMediaTitle(mf); if (title.indexOf("house") > -1) { Object airingMF = AiringAPI.GetMediaFileForAiring(mf); File[] segFiles = MediaFileAPI.GetSegmentFiles(mf); for (int j = 0; j < segFiles.length; j++) { File file = segFiles[j]; System.out.println("\tSegment files: " + file.getAbsolutePath()); System.out.println("\tpath files: " + file.getParent()); File newFile = new File(file.getParent() + file.separator + "black21.mpg"); file.renameTo(newFile); Object mf1 = MediaFileAPI.AddMediaFile(newFile, ""); MediaFileAPI.SetMediaFileShow(mf1, mf); MediaFileAPI.SetMediaFileAiring(mf1, mf); } } } } Please help.
__________________
Server SageTv 6.3.5, Core2Duo 6300 ,2Gigs ,Saphire x1650, PVR250, 2*320GB + 160GB, java 1.6.1 Client SageTV Client 6.3.5 , AMD 3000, 1024Mb, Saphire x1600Pro256HDMI, java 1.6.1 Using Nielm's Web server 2.22 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change the stv in the client properties file | BBCritical | SageTV Software | 5 | 02-13-2008 03:05 PM |
How do I change the name of an archived file? | Paul H | SageTV Software | 6 | 07-29-2007 05:27 PM |
Change TV Recording File Names & Other questions? | rdb4133 | SageTV Software | 3 | 11-05-2005 12:34 AM |
.TS Firewire capture -- How to change default file name | msmith8228 | Hardware Support | 8 | 04-25-2005 05:16 PM |
Bug: Close client w/o closing file = can't change to other channel | abiharbani | SageTV Beta Test Software | 3 | 05-10-2004 03:43 AM |