SageTV Community  

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

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #301  
Old 08-04-2011, 05:39 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jpaddock3000 View Post
Tom,
That is exactly what I needed. Here is the working code for marking a file watched if you stop playback within the last 5 minutes of the show. I'm feeling your pain with DVD's though. Not sure why they aren't working like they are suppose to. I added extra logic for a DVD, the log states its a DVD, but I'm getting a file duration of 1 millisecond for DVD's.

Code:
                if (eventName.startsWith("PlaybackStopped")) {
                    //Capture the difference of how much was watched versus the length of the file
                    Long watchedStatus;
                    if(sagex.api.MediaFileAPI.IsDVD(MediaFile)) { 
                        Log.getInstance().write(Log.LOGLEVEL_TRACE, "sageEvent: PlaybackStopped. Media is a DVD");
                        watchedStatus = sagex.api.MediaFileAPI.GetFileDuration(MediaFile) - duration; 
                    }
                    else { 
                        watchedStatus = sagex.api.AiringAPI.GetAiringDuration(MediaFile) - duration; 
                    }
                    Log.getInstance().write(Log.LOGLEVEL_TRACE, "sageEvent: PlaybackStopped. User " + UserID + " watched " + duration + " milliseconds and the video file is " + sagex.api.AiringAPI.GetAiringDuration(MediaFile) + " milliseconds");
                    Log.getInstance().write(Log.LOGLEVEL_TRACE, "sageEvent: PlaybackStopped. Watched difference is " + watchedStatus + " milliseconds");
                    if(watchedStatus < 300000) {
                        Log.getInstance().write(Log.LOGLEVEL_TRACE, "sageEvent: PlaybackStopped. Watched difference is less than 300000 milliseconds. Setting file watched");
                        MMF.setWatched();
                    }
                }
If you're able to provide any insight, that would be awesome. Otherwise, the code works as is from what I can tell. It would be great if bikesquid can test it out and make sure it works like it should on there system.

For the time being, the plugin will mark the DVD watched as soon as you hit stop, the DVD is marked as watched and when you go to resume playback, you will start at the beginning. Basically, same situation we are already in for DVD's.

Thanks
Jason
Jason,

Glad you got it to build and working.

I'm just as stuck as you on resuming a DVD. There must be a way to do it, but I sure haven't figured it out. What it tries to do now is after playback starts it tries to set the title and chapter to the values that were saved when playback stopped, but that's not working.

Now that you can build the jar you can play around with it and hopefully find a solution. (And have some fun along the way.)

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
  #302  
Old 08-04-2011, 06:20 PM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Something interesting I just noticed, looking at a DVD using Sage Webserver:

Episode: The Dilemma
Aired: Jul 16, 2011 3:53 PM - 3:53 PM
Duration: 0 m

Looks like they couldn't figure out how to tell duration with it either. One thing that is interesting:
Internal details: MediaFileID=9005048 , AiringID=9005069

I noticed that these 2 values are different. Have your tried playing with the AiringID instead of the MediaFileID or vice versa? I would think MediaFileID would be the correct one to use, but just wanted to figure out what you have already done before I tackle this project.

Thanks

* moved DVD length discussion to that topic *
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #303  
Old 08-06-2011, 01:07 AM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Tom,
I got watched status working for both regular content, recordings, and DVD's. You were actually already grabbing the DVD duration with the following command:
Code:
Long Duration       = (Long)eventVars.get("Duration");
You then reset this value a little while later:
Code:
long duration = MediaFileAPI.IsDVD(MediaFile) ? MediaTime : MediaTime - sagex.api.AiringAPI.GetAiringStartTime(MediaFile);
I just made a copy of the first value and called it DVDDuration and now I can see both the duration of regular shows and DVD's.

Next project, get DVD playback to work properly.
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #304  
Old 08-06-2011, 02:11 AM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Tom,
I'm going to need some assistance following your code. From what I can tell, the correct value should be set for DVD playback. I believe the code before set the end of the DVD as the resume playback position which resulted in the video restarting from the beginning. I created some new functions specific for DVD and I can see my functions in the log having the correct value, but playback is still starting at the beginning. Mainly, I just want you to confirm that my new functions should be set in the database and to also verify I didn't miss any sections that need to be updated as well. I have attached the Netbeans folder which has the latest build of the jar as well.

The only 4 files that I touched are API.java, Plugin.java, MultiMediaFile.java, and MultiObject.java. I actually don't think I did anything with API.java, but I might have, so including that in the list.

Here are some of the log entries to show the correct values being set:

Code:
Sat 8/6 0:51:27.935 [PluginEventQueue@177c8ac] MUS: setDVDWatchedDuration: Setting to 7000 for JasonSarah
Sat 8/6 0:51:27.936 [PluginEventQueue@177c8ac] MUS: setRealWatchedEndTime: Setting to Saturday, August 6, 2011 - 12:51:27 AM PDT <1312617087936> for JasonSarah
Sat 8/6 0:51:28.014 [PluginEventQueue@177c8ac] MUS: setWatchedEndTime: Setting to Wednesday, December 31, 1969 - 4:00:07 PM PST <7000> for JasonSarah
Sat 8/6 0:51:28.016 [PluginEventQueue@177c8ac] MUS: sageEvent: Setting MMF info for User=JasonSarah MediaTime=7000 WatchedDuration=7000 Chapter=1 Title=1
Sat 8/6 0:51:28.016 [PluginEventQueue@177c8ac] MUS: sageEvent: DVDPlaybackStopped
Sat 8/6 0:51:28.016 [PluginEventQueue@177c8ac] MUS: sageEvent: DVDPlaybackStopped. Duration = 6025000 MediaTime = 7000
From looking at the AiringAPI, I believe the only 3 values that need to be set are; The Airing Object, Watched Duration, and Real Watch End Time.

I now have all of these values, so hopefully setting them in the correct place will be all that we need.

Your assistance is greatly appreciated!

Jason
Attached Files
File Type: zip MultiUserSupport.zip (268.9 KB, 140 views)
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #305  
Old 08-06-2011, 04:56 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
I'm not sure I know what you are asking. The log snippit indicates to me that you are setting the values correctly.
__________________

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
  #306  
Old 08-06-2011, 08:06 AM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
I'm asking for you to check and verify that the database should be getting updated with those values. Is there an easy way to query the database so I can see what is set, etc.

Thanks
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #307  
Old 08-06-2011, 10:45 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jpaddock3000 View Post
I'm asking for you to check and verify that the database should be getting updated with those values. Is there an easy way to query the database so I can see what is set, etc.

Thanks
Just use the getter methods for the MMF object, for example:

MMF = new MultiMediaFile(sageMediaFile, user), then
MMF.getRealWatchedEndTime(), MMF.getDuration(), etc.

To see a list of the methods look in MultiObject.java and MultiMediaFile.java. The methods in MultiObject can be used on MediaFiles, Airings, and Favorites. The methods in MultiMediaFile can only be used on MediaFiles.
__________________

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
  #308  
Old 08-06-2011, 09:28 PM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341


I got DVD resume playback working as expected!!!!!

The solution was easy once I figured out what was needed.

Code:
sagex.api.MediaPlayerAPI.Seek
I was having a lot of issues getting any DVD control to happen in the API.java file. I think this is because the code was trying to set the DVD chapter and title before actually telling SageTV to watch the video. Instead, I wait for the listening event of PlaybackStarted. At this point, the media player is loaded. I then see if the content is a DVD and if so, seek to the watched duration that we recorded.

I'm so excited!

I'm just doing some additional testing with my videos and once I'm confident, everything is working as expected, I will provide the code so you can update the repository.

Jason
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #309  
Old 08-07-2011, 03:38 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jpaddock3000 View Post


I got DVD resume playback working as expected!!!!!

The solution was easy once I figured out what was needed.

Code:
sagex.api.MediaPlayerAPI.Seek
I was having a lot of issues getting any DVD control to happen in the API.java file. I think this is because the code was trying to set the DVD chapter and title before actually telling SageTV to watch the video. Instead, I wait for the listening event of PlaybackStarted. At this point, the media player is loaded. I then see if the content is a DVD and if so, seek to the watched duration that we recorded.

I'm so excited!

I'm just doing some additional testing with my videos and once I'm confident, everything is working as expected, I will provide the code so you can update the repository.

Jason
Tenacity pays off, and you have plenty of tenacity.
__________________

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
  #310  
Old 08-07-2011, 11:48 AM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Never mind, I did a fresh install on a new computer and did my testing over there. Once I moved it over to my production server, it doesn't work at all. I guess I need to go back to the drawing board.
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #311  
Old 08-07-2011, 06:11 PM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Quote:
Originally Posted by jpaddock3000 View Post
Never mind, I did a fresh install on a new computer and did my testing over there. Once I moved it over to my production server, it doesn't work at all. I guess I need to go back to the drawing board.
Looks like the issue was due to a lack of UIContext being set. I added that in and I'm able resume playback of DVD's on my production environment. Also, you can use the DirectPlaybackControl method to set the DVD Title directly instead of skipping chapters.

I'm still doing some testing as the solution works perfectly on the clean system, but I have a few glitches on my production system that I'm trying to iron out.

Also, were there any other updates/features that you wanted to implement, but didn't have the time?

Thanks
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #312  
Old 08-08-2011, 05:32 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jpaddock3000 View Post
Also, were there any other updates/features that you wanted to implement, but didn't have the time?
None that I can think of.
__________________

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
  #313  
Old 08-08-2011, 08:53 AM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Where does the sorting take place. I thought I might take a crack at why the sorting doesn't work as expected in the folder layout screen.

Also, in your experience with this plugin, any idea why our stop time lets say is at 30 seconds, our seek time is 30 seconds, but sage jumps to 45 seconds? This is an issue I'm having with my production box. My dev machine works perfectly, so I'm guessing it is one of my plugins. I thought I might try the multi-user support plugin updater that makes plugins work with the plugin, but for some reason, Users is not showing up anymore, but I now have a BMT Metadata Scan option, so I'm thinking Users is off the screen. I've attached a screen shot.

Thanks
Attached Images
File Type: png Sage-MissingUsers.png (254.8 KB, 144 views)
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #314  
Old 08-08-2011, 11:06 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jpaddock3000 View Post
Where does the sorting take place. I thought I might take a crack at why the sorting doesn't work as expected in the folder layout screen.

Also, in your experience with this plugin, any idea why our stop time lets say is at 30 seconds, our seek time is 30 seconds, but sage jumps to 45 seconds? This is an issue I'm having with my production box. My dev machine works perfectly, so I'm guessing it is one of my plugins. I thought I might try the multi-user support plugin updater that makes plugins work with the plugin, but for some reason, Users is not showing up anymore, but I now have a BMT Metadata Scan option, so I'm thinking Users is off the screen. I've attached a screen shot.

Thanks
The sorting issue has to do with the way I've implemented one of the APIs. I forget the exact name (and can't check at the moment). Search through API.java for the only method that uses a Vector. (GetMediaFilesWithImportPrefix .. or something like that.) I *think* what's happening is that I get the MediaFiles for each user, but then do not combine them properly into one sorted Vector. That's where I'd start looking.

Looking at your screenshot I do think Users is off the screen. You should be able to hit "down" and then "Right" and have the menu pop up. (Because the entry is on the list, you just can't see it.) You can also install the "Scrolling Setup" plugin which puts a scroll bar on the right side.

As for the 30 second issue - I have no clue!
__________________

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
  #315  
Old 08-08-2011, 11:24 AM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Quote:
Originally Posted by tmiranda View Post
The sorting issue has to do with the way I've implemented one of the APIs. I forget the exact name (and can't check at the moment). Search through API.java for the only method that uses a Vector. (GetMediaFilesWithImportPrefix .. or something like that.) I *think* what's happening is that I get the MediaFiles for each user, but then do not combine them properly into one sorted Vector. That's where I'd start looking.
Yeah, I found where you are talking about. My next question, what were you trying to accomplish in your large amount of code change from r185 to r231? r185 and before had a very simple, 20 lines of code and then it got changed to 97 lines of code. My first thought is to just revert it back to the way it was, but I'm sure you did all the work for a reason. Was something not working before and now it does, etc.

Thanks
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #316  
Old 08-08-2011, 01:44 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jpaddock3000 View Post
Yeah, I found where you are talking about. My next question, what were you trying to accomplish in your large amount of code change from r185 to r231? r185 and before had a very simple, 20 lines of code and then it got changed to 97 lines of code. My first thought is to just revert it back to the way it was, but I'm sure you did all the work for a reason. Was something not working before and now it does, etc.

Thanks
I think that's the revision that added secondary users.
__________________

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
  #317  
Old 08-10-2011, 09:12 PM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Tom,
I'm not having any luck figuring out the why resume playback works perfectly on a clean install, but not on my server. Do you think you can release my code and see if there are any bugs in my code as well as see if the DVD resume works for everyone else?

Thanks
Attached Files
File Type: zip MultiUserSupport.zip (64.2 KB, 136 views)
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #318  
Old 08-11-2011, 05:30 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jpaddock3000 View Post
Tom,
I'm not having any luck figuring out the why resume playback works perfectly on a clean install, but not on my server. Do you think you can release my code and see if there are any bugs in my code as well as see if the DVD resume works for everyone else?

Thanks
Send me the source files that you changed and I'll build it.
__________________

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
  #319  
Old 08-11-2011, 10:04 AM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Please see attached.
Attached Files
File Type: zip MultiUserSupport.zip (269.0 KB, 132 views)
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
Reply With Quote
  #320  
Old 08-17-2011, 09:35 AM
jpaddock3000 jpaddock3000 is offline
Sage Aficionado
 
Join Date: Dec 2006
Location: San Diego, CA
Posts: 341
Tom,
Is there any update on this? I haven't seen a notification to update so I wasn't sure if this ever got done.

Thanks
__________________
Server - Windows Home Server: Sage 7.1.9 HVR-2250 and HD Homerun Dual Tuner, Intel Core2Duo 2.4GHz, RAM 4 GB, HD OS/Movies/Music/Pictures:500GB (SATAII) TV:1TB (SATAII),
Clients - 2 x HD-300, 3 x MediaMVP
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
TV Explorer for the Default STV - Testers Needed tmiranda SageTV Customizations 60 09-18-2009 10:52 AM
Restricted Access STVi - Testers Needed tmiranda SageTV Customizations 10 08-25-2009 05:01 PM
Plugin: SJQ v1.1.0RC1 Available - Testers Needed Slugger SageTV Customizations 35 04-21-2008 08:12 AM
Beta Testers needed for SageTV for Mac OS X!! Narflex SageTV Beta Test Software 39 04-11-2007 03:47 PM


All times are GMT -6. The time now is 07:11 PM.


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