|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#1201
|
||||
|
||||
You shouldn't have to extend the api or anything, the funtion you need is already in the API. there are basically 3 api calls you'd need. ClearWatched(sage.Airing Airing), SetWatchedTimes(sage.Airing Airing, long WatchedEndTime, long RealStartTime), and SetWatched(sage.Airing Airing). All in the Airing API.
__________________
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 |
#1202
|
|||
|
|||
Quote:
Code:
http://usr:pwd@host:port/sagex/api?c=AiringAPI.GetAiringDuration&1=3507454&encoder=json Code:
{"Result":0}
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site. |
#1203
|
||||
|
||||
Brian = LehiBri from the forums yes. He has moved on to other things, so not sure if he still monitors the forums.
While what Fuzzy said is tech. correct the issue is in when you would actually send this command to SageTV. Once library scan is done there is no communication back with the media except for playback. In order for it to work you would have to set your plex scanner to detect changes in the media folder, and THEN run logic inside the scanner which would check for Watched flags in plex ON EVERY recording. once it found one it woudl then call the api to set it in SageTV. The issue here though is if there is no change in the recordings directory, you wouldn't have any changes that would trigger the code to execute.The code lives in the scanner/bmt agent which is only run when plex finds a new piece of media and proceeds to call the metadata agent. |
#1204
|
||||
|
||||
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#1205
|
|||
|
|||
Quote:
Code:
http://user:pwd@host:8080/sagex/api?c=GetAiringDuration&1=3530652&encoder=json Code:
{"Result":0} Code:
http://user:pwd@host:8080/sagex/api?c=plex:GetMediaFileForName&1=PersonofInterest-SearchandDestroy-3507454-0.mpg&encoder=json Code:
... "MediaFileID":3530652 ...
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site. |
#1206
|
|||
|
|||
Quote:
It'll have to be something separate such as the standalone sageplex_sync tool that the user runs manually every now and then (or set it up to run periodically like a cron job), or perhaps even a SageTV plugin that can periodically perform the sync either using the sageplex_sync tool or entirely within Java code. So, phase1, get the sync tool working. phase2, perhaps a native sagetv plugin that performs the sync.
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site. |
#1207
|
||||
|
||||
Since you cannot pass objects through the http request, you'll likely have to use EvaluateExpression to pass in a more advanced (compound) function. Something like:
Code:
/sagex/api?c=EvaluateExpression&1=GetAiringDuration(GetAiringForID(25885579))
__________________
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 |
#1208
|
||||
|
||||
It may help to take a look at what already in the .js file that sits on the sage server. It may already have what you need in there, I can't quite remember.
|
#1209
|
||||
|
||||
Quote:
Quote:
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#1210
|
|||
|
|||
Quote:
Quote:
This worked beautifully: Code:
http://user:pwd@host:8080/sagex/api?c=GetAiringDuration&1=airing:3507454&encoder=json Code:
{"Result":3540000}
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site. |
#1211
|
||||
|
||||
Bah.. EvaluateExpresison is still cleaner... :-)
__________________
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 |
#1212
|
||||
|
||||
I use the EvaluateExpression, a lot, but I was thinking that I could have sworn that I had support for native object types (And I did)
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#1213
|
|||
|
|||
Testing my two way sync tool. When exactly does Sage consider the show watched? I assume this is X away from ending, where X can be a time or percentage?
I need to know this as the 2 system treats watched shows differently. Sage position will stay at the end, while PLEX position will reset back to beginning. If you re-watch a show, Sage clears the watched status while PLEX don't (they keep a watch count). Want to avoid unnecessary syncs. I am currently using 5% from ending as a guess. Using the same rule that Sage does would be better.
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site. |
#1214
|
|||
|
|||
if you get this working lmk the quickest way to make it automatic it a hook in the stv everytime playback is stopped your tool resynchs the watch status for the file. so leave a way for me to pass the file and I'll add the hook.
|
#1215
|
|||
|
|||
Quote:
Need to see if there's a quick way to locate a PLEX media from the Sage media, as otherwise may need to do some caching. Also not sure if it can be made automatic the other way (when you stop watch a PLEX show). That would be ideal.
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site. |
#1216
|
|||
|
|||
Quote:
That being said glad to see you attempt it. It is something that would be nice to see in sage. |
#1217
|
||||
|
||||
Totally agree with PLUCKY about how horrible it is to work with plex (and their apis). That's pretty much why I abandoned any plex/sage integration, myself.
That being said, maybe you can figure something out by looking through the Trakt plugin for plex. (I have to admit there was way more code here than I ever expected to see) https://github.com/trakt/Plex-Trakt-Scrobbler Another option might be to simply write a Trakt plugin for sagetv and then use the trakt plugins on plex and sagetv to keep the watched statuses in sync on each platform.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#1218
|
||||
|
||||
Quote:
|
#1219
|
|||
|
|||
With the sageplex_sync.exe tool, is it possible to pass it a SageTV MediaFileID? Right now, it seems to only except the Plex media ID.
I'm trying to setup a SJQ task that can update the Plex watched position, and I would like to be able to do it on a per recording basis (instead of having to go through all of my SageTV recordings). |
#1220
|
|||
|
|||
Quote:
PLEX web client does have a search function, and I can probably look at the HTTP request sent and see if I can use it. If not, then another option is to build a cache index on demand.... But, I've been busy testing my new implementation of the two way sync in sageplex_sync. It's coming along nicely. Lots of corner cases to handle due to the way the two system differs in how they treat watched shows, etc... Should be out soon, stay tuned...
__________________
sagetv-for-plexmediacenter v8.3.1 is available! Github/Download site. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
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 |