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. cweb

    cweb New Member

    106
    0
    May 29, 2004
    Got it. It works just fine. I just didn't know what it was failing at.

    Thanks.
     
  2. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I just uploaded a new version - 2.2b. I added a new value to the groupby parameter for virtual shares. If you specify groupby=alpha, it will create folders in the virtual share for each starting letter (or number) of the title item. So for example, if you have a virtual share of actors, it is potentially very large. With this groupby option, it will create up to 37 sub-groups (26 alpha, 10 digits, 1 OTHER) with only the actors that start with that character in the sub-folder. This makes navigation of large groups easier.

    As a side result of this, I now allow a list to be the grouping item. Previously this had been disallowed.
     
  3. May 9, 2013 #663 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Version 2.2c has been uploaded to GIT. This version fixes a bug that caused a crash if the sortroot option was set to True and a virtual share sorted ahead of a physical share. While I was in there, I changed the savepushdate setting to savepushdata and I also save the tivo names that have been pushed to in addition to the push date. The name savepushdate is still supported for backward compatibility, but both mean the same thing.
     
  4. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Version 2.2d is now up on GIT. There was a lingering bug from the previous fix regarding the sorted position of virtual shares. Should be OK now
     
  5. Apr 9, 2014 #665 of 735
    jeepguy_1980

    jeepguy_1980 Unregistered User

    250
    0
    Mar 1, 2008
    Newport...
    I had to rebuild my server and I can't get vidmgr to work. Every time it tries to start vidmgr it says
    Code:
    Skipping: vidmgr - No module named Image
    
    I know that this means I should install the python imaging library and I have done so, but I am still getting this error. Do you have any ideas?
     
  6. Apr 9, 2014 #666 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    You're absolutely right - it means the PIL hasn't been installed. Perhaps you didn't install it correctly??

    There's really nothing I can do because my code isn't really coming active. This error occurs at load time.
     
  7. Apr 9, 2014 #667 of 735
    jeepguy_1980

    jeepguy_1980 Unregistered User

    250
    0
    Mar 1, 2008
    Newport...
    Can you confirm if pyhme is compatible with the latest version of pillow? Or know of some way to test it?

    I'm running fedora and have done a yum install of python-imaging. I've tried re-installing it too.

    My python is version 2.7-5.9.fc19
    My Python-pillow is: 2.0.0-12-gitd1c6db8.fc19
     
  8. Apr 9, 2014 #668 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I don't know about overall compatibility, but this is having an issue just loading the package. You can go into python interactively and just type "import Image" and see if you get an error.

    You ARE talking about python 2.x (I'm using 2.7) and not 3.0. My program is not compatible with 3.0. You also need to be sure you downloaded PIL for your version of 2.x and not 3.0.
     
  9. Apr 9, 2014 #669 of 735
    jeepguy_1980

    jeepguy_1980 Unregistered User

    250
    0
    Mar 1, 2008
    Newport...
    I figured it out. It took me a while before I even posted and then I figured it out pretty quick.

    I actually had to run the following command
    Code:
    easy_install pillow-pil
     
  10. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    I've never really looked into the sort=titleNumber meta value, but now I have some TV series on DVD with multiple titles on each DVD, I want to be able to sort by title number. When I put

    Code:
    sort=titleNumber
    into vidmgr.ini, I get the following error when I attempt to run Buildcache:

    Code:
    Processing DVD share DVD
    177 DVD Videos found
    Processing video share RAID Server
    2028 Videos found
    Processing video share Unverified
    53 Videos found
    Browse Series (grouped by Series Title) count: 692 videos in 16 groups
    Traceback (most recent call last):
      File "/usr/share/pyhme/vidmgr/BuildCache.py", line 30, in <module>
        c.build(verbose)
      File "/usr/share/pyhme/vidmgr/VideoCache.py", line 336, in build
        nd = h.getNode()
      File "/usr/share/pyhme/vidmgr/Meta.py", line 56, in getNode
        self.nodeMap[n].sort()
      File "/usr/share/pyhme/vidmgr/Node.py", line 139, in sort
        s = sorted(self.videoList, cmpVidNodes)
      File "/usr/share/pyhme/vidmgr/Node.py", line 118, in cmpVidNodes
        tb = b.formatSortText(self.opts['sortopt'])
      File "/usr/share/pyhme/vidmgr/VideoFile.py", line 197, in formatSortText
        result += data
    TypeError: cannot concatenate 'str' and 'int' objects
    
    The sort directive is in the general config body, because the DVD share is real, not virtual, so there is no virtual section in which to place it.

    Also, when attempting to get the metadata info on a DVD title (either a single-title or multi-title DVD), I get an error:

    Code:
    An error occurred while running the application.  The application closed during a read (0x50006).
    From the log:

    Code:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
        self.finish_request(request, client_address)
      File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/usr/share/pyhme/start.py", line 142, in __init__
        client_address, server)
      File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
        self.handle()
      File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
        self.handle_one_request()
      File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
        method()
      File "/usr/share/pyhme/start.py", line 233, in do_GET
        self._page(True)
      File "/usr/share/pyhme/start.py", line 187, in _page
        appinst.mainloop()
      File "/usr/share/pyhme/hme.py", line 1134, in mainloop
        while self.active and self.get_event():
      File "/usr/share/pyhme/hme.py", line 1187, in get_event
        handle(keynum, rawcode)
      File "/usr/share/pyhme/vidmgr/__init__.py", line 238, in handle_key_press
        self.vwInfo.loadmetadata(meta)
      File "/usr/share/pyhme/vidmgr/InfoView.py", line 195, in loadmetadata
        self.addline(m, meta[m])
      File "/usr/share/pyhme/vidmgr/InfoView.py", line 123, in addline
        for w in dstring.split(' '):
    AttributeError: 'int' object has no attribute 'split'
    default.txt
    Code:
    title : JAG
    seriesTitle : JAG
    movieYear : 1995
    description : Harmon Rabb, a former F-14 pilot in the Navy now works as a lawyer for the Navy Judge Advocate General.
    Title 0: Ignore
    Title 1: A New Life
    Title 2: Ignore
    Title 3: Shadow
    Title 4: Desert Son
    Title 5: Ignore
    starRating : x5
    mpaaRating : N8
    vProgramGenre : Action
    vProgramGenre : Adventure
    vProgramGenre : Crime
    vProgramGenre : Drama
    vProgramGenre : Series
    vProgramGenre : War
    vDirector : Donald P. Bellisario
    vWriter : Donald P. Bellisario
    vActor : David James Elliott
    vProgramGenre : Action
    vProgramGenre : Adventure
    vProgramGenre : Crime
    vProgramGenre : Drama
    vProgramGenre : Series
    vProgramGenre : War
    __T01.mpg.txt:
    Code:
    seriesTitle : JAG
    episodeNumber : 001
    description : Series Pilot.  Lt. Harmon "Harm" Rabb, a JG Lawyer who investigates and litigates crimes committed by Navy and Marine personnel, looks into the mysterious death of a female pilot aboard an aircraft carrier. Harm is convinced the female pilot who fell overboard didn't commit suicide, but was actually pushed, with all the suspects aboard the aircraft carrier.
    seriesId : SH151366
    title : A New Life
    vWriter : Donald P. Bellisario
    What am I doing wrong?
     
  11. telemark

    telemark New Member

    1,544
    1
    Nov 12, 2013
    Either the sort routine is not robust or you have bad/mixed metadata.

    With a large number of files is easy to have some bad metadata. Try the same thing but with a single file at a time.

    And then do the same thing but with pairs of files.

    PS: Is this legal? It sounds alot like what the error is complaining about.
    Code:
    Title 0: Ignore
    Title 1: A New Life
    Title 2: Ignore
    Title 3: Shadow
    Title 4: Desert Son
    Title 5: Ignore
     
  12. lpwcomp

    lpwcomp Active Member

    8,081
    2
    May 6, 2002
    John's...
    Definite possible source of the problem. Maybe he should try it with no space between Title and the number, i.e. Title1, Title2, etc.
     
  13. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    It doesn't help with the information error. It will take me rather a long time to edit all the default.txt files to see if it fixes the sort error.
     
  14. May 1, 2014 #674 of 735
    lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    I removed all the default.txt files except 1, and in that file I eliminated the space between the Title parameter and the title number. The error when running Buildcache went away, but the sort still does not work properly, and the error when attempting to display the metadata remains.
     
  15. May 5, 2014 #675 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Version 2.2e has been posted on github. I fixed 3 separate bugs, all found by lrhorer. He was also most helpful in testing and debugging.

    The problems were:
    - fixed improper handling of integer metadata - specifically the episode number of a DVD title
    - fixed DVD Share sorting - it now properly sorts on the sort specification instead of the display spec
    - fixed improper parsing of Virtual Shares - was not recognizing 'display' settings
     
  16. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I just updated GIT again - version 2.2f. The major change is that I added a new ini file option - metamergeparent (default false). When this is set to True (and metamergefiles is true) vidmgr will work UP the directory tree from the current location and merge any default.txt files it finds before reading and adding in the normal metadata. This allows, for example, for you to have a default.txt file that contains the cast for a series of programs in the parent directory, and not have it duplicated in each local metadata file.

    In addition to this, I fixed a bug that allowed for metadata entries that are lists to have duplicated entries. I now make sure the entries in these lists are unique.

    As usual, follow the v2 link in my signature.

    Thanks again to lrhorer for testing and for inspiring the feature.
     
  17. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    And thanks to Jeff for his exemplary continued support of this product.

    I would like to expand on the new feature just a bit. Its greatest use is probably with the ripped DVD application available with pyTivo, but if one chooses to organize one's directory structure in a hierarchical fashion based probably on series season, this can be very handy for ordinary video files, as well. So, for example, I have the first four seasons of JAG on DVD stored on the server. The structure is like this:

    Code:
    JAG => Season => Disk # => Episode
    Now David James Elliot and Patrick Labyorteaux, for example are both in every single episode, so the top directory has a default.txt file in it with both of their names as vActor. Neither appears in any of the subdirectory metafiles, but they both show up in every single video listing for JAG. Tracy Needham, however, was only in season 1, so her name appears in the default.txt file for JAG => Season One. Catherine Bell was in every episode startng with Season Two, so her name appears in every Season default.txt file starting with Season Two. John M Jackson is in every Season directory except the first and the last, etc. Bell also starred in one episode of Season One, so her name appears in the metadata file for that particular episode. Trevor Goddard first appeared half-way through Season Four, so his name appears in the default.txt files in JAG => Season 4 => Disk 3, 4, 5, and 6.

    Using this feature, I was able to quickly and easily place each of the major cast members in their appropriate videos without having to fiddle endlessly with each and every metafile. This means not only does each episode show the proper cast list, but when searching by vActor, each video for a particular cast member shows up under their name. Thus, for the virtual share:

    Code:
    [Browse by Actor]
    tags = vActor vGuestStar
    groupby=alpha
    David James Elliot shows up in 219 episodes, Catherine Bell shows up in 203 videos, including 198 episodes of JAG, Steven Culp shows up in 32 episodes, etc.
     
  18. jeepguy_1980

    jeepguy_1980 Unregistered User

    250
    0
    Mar 1, 2008
    Newport...
    Does VIDMGR handle .nfo files? I know pyTivo incorporated this, but it seems that VIDMGR isn't reading my .nfo files.
     
  19. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I don't know what .nfo files are. If you could give me some information, I'll see what I'd be willing to do.
     
  20. jeepguy_1980

    jeepguy_1980 Unregistered User

    250
    0
    Mar 1, 2008
    Newport...
    They are hybrid xml files that have become the standard for this sort of metadata.

    http://wiki.xbmc.org/index.php?title=NFO_files/movies

    Sent from my HTC6525LVW using Tapatalk
     

Share This Page