SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

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 07-08-2010, 01:06 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Help with creating a playlist from Temp Media Files

I am having issue creating a Playlist from Temporary created MediaFiles. The do not have a sage id (and won't) but then at the end I am adding a MediaFile that does have a sage id. The end result is only the MediaFile is getting added to the playlist.

I am using sagex to build this playlist in java as follows
Code:
 Object NewPlaylist = sagex.api.PlaylistAPI.AddPlaylist(NewPlaylistName);
  File[] TempFiles = ListOfTempFiles
I then loop through and add the TempFiles to the playlist like so
Code:
Object TempMediaFile = sagex.api.MediaFileAPI.CreateTempMediaFile(TempFiles[i].toString());
 sagex.api.PlaylistAPI.AddToPlaylist(NewPlaylist,TempMediaFile);
I then add the MediaFile to the end of it and it seems to be the only thing getting added any ideas?
Reply With Quote
  #2  
Old 07-08-2010, 01:19 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
To add to this on log printout it is creating the TempMediaFiles but it is giving them all the same MediaFileID of "0" should that be the case?
Reply With Quote
  #3  
Old 07-08-2010, 01:25 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I think when I played with this, i tried doing something very similar, and the result was that CreateTempMediaFile() could only ever create a single temp file, and a second call would simply overwrite the previous call. Because of that, I found CreateTempMediaFile to not have much value, especially when you could have multiple clients, etc.

I was using it to dynamically build up a playlist of .vob files so that I could watch DVDs on my placeshifter clients, but in the end, it didn't work.

I thought that somewhere there was a discussion about it, but I'm not sure where, maybe for CreateTempMediaFile and you might hit on that thread as well.
Reply With Quote
  #4  
Old 07-08-2010, 01:30 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
I think when I played with this, i tried doing something very similar, and the result was that CreateTempMediaFile() could only ever create a single temp file, and a second call would simply overwrite the previous call. Because of that, I found CreateTempMediaFile to not have much value, especially when you could have multiple clients, etc.

I was using it to dynamically build up a playlist of .vob files so that I could watch DVDs on my placeshifter clients, but in the end, it didn't work.

I thought that somewhere there was a discussion about it, but I'm not sure where, maybe for CreateTempMediaFile and you might hit on that thread as well.
I read that thread and I am pretty sure Jeff said there would be a fix in the next build. That was probably 3 builds ago.

Last edited by PLUCKYHD; 07-08-2010 at 01:32 PM.
Reply With Quote
  #5  
Old 07-08-2010, 02:00 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
This should work...the only caveat was that you can only add temp media files to the now playing playlist (since that's the only temporary playlist and you can't save a temporary media file into a persistent playlist which will exist in the DB). If it's not working as designed, let us know.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #6  
Old 07-08-2010, 02:19 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by Narflex View Post
This should work...the only caveat was that you can only add temp media files to the now playing playlist (since that's the only temporary playlist and you can't save a temporary media file into a persistent playlist which will exist in the DB). If it's not working as designed, let us know.
I have done this (adding temp MediaFiles to the Now Playing list) and it works fine for me. In my opinion this is the only sensible way to use temp MediaFiles anyway; adding temporary files to a permanent playlist is not a well-defined concept.
__________________
-- Greg
Reply With Quote
  #7  
Old 07-08-2010, 02:24 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by GKusnick View Post
I have done this (adding temp MediaFiles to the Now Playing list) and it works fine for me. In my opinion this is the only sensible way to use temp MediaFiles anyway; adding temporary files to a permanent playlist is not a well-defined concept.
I agree I didn't even know the know playing list existed until now.

But I am still not able to get this to work as it won't add my temp media files to the playlist even though it shows it creates the temp media file.

I have changed the above to this
Code:
 Object NewPlaylist = sagex.api.PlaylistAPI.GetNowPlayingList(UIContext);
It still is only adding the file with the mediaid and not the temp files although the log tells me the temp files are created fine.

Any ideas Greg?
Reply With Quote
  #8  
Old 07-08-2010, 04:52 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
When in doubt, strip it down to basics and see if that works. Then build back up from there.

For instance, try this in Expression Evaluator:

Code:
AddToPlaylist(GetNowPlayingList(), CreateTempMediaFile("C:\\somedir\\somefile.mp3"))
Does that work? Can you see the track in the Now Playing list in the Music browser? If so, try it again with a different filename. Do both tracks show now?

Now try writing a loop in widget code to add multiple files from an array. Test it using Execute Widget Chain. If that works, then try using sagex APIs instead of the built-in APIs.

In short: debug. There's an error in some code somewhere, so test each piece in isolation to figure out where.
__________________
-- Greg
Reply With Quote
  #9  
Old 07-08-2010, 05:07 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
You said check if it shows up in music this works for videos too right? Just double checking I think so but your comment through me off.

And yes going to start in studio and do process of elimination thanks for the advice
Reply With Quote
  #10  
Old 07-08-2010, 06:01 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by PLUCKYHD View Post
You said check if it shows up in music this works for videos too right?
Yes, it works for videos. Either playlist browser (music or video) can show you the contents of Now Playing.
__________________
-- Greg
Reply With Quote
  #11  
Old 07-08-2010, 06:03 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by GKusnick View Post
Yes, it works for videos. Either playlist browser (music or video) can show you the contents of Now Playing.
Okay thanks for the clarification. I will start in studio using the default sage methods and go from there.
Reply With Quote
  #12  
Old 07-09-2010, 06:27 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
From testing I don't think the nowplaying playlist shows up in the playlist section. I can add items to a the playlist and verify they are there by playing it but it does not show up in the playlist section of the ui.
Reply With Quote
  #13  
Old 07-09-2010, 10:32 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Sure it does. It's not in the quick-pick playlist flyout on the Main Menu, but if you actually enter the Playlists section of the music or video browser (using Select instead of right arrow, grrr), it's there.
__________________
-- Greg
Reply With Quote
  #14  
Old 07-09-2010, 11:27 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by GKusnick View Post
Sure it does. It's not in the quick-pick playlist flyout on the Main Menu, but if you actually enter the Playlists section of the music or video browser (using Select instead of right arrow, grrr), it's there.
Yup you are correct darn right arrow and select gets me everytime
Reply With Quote
Reply


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

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
settings related to live tv temp files? vince100 SageTV Software 1 11-09-2009 06:51 AM
stopping HD-PVR from creating files tvmaster2 Hardware Support 8 09-07-2009 02:20 PM
stvxxxxxxxxxxxxxxx.img files in C:\temp mkanet SageTV Software 4 04-15-2009 11:28 AM
Moving thumbs and other temp files? MattHelm SageTV Software 3 02-19-2007 09:36 AM
Creating and Repeating a Video Playlist rolandtroisch SageTV Studio 2 02-06-2006 03:15 AM


All times are GMT -6. The time now is 05:55 PM.


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