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
  #1041  
Old 04-07-2015, 05:00 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by Fuzzy View Post
Has plex added any ability to read and write watched tags so they could be synced between sage and plex?
I don't know why but I occasionally get watched status from SageTV in Plex.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #1042  
Old 04-07-2015, 05:04 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
I think it brings sage watched status into plex with the file is added, but I think Pix64 said there was no way to change the plex status when it changes in sage without removing the file from plex and reimporting it. Also, this needs to be 2-way, so that when you watch something in Plex, it will update the watched status in sage as well.
__________________
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
  #1043  
Old 04-07-2015, 05:44 PM
wildgoose wildgoose is offline
Sage Advanced User
 
Join Date: Jan 2010
Location: CA
Posts: 156
Quote:
Originally Posted by Fuzzy View Post
Has plex added any ability to read and write watched tags so they could be synced between sage and plex?
The plugin will set the watched flag for the media in PLEX on the initial import in Agent.update() after the scanning phase.

Afterwards however if you do a ' Update Library' operation in PLEX, the framework will skip over all existing files when invoking the Scanner, so the scanner doesn't see the files and Agent.update() won't be called on it as well. Hence it will not get any updated watched status on existing files that's already in the library. Update library may bring in new files and those will have their watch status migrated.

I don't think there's a way around this unless PLEX changes how things work, or add some extensions/hooks for agent to update metadata without any changes to the files.

Last edited by wildgoose; 04-07-2015 at 06:21 PM.
Reply With Quote
  #1044  
Old 04-07-2015, 06:26 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
I was thinking more about a separate process that used an API to read and set that data periodically - not necessarily a part of the agent - but I don't know how extensive the plex API is.
__________________
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
  #1045  
Old 04-07-2015, 06:36 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
No there are ways to set and changed watched status know that as I found it the other day but I'm not in right computer for link.
Reply With Quote
  #1046  
Old 04-07-2015, 06:51 PM
wildgoose wildgoose is offline
Sage Advanced User
 
Join Date: Jan 2010
Location: CA
Posts: 156
Quote:
Originally Posted by Fuzzy View Post
I was thinking more about a separate process that used an API to read and set that data periodically - not necessarily a part of the agent - but I don't know how extensive the plex API is.
Ah! That should be possible. Setting the watched/unwatched flag is simply a HTTP request using a PLEX media id. If there's a way to enumerate a PLEX library and get the id and filenames for each show, then one can simply query sagetv for the new status and update it on plex. This can be done periodically or on demand, and can probably be made 2-way as I assume it would be easy to set the flag in SageTV as well via sagex.

But I need to look into what this API is though. I suspect something already exist as PLEX has a full browser based UI without a password. Since sagex is also accessed via HTTP, one might be able to do this entirely in javascript inside a browser (so you open up some html page to sync the shows between sage/plex..)
Reply With Quote
  #1047  
Old 04-07-2015, 07:03 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Honestly, the best place for this to run would be from a jar plugin in sage that simply runs periodically. To do it right, and handle the 2-way correctly, it woul dhave to maintain it's own database of all media files from each side, with the watched status (ideally the watched to timestamp) on each side. Then, when it parses through a file, it checks each server, compares it to its last stored value in its database, and then updates the value in the other server. That's really the only way to keep them in sync, since there is not going to be a timestamp for when a watched status was changed in either.
__________________
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
  #1048  
Old 04-07-2015, 09:30 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Just installed the new update and all I have to say is "wow"! Much improved! The speed is night and day different. Please let me know if you need any testing. I would be happy to help out.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #1049  
Old 04-07-2015, 10:12 PM
wildgoose wildgoose is offline
Sage Advanced User
 
Join Date: Jan 2010
Location: CA
Posts: 156
Quote:
Originally Posted by Fuzzy View Post
Honestly, the best place for this to run would be from a jar plugin in sage that simply runs periodically. To do it right, and handle the 2-way correctly, it woul dhave to maintain it's own database of all media files from each side, with the watched status (ideally the watched to timestamp) on each side. Then, when it parses through a file, it checks each server, compares it to its last stored value in its database, and then updates the value in the other server. That's really the only way to keep them in sync, since there is not going to be a timestamp for when a watched status was changed in either.
I was thinking about the same thing on the way home! A plug-in either in PLEX or sage would make more sense, but I have a feeling Sage will provide more flexibility.

I looked into PLEX HTTP interface a bit. It is indeed possible to walk the entire library relatively easily.

Here's some API info I found: https://code.google.com/p/plex-api/w/list

Essentially start at http://127.0.0.1:32400/library/, and the 'key' data from the resulting XML object can be used to append to the URL and browse the entire collections:

Code:
http://127.0.0.1:32400/library/
http://127.0.0.1:32400/library/sections/
http://127.0.0.1:32400/library/sections/80/
http://127.0.0.1:32400/library/sections/80/all ->
http://127.0.0.1:32400/library/metadata/10590/children
http://127.0.0.1:32400/library/metadata/10591/children
http://127.0.0.1:32400/library/metadata/10592
At this point you are at a leaf node, and 10592 is the media-id that you can use to set/unset the watched flag.

So this should be totally doable.
Reply With Quote
  #1050  
Old 04-07-2015, 10:13 PM
wildgoose wildgoose is offline
Sage Advanced User
 
Join Date: Jan 2010
Location: CA
Posts: 156
Quote:
Originally Posted by Taddeusz View Post
Just installed the new update and all I have to say is "wow"! Much improved! The speed is night and day different. Please let me know if you need any testing. I would be happy to help out.
Thank you and I am glad it worked well for you!
Reply With Quote
  #1051  
Old 04-07-2015, 11:02 PM
mdnttoker mdnttoker is offline
Sage Aficionado
 
Join Date: Aug 2006
Posts: 446
Quote:
Originally Posted by wildgoose View Post
Hi everyone!

I am happy to announce the general availability of sagetv-for-plexmediacenter v8 beta!

https://github.com/ai7/sagetv-for-plexmediacenter/

You can find the download in the release section.

Note: I've tested this on Windows. I'll test Mac/Linux as soon as I get around to it. In the mean time, if you are on Mac/Linux and are familiar with this plugin, feel free to give it a spin and let me know how it works and what adjustments are necessary.
This is great news, thanks!

One quick question: The old version only worked with Java 7. Is that still true with the updated code?

Thanks!
-D
Reply With Quote
  #1052  
Old 04-07-2015, 11:46 PM
wildgoose wildgoose is offline
Sage Advanced User
 
Join Date: Jan 2010
Location: CA
Posts: 156
Quote:
Originally Posted by mdnttoker View Post
One quick question: The old version only worked with Java 7. Is that still true with the updated code?-D
Sorry don't quite understand the question. The plugin is for PLEX. Mostly written in Python with a small JavaScript file for SageTV side. It doesn't have any dependency on Java.

SageTV itself uses Java. Any Java compatibility issue will remain the same and will not be affected by this plugin.

Thanks.
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site.

Last edited by wildgoose; 04-08-2015 at 11:45 AM.
Reply With Quote
  #1053  
Old 04-08-2015, 08:32 AM
mdnttoker mdnttoker is offline
Sage Aficionado
 
Join Date: Aug 2006
Posts: 446
Quote:
Originally Posted by wildgoose View Post
Sorry don't quite understand the question. The plugin is for PLEX. Mostly written in Python with a small JavaScript file for SageTV side. It doesn't have any dependency on Java.

SageTV itself uses Java. Any Java compatibility issue will remain the same and will not be affected by this plugin.

Thanks.
Couldn't remember if the JAVA 8 incompatibility was on the Sage/Jetty side or the Plex side. Guess it's the Sage/Jetty side.
Reply With Quote
  #1054  
Old 04-08-2015, 07:31 PM
tvmaster2's Avatar
tvmaster2 tvmaster2 is offline
SageTVaholic
 
Join Date: Jun 2005
Location: tarana
Posts: 4,240
Quote:
Originally Posted by Taddeusz View Post
Just installed the new update and all I have to say is "wow"! Much improved! The speed is night and day different. Please let me know if you need any testing. I would be happy to help out.
was the install process simple? was any modification to files needed as was the cast during the initial install of the previous Pix package?
__________________
Sage 9 server = Gigabyte AMD quad-core - 4 gigs - integrated ATI HD4200 chipset - SSD boot, Hitachi Deskstar show drives. HD-PVR - Colossus - Win7 32 bit. HD200/300’s networked. HDHomerun tuner. "If you've given up on Weird Al, you've given up on life" - Homer Simpson
Reply With Quote
  #1055  
Old 04-08-2015, 07:56 PM
wildgoose wildgoose is offline
Sage Advanced User
 
Join Date: Jan 2010
Location: CA
Posts: 156
Quote:
Originally Posted by tvmaster2 View Post
was the install process simple? was any modification to files needed as was the cast during the initial install of the previous Pix package?
The configuration for scanner/agent has been consolidated into one sageplex_cfg.json file that you need to modify and put into your root PLEX data folder. The scanner/agent bundle itself don't need to be modified at all. Simply delete the current scanner/agent bundle, and paste the new one in place.

It is somewhat simpler but still a manual process.
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site.
Reply With Quote
  #1056  
Old 04-08-2015, 07:56 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by tvmaster2 View Post
was the install process simple? was any modification to files needed as was the cast during the initial install of the previous Pix package?
The install process was pretty much as simple as the original if not more so since you only need to edit a single configuration file. No need to go into each source file like before. The only inconvenience was the need to remove the SageTV libraries and then perform the install. But as fast as this new scanner is that doesn't matter as much.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #1057  
Old 04-08-2015, 08:40 PM
tvmaster2's Avatar
tvmaster2 tvmaster2 is offline
SageTVaholic
 
Join Date: Jun 2005
Location: tarana
Posts: 4,240
Quote:
Originally Posted by Taddeusz View Post
The install process was pretty much as simple as the original if not more so since you only need to edit a single configuration file. No need to go into each source file like before. The only inconvenience was the need to remove the SageTV libraries and then perform the install. But as fast as this new scanner is that doesn't matter as much.
which is the config file that needs editing, the one that goes in the top level Plex folder?
And all the libraries created need to be deleted and rebuilt? I wasn't sure if that was the case.
__________________
Sage 9 server = Gigabyte AMD quad-core - 4 gigs - integrated ATI HD4200 chipset - SSD boot, Hitachi Deskstar show drives. HD-PVR - Colossus - Win7 32 bit. HD200/300’s networked. HDHomerun tuner. "If you've given up on Weird Al, you've given up on life" - Homer Simpson
Reply With Quote
  #1058  
Old 04-08-2015, 08:52 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by tvmaster2 View Post
which is the config file that needs editing, the one that goes in the top level Plex folder?
And all the libraries created need to be deleted and rebuilt? I wasn't sure if that was the case.
Yes, just the single config file. Only the libraries that use the SageTV scanner need deleted and recreated.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
Reply With Quote
  #1059  
Old 04-08-2015, 09:11 PM
tvmaster2's Avatar
tvmaster2 tvmaster2 is offline
SageTVaholic
 
Join Date: Jun 2005
Location: tarana
Posts: 4,240
Quote:
Originally Posted by Taddeusz View Post
Yes, just the single config file. Only the libraries that use the SageTV scanner need deleted and recreated.

ok, thanks. and the new version scans large libraries noticeably faster?
__________________
Sage 9 server = Gigabyte AMD quad-core - 4 gigs - integrated ATI HD4200 chipset - SSD boot, Hitachi Deskstar show drives. HD-PVR - Colossus - Win7 32 bit. HD200/300’s networked. HDHomerun tuner. "If you've given up on Weird Al, you've given up on life" - Homer Simpson
Reply With Quote
  #1060  
Old 04-08-2015, 09:15 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by tvmaster2 View Post
ok, thanks. and the new version scans large libraries noticeably faster?
I don't know what you consider large but it scans our recording library of over 300 recordings in a few minutes. It took much longer for Plex to get all the frame grabs for each recording but the bulk of the initial scan was completed in about 5-10 minutes.
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3
Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver
Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD
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
Comparing to Plex heffneil Batch Metadata Tools 20 01-08-2012 04:54 PM
Need help with SJQv4 remote agent coppit SageTV v7 Customizations 4 12-19-2010 11:03 AM
Plex in a TV? What about sage? rwc General Discussion 9 09-05-2010 04:38 PM
Possible to get SageTV to handle my library more like Plex? DAMAC SageTV Mac Edition 0 06-10-2009 10:33 AM
SagetTVService Virus Win32.Agent.dwo Ponchera SageTV Software 6 02-04-2008 06:33 PM


All times are GMT -6. The time now is 01:24 PM.


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