1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PyTivo Video Manager HME App for pyhme

Discussion in 'Developers Corner' started by jbernardis, Apr 20, 2011.

  1. Feb 4, 2012 #561 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    cweb

    I found your problem. It's difficult to explain, but I know what's happening - it's a nasty bug. I have to figure out the best way to correct this - it's not so straight-forward. Give me a bit, but I will get a fix out as soon as I can.
     
  2. Feb 4, 2012 #562 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    As I mentioned above, I located cweb's issue today and have just posted a fix. This was actually two bugs that "worked" together to create the issue cweb reported.

    The fixed version (2.1) has been posted on github. Here is the text from the changelog:

    Version 2.1 - 2/4/2012
    - fixed major bug found by cweb. There were actually 2 bugs.
    1) The cache was being built incorrectly - references by virtual shares were not being properly accounted for. This problem
    would actually solve itself if the cache was written to disk and then read back, but if the cache was built dynamically,
    this "correction" did not happen. As a result, files could be deleted even though there were multiple references, which
    brings us to the second bug:
    2) The logic to see if a file was deletable was wrong. I was attempting to prevent deletion of a file that had multiple
    links (logical or physical) just to keep things simple for myself. Instead I prevented deletion if there were multiple references.
    Since virtual shares create additional references to the same file, this virtually precluded deleting most files. The logic was
    fixed to be based on whether or not there are multiple file system links.
     
  3. cweb

    cweb New Member

    106
    0
    May 29, 2004
    Thumbs up! v2.1 seems to have fixed the issue.
     
  4. Ubipa

    Ubipa New Member

    11
    0
    Apr 22, 2007
    I'm looking for some help on setting up the video manager. HME is running fine, but video manager keeps bailing on an exception. It states No Tivos found and exits with the following traceback:

    File "/root/pyHME/vidmgr/__init__.py", line 302, in handle_active
    self.addShareIcons()
    File "/root/pyHME/vidmgr/__init__.py", line 1339, in addShareIcons
    for share in self.share:

    Here's my HME config:

    Code:
    [hmeserver]
    apps=vidmgr
    
    [vidmgr]
    exts=.mp4
    descsize=16
    
    [tivos]
    tivo1.name=MediaCtrP
    tivo1.tsn=xxxxxxxxxxxxxxx
    
    
    [pytivos]
    pytivo1.config=/root/pyTivo/pyTivo.conf
    pytivo1.ip=10.0.1.15
    pytivo1.port=9032
    pytivo1.sep=/
    And here's my pyTivo Config:
    Code:
    [Flicks]
    force_alpha = True
    type = video
    path = /media/Movies
    
    [_tivo_SD]
    
    [_tivo_HD]
    
    [Server]
    tivo_password = xxxxxx
    tivo_mak = xxxxxxx
    ffmpeg = /usr/bin/ffmpeg
    togo_path = Videos
    tivo_username = xxxxxxxx
    port = 9032

    Any help would be appreciated.
     
  5. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I assume you're running version 1.0 from the content of your ini file. It's important to provide as much information as you can.

    The error message that it can't find any tivos indicates that it can't find the [tivos] section of your ini file, or if it can find the section, that it cannot find any entries of the form tivox.name=xxx and tivox.tsn=xxx.

    From the files you include in your posting, I see that you look to be configured correctly. I guess the next question is what is your execution directory? You need to be IN the pyhme directory when you invoke python. It is not enough to invoke python with the full path of the start.py file.

    Could this be what's happening, because otherwise I can see nothing wrong with what you are doing.
     
  6. jeepguy_1980

    jeepguy_1980 Unregistered User

    250
    0
    Mar 1, 2008
    Newport...
    I am trying to create a virtual share by year, that will sort movies by year, with the newest on top, but in alphabetical order. Is this possible?

    So far I have tried this, which put the newest years on top, but the movies were in reverse alphabetical order.
    Code:
    [Movies By Year]
    tags= movieYear
    sortdirection=down

    I have also tried this, which only added one more folder of years.
    Code:
    [Movies By Year]
    tags= movieYear
    groupby=movieYear
     
  7. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I think what you want to do is say the following:
    Code:
    [Movies By Year]
    tags=movieYear
    sort=title
    
    This will give you groupings my year and each year sorted by title. I think you want to leave the sort direction to default to up so that you get the names in forward alphabetical order.
     
  8. jeepguy_1980

    jeepguy_1980 Unregistered User

    250
    0
    Mar 1, 2008
    Newport...

    That isn't quite what I was going for. I am trying to achieve something like this:
    Code:
    2011
         a
         b
         c
    2010
         a
         b
         c
    1940
         a
         b
         c
    
     
  9. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Sorry - I didn't understand what you were going for. As it stands right now, the grouping item, in this case the year, can only be sorted in an ascending order. If you want, I could probably come up with a scheme to allow reverse sorting. Seems to me it would make sense in this instance.
     
  10. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I have posted version 2.1a on github with the feature jeepguy has requested. This seemed to me to be a desirable feature and it turned out that it was rather trivial to implement.

    Now you can say something like:
    Code:
    [Movies by year]
    tags=movieYear
    tagorder=down
    sort=title
    
    and the tags (in this case the years) will sort backwards so that the most current videos will be first. Within each year, your normal sort order will be maintained. In the example I could have said sortdirection=up, but this is the normal default. If I had set sortdirection=down in the main configuration section of the file, the downward sorting would still apply here too.

    Thus you can control sorting of your "structure" independently of your content.

    EDIT: I forgot to post this last night so hopefully nobody was caught. You will need to rebuild your cache before running this or else you might get a dictionary key exception.
     
  11. Ubipa

    Ubipa New Member

    11
    0
    Apr 22, 2007
    That did the trick. I was doing the latter. Thanks for the help.
     
  12. jeepguy_1980

    jeepguy_1980 Unregistered User

    250
    0
    Mar 1, 2008
    Newport...
    Thanks, that is exactly what I was looking for.
     
  13. lew

    lew Active Member

    3,964
    3
    Mar 12, 2002
    I created a shortcut which points to start.py works fine.
    The target is C:\hme\start.py
    Start in C:\hme

    Windows 7

    I just created a new shortcut. Browsed to find the start.py file.
     
  14. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    OK, i'm trying to get this going on my synology nas. Pyhme is running fine. Vidmgr appears to start fine, but when I try to access it from my tivo, I get this-

    Exception happened during processing of request from ('192.168.1.125', 37346)
    Traceback (most recent call last):
    File "/opt/lib/python2.5/SocketServer.py", line 464, in process_request_thread
    self.finish_request(request, client_address)
    File "/opt/lib/python2.5/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    File "./start.py", line 141, in __init__
    client_address, server)
    File "/opt/lib/python2.5/SocketServer.py", line 522, in __init__
    self.handle()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
    method()
    File "./start.py", line 232, in do_GET
    self._page(True)
    File "./start.py", line 186, in _page
    appinst.mainloop()
    File "/usr/local/pyhme/hme.py", line 1134, in mainloop
    self.startup()
    File "/usr/local/pyhme/vidmgr/__init__.py", line 108, in startup
    raise ConfigError("No Tivos found - exiting")
    ConfigError: No Tivos found - exiting

    Any thoughts as to what I am doing wrong?
     
  15. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    That's the error message you get when you don't have any tivos defined in your ini file. Here is an extract from vidmgr.ini.dist:
    Code:
    #
    # the tivos section of the file is where you identify your Tivos.  For each tivo, you MUST provide a name and
    # a TSN.  It is NOT necessary to put the dashes into the TSN - just use the digits.  In the tags below, replace the
    # X with a digit starting at 1 (e.g. tivo1.name).  If you have multiple tivos, number them sequentially.  You can have
    # an arbitrary number of tivos, but vidmgr will stop parsing the file as soon as it detects a gap in the
    # numbering sequence.  These fields have no default values.
    #
    
    [tivos]
    # tivoX.name=
    # tivoX.tsn=
    You need to specify a name and a TSN for each tivo that you have. For example if you have 2 tivos, you would have somethign line this:
    Code:
    [tivos]
    tivo1.name=Family Room
    tivo1.tsn=123456789
    tivo2.name=Master Bedroom
    tivo2.tsn=987654321
    
    of course, you'd have real tsn's.

    The numbers in the above tags start at 1 and increment by 1. If you have a gap in the numbers, vidmgr stops parsing the file.
     
  16. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    OK, getting closer I think- now I get this:

    Exception happened during processing of request from ('192.168.1.125', 37038)
    Traceback (most recent call last):
    File "/opt/lib/python2.5/SocketServer.py", line 464, in process_request_thread
    self.finish_request(request, client_address)
    File "/opt/lib/python2.5/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    File "./start.py", line 141, in __init__
    client_address, server)
    File "/opt/lib/python2.5/SocketServer.py", line 522, in __init__
    self.handle()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
    method()
    File "./start.py", line 232, in do_GET
    self._page(True)
    File "./start.py", line 186, in _page
    appinst.mainloop()
    File "/usr/local/pyhme/hme.py", line 1134, in mainloop
    self.startup()
    File "/usr/local/pyhme/vidmgr/__init__.py", line 119, in startup
    raise ConfigError("No shares found - exiting")
    ConfigError: No shares found - exiting
     
  17. windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    Did you use the vidmgr.ini.dist file as a starting point for your vidmgr.ini file? It seems to be missing a lot of the required sections.

    At the end of that file there are instructions on how to add your virtual shares.
     
  18. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    I can't quite figure that section out - I thought I could just use the

    values = all

    line and that would be enough - I guess it isn't - what other section there do I have to have to make the shares seen?
     
  19. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    The no shares found message comes out after processing the pytivo config file(s) and before any vritual shares are defined. Your pytivo needs to be serving at least 1 video share, and your vidmgr.ini needs to point to that pytivo's config file. As windracer suggests, I recommend you look at vidmgr.ini.dist - that contains instructions for how to set all of this up.
     
  20. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    OK, i'm making baby steps here- now I get this:


    Exception happened during processing of request from ('192.168.1.125', 35437)
    Traceback (most recent call last):
    File "/opt/lib/python2.5/SocketServer.py", line 464, in process_request_thread
    self.finish_request(request, client_address)
    File "/opt/lib/python2.5/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    File "./start.py", line 141, in __init__
    client_address, server)
    File "/opt/lib/python2.5/SocketServer.py", line 522, in __init__
    self.handle()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
    File "/opt/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
    method()
    File "./start.py", line 232, in do_GET
    self._page(True)
    File "./start.py", line 186, in _page
    appinst.mainloop()
    File "/usr/local/pyhme/hme.py", line 1134, in mainloop
    self.startup()
    File "/usr/local/pyhme/vidmgr/__init__.py", line 98, in startup
    config = Config.Config()
    File "/usr/local/pyhme/vidmgr/Config.py", line 66, in __init__
    if not self.cfg.read(fn):
    File "/opt/lib/python2.5/ConfigParser.py", line 267, in read
    self._read(fp, filename)
    File "/opt/lib/python2.5/ConfigParser.py", line 490, in _read
    raise e
    ParsingError: File contains parsing errors: /usr/local/pyhme/vidmgr/vidmgr.ini
    [line 262]: ' values=all\n'
     

Share This Page