SageTV Community  

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

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-03-2009, 09:27 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
API call to convert show title to file name?

When recording 'The Tonight Show with Conan O'Brien' Sage creates the recording file as:

TheTonightShowWithConanOBrien-xxxx-n.ts

Is there an API call that will convert the full show title to that used in the file name for the recording (i.e. remove puncuation, spacing, etc. as SageTV does when creating files)? Or is Sage perhaps using a Java API call that I'm over looking?
__________________
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
  #2  
Old 06-03-2009, 10:15 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,595
What are you trying to accomplish? You can easily get the filename(s) for an existing recording w/o trying to build it yourself.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #3  
Old 06-03-2009, 11:43 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Excellent point, assuming that Sage will always drop hyphens from show names then I can just take everything in front of the first hyphen in the file name? (reply to a post another user deleted)
__________________
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
  #4  
Old 06-03-2009, 11:49 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,610
I don't think there is an exposed function to do this, but, if I had to guess (and i am), then i'd think it would be something like this...

Code:
title = title.replaceAll("[^a-zA-Z0-9]","") + "-" + airingId + "-" + segmentNumber + "." + ext;
But, given that you have the airingId, then you can simply use the SageAPIs to get the filename for the mediafile associated with the airing.
Reply With Quote
  #5  
Old 06-03-2009, 12:38 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
To my knowledge, there is no API contract to the effect that filenames shall have a particular format or obey a particular naming rule. In principle the core is free to name files as it sees fit, so long as it provides an API for obtaining the actual filename(s) chosen for an existing recording (which it does). It does not provide a way of predicting what the filename will be for a future recording, nor is there any guarantee that any prediction rule you come up with will remain valid in future versions.

So I guess I'm wondering the same thing Andy is: what is it you're trying to do that requires that sort of predictability?
__________________
-- Greg
Reply With Quote
  #6  
Old 06-03-2009, 02:42 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,186
Or to look at it another way:

What are you doing where you'll have a Show/Episode title string, but not a handle to the SageTV MediaFile/Airing object from which you could get the file handle (GetFileForSegment)

Everything you do inside Sage revolves around having an Airing or MediaFile object/handle, including displaying the name (GetAiringTitle/GetShowTitle/GetShowEpisode called on the MediaFile/Airing object). Thus if you got the title string from the API, it's trivial to get the file name/path.

Last edited by stanger89; 06-03-2009 at 02:45 PM.
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
Sort() API call sorts core's internal lists in place? Slugger SageTV Studio 1 02-09-2009 01:30 PM
Clarify the title/artist bit eg. [DVD TITLE] / [MOVIE TITLE]? bcjenkins SageMC Custom Interface 1 12-31-2008 11:58 AM
Using Keystroke API call...how do you send non-printable chars? beelzerob SageTV Studio 23 03-02-2008 10:41 PM
Call Batch File scoful SageTV Studio 1 12-06-2006 10:31 PM
Having trouble handling what an api call returns... beelzerob SageTV Studio 2 05-31-2006 07:45 PM


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


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