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 10-21-2010, 09:03 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Question about AddMediaFile()

I have a question about AddMediaFile.

Is there a way to use a TempMediaFile to make sure the path is part of one of the import paths? (short of parsing it and doing it myself) hoping there is an api call I am missing on this one.

What happens if you add a media file that is not under a import path is it still added? ( I know temps are okay but what about adding)

cheers
Reply With Quote
  #2  
Old 10-21-2010, 10:12 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
In v6, adding a file to a non-media dir was fine. Haven't really tested it in v7, but I'd expect it'd be the same result.

If you wanted to make sure the path of a file to be added is a registered media dir then it shouldn't be any harder than:

Code:
File f = new File("filename"));
for(File mediaDir : MediaDirs) { // Use whatever API call gets to the list of dirs
   if(f.getAbsolutePath().startsWith(mediaDir.getAbsolutePath())) {
      isMediaDir = true;
      break;
   }
}

if(isMediaDir)
   <whatever>
else
   <whatever>
__________________
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 10-21-2010, 10:26 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by Slugger View Post
In v6, adding a file to a non-media dir was fine. Haven't really tested it in v7, but I'd expect it'd be the same result.

If you wanted to make sure the path of a file to be added is a registered media dir then it shouldn't be any harder than:

Code:
File f = new File("filename"));
for(File mediaDir : MediaDirs) { // Use whatever API call gets to the list of dirs
   if(f.getAbsolutePath().startsWith(mediaDir.getAbsolutePath())) {
      isMediaDir = true;
      break;
   }
}

if(isMediaDir)
   <whatever>
else
   <whatever>
Thanks I was hoping not to have to loop through but no big deal
Reply With Quote
  #4  
Old 10-21-2010, 10:56 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,834
Plucky,

I can confirm that in sage7 you can add a mediafile to a path that is not defined as an import path. You can also do the neat trick of changing the ID to something that starts with "EP" to convert the mediafile from an imported video to a recording.

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #5  
Old 10-21-2010, 11:12 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by tmiranda View Post
Plucky,

I can confirm that in sage7 you can add a mediafile to a path that is not defined as an import path. You can also do the neat trick of changing the ID to something that starts with "EP" to convert the mediafile from an imported video to a recording.

Tom
Thanks that begs another question how does a user get rid of the media file out of the library since it isn't in one of his import paths...

cheers
Reply With Quote
  #6  
Old 10-21-2010, 04:39 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,834
Quote:
Originally Posted by PLUCKYHD View Post
Thanks that begs another question how does a user get rid of the media file out of the library since it isn't in one of his import paths...

cheers
I might not be understanding your question. It still shows up as an Imported Video or a recorded TV show so just select the video and delete it. If you want to delete it programatically just use the normal Delete() MediaFileAPI method.

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
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
RunLibraryImportScan vs. AddMediaFile broconne SageTV Studio 6 10-15-2010 06:13 AM
Using AddMediaFile properly tmiranda SageTV Studio 2 04-11-2010 03:47 PM
In place recompression and AddMediaFile() TiltRod SageTV Studio 6 12-16-2005 07:47 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.