TiVoToGo Channel Plex Sync problems

In the course of working on the TiVoToGo channel, I have encountered a problem I cannot work around with the plex sync code.  You can find the channel source below, and it works on Windows, OSX, and Linux now.

 

https://github.com/tivoguy/TiVoToGo.bundle

 

After a bit of hacking I was able to prove that the sync code when it issues its request is truncating the service URL data.  I had forced all the arguments to the return video function to be junk and hard coded a response to see if off line sync could be made to work at all, and it does.

 

Is there any way to fix this in the server?  The request comes from part of the plex server where developers cannot make changes.

 

The problem in the log will show up like this:

 

2014-12-09 14:25:21,746 (7f13897fa700) :  CRITICAL (runtime:883) - Exception (most recent call last):
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 843, in handle_request
    result = f(**d)
TypeError: CreateVideoClipObject() takes at least 3 arguments (3 given)
 

 

But the real cause is:

 

2014-12-09 14:25:21,743 (7f13897fa700) :  DEBUG (runtime:717) - Handling request GET /video/tivotogo/createvideoclipobject?container=True&thumb=%2F%3A%2Fplugins%2Fcom.plexapp.plugins.tivotogo%2Fresources%2Fart-default.jpg%3Ft%3D1417752447&title=Friends%3A+Th
 

The handle request didn't get all the data it needed.  The error above is completely misleading, because there are actually more variables defined in the missing data but you only get 3 of the 6 and they are the wrong 3 to make the function actually work properly.

 

I use 64 bit Ubuntu for my development environment, and I am not sure if this problem exists on the other platforms.  I assume there was a buffer that was probably not big enough to hold the sync GET request or something of the like given the very consistent and exact size of the truncation.

Thanks in advance.

 

I'm not sure that anything could be done about this specifically, I believe that the TypeError shown there is a standard python error and not something generated specifically by the channel framework.

Not sure if it would help, but try adding type declarations in the route decorator(https://github.com/tivoguy/TiVoToGo.bundle/blob/master/Contents/Code/__init__.py#L155):

@route('/video/tivotogo/createvideoclipobject', allow_sync = True, container = bool, duration = int)
def CreateVideoClipObject(url, title, thumb, container = False, summary="", duration=14400000, tagline=""):

Set allow_sync = True on the function that creates a directory with videos, not on the "CreateVideoClipObject" function.

Set allow_sync = True on the function that creates a directory with videos, not on the "CreateVideoClipObject" function.

I removed it from the CreateVideoClipObject function and moved it to the main directory area and then the ability to sync anything goes away entirely from the Web UI.

I am reasonably certain that the problem is in the code that marshals requests from the server to the python library.  I was actually able to sync something if I completely hard coded all the values such that the passed arguments didn't matter, using the same function.

Given the fact that one of the arguments is to the function is truncated in the middle and that the python string after URI decode is ~ 128 it looks to me like an array is not big enough.

Thanks for the pointers.

This channel is no longer working. Any updates available?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.