SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-17-2009, 08:55 AM
alon24 alon24 is offline
Sage Aficionado
 
Join Date: Jun 2004
Posts: 351
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);
                }
            }
        }
    }
but it just adds to the files for the show and does not replace it.

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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
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


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


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