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 11-15-2016, 11:18 AM
CollegeProject CollegeProject is offline
Sage Advanced User
 
Join Date: Aug 2016
Location: USA
Posts: 119
Clients

I have a question on how clients operate. I have a implementation class and it works fine on the server (it saves information to a folder and updates on a timer).

What is the preferred method to give client computers access to that file? I am guessing I need to put a IfClients on the implementation class and just copy the file from the server. My questions is do implementation classes call Run() when clients are started?

Sorry I don't run clients and just trying to grasp how they work without having to setup a VM.
Reply With Quote
  #2  
Old 11-15-2016, 11:56 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
There are a couple different file access API calls. Some will access files in the 'local' filesystem (which on the server or miniclients/extenders, is the server's filesystem; on a client this would be the client's filesystem). There are other API calls that access the file on the server's filesystem, regardless if called from server or client.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #3  
Old 11-15-2016, 01:55 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by CollegeProject View Post
I have a question on how clients operate. I have a implementation class and it works fine on the server (it saves information to a folder and updates on a timer).

What is the preferred method to give client computers access to that file? I am guessing I need to put a IfClients on the implementation class and just copy the file from the server. My questions is do implementation classes call Run() when clients are started?

Sorry I don't run clients and just trying to grasp how they work without having to setup a VM.
Communicating between SageClients and the server is always an issue. What I normally do is use the "standard" plugin and then check in the start() method if it's running on the client or the server using the IsClient() API. If it's running on the server I do whatever startup needs to be done. If it's on a client I just return.

To pass data between the client and server I generally use the UserRecord API because it stores data in the wiz.bin which is accessible from client or server.

Depending on what I am trying to do I either use polling or a SageEvent to let the server know the client needs something to happen.

Be very careful accessing files, a Fuzzy mentioned sometime the APIs give you paths that work only on the server. You also have to remember that the client and server may be different operating systems which use different path separators. It gets messy real fast

Let me know what you are trying to do, maybe I can give you more detailed "do and don't" information.
__________________

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
  #4  
Old 11-15-2016, 09:40 PM
CollegeProject CollegeProject is offline
Sage Advanced User
 
Join Date: Aug 2016
Location: USA
Posts: 119
I think that gives me what I needed thank you. I basically write a JSON file to a server location and I just need to copy that JSON file to the client pc shouldn't be a big deal just have to get the code done to do it.

Now keeping it updated and such will require checks against modified time should be fun

Thanks for the pointers not having a client but supporting it is proving tricky.
Reply With Quote
  #5  
Old 11-15-2016, 09:44 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Alternatively, the JSON may not actually be the best method to use either. There are some capabilities for storing user database information in the main sagetv database, which would then handle this all for you, and actually caches data on the clients in a smart and high performance way.

http://sagetv.com/api/index.html?sag...RecordAPI.html
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #6  
Old 11-15-2016, 11:30 PM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,657
Quote:
Originally Posted by Fuzzy View Post
Alternatively, the JSON may not actually be the best method to use either. There are some capabilities for storing user database information in the main sagetv database, which would then handle this all for you, and actually caches data on the clients in a smart and high performance way.

http://sagetv.com/api/index.html?sag...RecordAPI.html
I can't agree more with this approach. SageTV already has very solid and efficient protocols to communicate between the client and server. I don't recommend trying to re-invent this. If you have a special case that you don't think the API adequately supports, I highly recommend extending the core API by contributing to the v9 project on Github.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG
Reply With Quote
  #7  
Old 11-16-2016, 07:22 AM
CollegeProject CollegeProject is offline
Sage Advanced User
 
Join Date: Aug 2016
Location: USA
Posts: 119
Thanks for the feedback I don't choose JSON it's what my external service gives me to work with. I originally stored the Jason into custom java objects and used the userrecord API. The problem was the source I am using requires me to update any changes data a min of every 24 hours. Using the api key wasn't very efficient for my use case but I'll give it another look. I am not looking to add to the core api right now outside of my scope for this project maybe after. It would be over 18k objects I'll look at userrecord.

Storng in Json since that is what I receive in and retrieving into custom java objects is extremely fast and efficient and also min in space. I have read many forums about people complaining about their sagedb sizes creeping up and was trying to avoid contributing too that as well. As with all programming more than one way to slice and it's always interesting to get other ideas.

Thanks again
Reply With Quote
  #8  
Old 11-16-2016, 07:37 AM
jusjoken jusjoken is offline
SageTVaholic
 
Join Date: Dec 2005
Location: Strathmore, AB
Posts: 2,727
You could just have the client perform the function itself rather than sharing between the server and clients for this data as long as its not too intensive.

Or use a central folder concept like fanart does.

k
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page
Reply With Quote
  #9  
Old 11-16-2016, 07:56 AM
CollegeProject CollegeProject is offline
Sage Advanced User
 
Join Date: Aug 2016
Location: USA
Posts: 119
Quote:
Originally Posted by jusjoken View Post
You could just have the client perform the function itself rather than sharing between the server and clients for this data as long as its not too intensive.

Or use a central folder concept like fanart does.

k
Ya the central fanart concept may be best I'm going to look at some options this week with userrecord just seems excessive to store that much in there.
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
2 clients on the same pc? Eternal SageTV Software 0 06-15-2011 08:43 PM
Multiple clients tombailey SageTV Media Extender 5 11-13-2007 11:18 PM
How to log off clients mattbrad2 SageTV Software 4 12-22-2006 11:23 AM
Clients lock up on 2.1 SPHurley SageTV Software 3 11-08-2004 07:57 AM
Number of Clients Robert Howard General Discussion 8 10-10-2003 07:56 PM


All times are GMT -6. The time now is 11:16 AM.


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