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

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Values=all is not a valid statement in the configuration file. Please read vidmgr.ini.dist file for instructions on how to configure.
     
  2. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    I'm at a loss then. I see this:

    # there are four possible ways to indicate which files to include. You must use exactly 1 of them for each virtual share:

    then this:

    # 4. include ALL videos unconditionally:
    #
    # values=all

    so I tried values=all

    but you say that can't be done. Then i tried this:

    [Movies Alphabetically]
    alpha=Title
    shares=MyMovies

    and it is back to no shares found. Believe me, I have read that thing over and over.
     
  3. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Can you post your ini file - please mask out your TSN's. That might be the easiest way to do this.

    I wasn't thinking about virtual shares earlier - I thought you were having problems getting actual shares to appear.
     
  4. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    As I look at the earlier trace you provided, that error is not from my code - it is from the configparser module. I think you had a syntax error in your file. Can you also post what you were trying to do earlier?
     
  5. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    # vidmgr.ini
    #
    # this is the global options file - it belongs in the vidmgr directory under pyhme
    #
    # Default values are specified below.

    #
    # NOTE:
    #
    # These default values do NOT need to be explicitly stated in this file. They are here for illustration
    # you can leave them in here if you want, or you can remove them and only include in here the options you
    # are changing
    #

    #
    # vidmgr section is mandatory
    #

    [vidmgr]

    #
    # what file extensions are we interested in. Only files with these extensions will be
    # displayed on screen
    # specify a list of file extensions - with the . - separated by at least one space
    #

    exts=.mp4 .mpg .avi .wmv

    #
    # the next 4 options specify format information for the info screen that pops up
    # when you press the info button.
    # specify a list of metadata tags for each.
    #

    metaignore=isEpisode isEpisodic __fileName __filePath
    metafirst=title seriesTitle episodeTitle description
    metaspacebefore=
    metaspaceafter=

    #
    # the next two options are also formatting options for the info screen. The info screen is
    # a two column layout. the infolabelpercent option indicates what percentage of the
    # screen width should be devoted to the label column
    #
    # the inforightmargin option specifies the width of the right margin on the info screen. If
    # you find the text running up against the right edge of the screen, increase this number.
    #

    infolabelpercent=30
    inforightmargin=20

    #
    # the next two options control how multiple metadata files are handled. When searching for
    # metadata, vidmgr looks for the files in the following sequence:
    # .meta/default.txt
    # default.txt
    # .meta/<videofilename>.txt
    # <videofilename>.txt
    #
    # metamergefiles determines if the contents of one file are merged with previous files or if
    # it completely replaces the previous file. If this is set to true, since the files are read
    # from the general to the specific, more specific information will replace more general information,
    # but the end result will be the union of all the files. If this is set to false, then only the
    # information in the last file read will be kept.
    #
    # metamergelines if only meaningful if metamergefiles is set to true. If set to true, then if
    # two files contain the same metadata tag, then the values are concatenated together. If set to
    # false, then the value from the second file replaces the value from the first file. Note -
    # metadata tags that are already lists (vActor, etc) are always merged regardless of the value of
    # this option.
    #

    metamergefiles=True
    metamergelines=False

    #
    # specify the point size of the font used to display the descriptive text of a video on the main screen
    #

    descsize=20

    #
    # the image files that vidmgr uses for its background, etc, can be replaced. These files all reside
    # in a directory named 'skins' under the vidmgr directory. If you wish to use your own image files,
    # create a directory under skins, place your files there, and name that directory with the skin option.
    # Note: the files must be png files and must match the original images in size. Only the images being
    # changed need be specified. If an image file is NOT found in your skin's directory, the corresponding
    # file is taken from the main skins directory.
    #
    # There is no default for this. Do Not include this option unless you are using your own skin
    #
    # skin=

    #
    # can the files in this directory be deleted - specify true or false.
    #

    deleteallowed=True

    #
    # specify how you would like the artwork for a video to be justified - specify left, center, or right
    #

    thumbjustify=left

    #
    # specify the name of the file to use for the folder and for the video file if a video specific file is not found
    #

    thumbfolderfn=folder.jpg

    #
    # what metadata tags should be used to construct the string used to identify this file on the screen
    # specify a list of metadata tags - including any metadata tags you may have created yourself. In addition to the
    # normal metadata tags, you can use the word 'file' to indicate the video's file name (without the directory) and
    # you can use the value 'titleNumber' to indicate the title number for a DVD video.
    #

    display=title episodeTitle

    #
    # what string should be used to separate the above metadata when constructing the title string
    # specify an arbitrary string
    #

    displaysep=:

    #
    # what metadata tags should be used to construct the string that is used to sort the videos when they
    # are displayed in a list specify a list of metadata tags - including any metadata tags you may have created yourself. In addition to the
    # normal metadata tags, you can use the word '__fileName' (or 'file') to indicate the video's file name (without the directory),
    # '__filePath' to indicate the video's full directory path, or the value 'titleNumber' to indicate the title number for a DVD video.
    #

    sort=title episodeTitle

    #
    # which direction should the sort be
    # specify up for an ascending sort or down for a descending sort
    #

    sortdirection=up

    #
    # should a leading article (the, a, an) in a 'title' or 'episodeTitle' be ignored when sorting on that title. Note that the displayed
    # title will not change i.e. "The Abyss" will still show up as "The Abyss", but it will be sorted in with the A titles.
    #

    ignorearticle=True

    #
    # the next options control the contents of the top of the navigation tree. If sharepage is set to true, the top page will
    # contain an entry that says 'Browse Shares'. This will take you to a separate page where the shares are listed.
    # If it is set to false, then each share will be on the top screen.
    # if sortroot is true, the virtual shares and the actual shares will be sorted together. If it is false (the default)
    # then the actual shares will appear above the virtual shares. Both will be sorted, but one will appear before the other
    #

    sharepage=true
    sortroot=false

    #
    # what text string should be used for the subtitle on the top navigation screen. The subtitle normally gives
    # a cue as to where you are in the navigation, but no such cue is necessary when at the top; this string will
    # be displayed instead
    # default: topsubtitle=Main Menu
    #
    # topsubtitle=

    #
    # by default, vidmgr will check file unique IDs so that it knows if two files are actually the same file with two
    # different links. On windows, this is an expensive operation. This affects the amount of time needed to build
    # the cache. If you are not using links in your video directories, you can essentially disable this logic by
    # setting the following option to false. The default is true
    #

    usefileid=True


    #
    # 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]
    tivo1.name=Basement
    tivo1.tsn=x



    #
    # the pytivos section is where you identify your pytivo processes. The tags are numbered as above - replace the X
    # with a digit starting from 1 andproceeding sequentially from there. You MUST provide config - which is a full
    # path to the pyTivo.conf file, and ip - which is the ip address of the machine on which pytivo is running. If
    # the config file does NOT specify a port number for pytivo, then you MUST specify it here. pytivoX.skip is a
    # comma-delimited list of shares that you do NOT want to include here - do NOT use extra spaces in this list.
    # pytivoX.sep is the file path separator for the machine on which pytivo is running - if this is omitted, then
    # the seperator character for the machine on which vidmgr is used.
    #

    [pytivos]
    pytivoX.config=/usr/local/pyTivo/pyTivo.conf
    # pytivoX.sep=
    pytivoX.ip=192.168.1.113
    pytivoX.port=9032
    # pytivoX.skip=



    #
    # now come the virtual shares - there can be an arbitrary number of these. Whatever text you put between the square
    # brackets as the section name will become the text that appears on the navigation screen. Each virtual share MUST
    # have a specification for which files to include. Additionally, you can override sort and display options, and you
    # can specify how files should be grouped
    #
    [virtual share name X]

    #
    # there are four possible ways to indicate which files to include. You must use exactly 1 of them for each virtual share:
    #
    # 1. specify which metadata tags are used to divide videos up into groups:
    #
    # tags=tag1 tag2 tag3 ... tagn
    #
    # each video is searched for the specified tags. If a video does not have ANY of these tags, it is skipped. If it has ANY
    # of the tags, then the video file will be inserted into a group for each value. For example, if the tag was vActor, then
    # for each actor in a file, that file would be inserted into a group with that actor's name as the group name. As other
    # videos are found with this same actor, they will be added to the existing group. What you end up with is a main menu choice
    # for the virtual share (the text in the brackets) and when you choose it, you will see all the actors found in the metadata
    # as separate "folders". If you then navigate into those folders, you will see all the videos that each actor is in. In addition
    # to all of the normal metadata tags, including your own, you can use titleNumber which is the title number for DVD titles.
    #
    #
    # 2. specify metadata VALUES that must be matched for a video to be included:
    #
    # values = tag:val,val.../tag:val,val...
    #
    # each video is searched for the specified tag(s). If a video does not contain any of the tags, it is skipped. If it DOES
    # contain a tag, then the value for that tag MUST be one of the values listed. If it's not, then the video is skipped. If
    # multiple tags are specified, a video will match only if 1) it contains ALL of the tags, and 2) each value for EVERY tag
    # is in the specified list. Spaces are significant for the values. Do not use any unnecessary spaces in the specification.
    # As an example, values=isEpisodic:true,True,TRUE will include ALL videos for which the value for isEpisodic is true, True,
    # or TRUE. As with tags, the metadata tags can be any of the normal tags, including your own, or titleNumber which is the
    # title number for DVD videos.
    #
    #
    # 3. select videos based on a metadata tag, but group them into alphabetical folders (e.g. "A", "B", ... "9", "<Other>")
    #
    # alpha = tag
    #
    # for example, specifying alpha=Title will organize all videos into title order, but it will produce a separate "folder"
    # for each occurring letter or digit. Titles that do not have a leading letter or digit are placed into an "<Other>" folder.
    # Only letters and digits that have at least one video will be presented. The ignorearticle option affects Alpha shares
    # if the tag is either 'title' or 'episodeTitle'
    #
    #
    # 4. include ALL videos unconditionally:
    #
    # values=all
    #
    # this is useful in conjunction with the other options below. For example if you want a share that includes all videos
    # sorted by record date.
    #

    #
    # within the videos selected for a virtual share, you can add one layer of grouping. This is provided by the groupby
    # option. The tags option above already offers a layer of grouping, so this option is probably more useful for the
    # values and alpha options, but it CAN be used with tags.
    #
    # to use this option, specify a SINGLE metadata tag. For each matching video, the value for this tag is used to create/identify
    # a "folder" into which this video is placed. If the video does NOT contain the tag, then the video is placed in the root
    # "folder". As a good example, let's extend the isEpisodic example from above. If you say "values=isEpisodic:true,TRUE,True"
    # all videos will show up in a single flat "folder". They will be sorted, but it could be a large list. If I
    # add "groupby=seriesTitle", then vidmgr will create "sub-folders" for each series title thus organizing the files.
    #
    # groupby=

    #
    # you can specify a different sort order for the tags you are organizing by as opposed to the video titles themselves. The videos
    # are governed by the sortdirection and sort parameters, but the sort order of the tags is determined by the tagorder parameter, set
    # to either up (default) or down. This allows, for example, for the movies to be organized by year with the newest first, but within
    # a single year the titles would be in normal alphabetical order.
    #
    # tagorder=up

    #
    # it is possible to limit the selection of videos for a virtual share to a list of physical shares by using the
    # shares= statement. If omotted, ALL shares are considered as a source for videos
    #
    # shares=
    # for example if all of your movies are in a share titled "My Movies", then then following
    [Movies Alphabetically]
    alpha=Title
    shares=MyMovies
    #
    # will create a virtual share containing all videos from the My Movie share organized into alhpabetical folders

    # finally, it is possible to override the sort, sortdirection, display, and displaysep options for this virtual share
    # by simply specifying that option in the corresponding section. If these are missing, then the global values will be used.
    #
    # display=
    # displaysep=
    # sort=
    # sortdirection=
     
  6. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    two things stand out right away.

    First, you're not defining any pytivos. You have the [pytivos section], but your tags are named pytivoX. the X needs to be replaced with an integer, starting from 1. SInce you only have 1 pytivo running, change it to a 1 and pytivo will be found.

    Second, you have a virtual share named "virtual share name x" because you did not remove the prototype statement I delivered in this file. Just remove or comment out this line.
     
  7. johnh123

    johnh123 New Member

    429
    0
    Dec 7, 2000
    Over there
    Yes, thank you, that did the trick.
     
  8. larrs

    larrs Movie Fan-Addict

    1,011
    0
    May 2, 2005
    DFW
    I posted this in another thread yesterday, but realized this was the appropriate thread:

    I love vidmgr and thanks for developing it!

    I believe I have found an issue, or I am doing something wrong and need help rectifying it.

    When I access the vidmgr app on my Tivos (and I think the issue may be that I have 5 of them listed in my config file) and select the video to push, there are 4 of them listed in the display that pops up "push to xx Tivo"- to get to the 5th Tivo, I have to scroll down and that one displays. However, if I choose that 5th one to push the video to it actually selects the 4th Tivo rather than the 5th and says "queued to push to tivo 4" and pushes the video to the 4th rather than the 5th Tivo.

    If I then go back up and select the 4th tivo, it pushes to the 3rd, etc.

    I went into my config and reordered them so the 5th tivo is one we never push videos to but I wanted to let everyone know. Seems once you scroll past the 4th tivo, it gets off by one.

    Any input?
     
  9. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I'll look into it tonight - thanks for finding the bug.
     
  10. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Version 2.1b has been posted on git. Thanks to larrs for discovering this bug. My submenu logic was wrong when paging up and down - I was correctly adjusting the number of the first line on the screen, but I wasn't adjusting the number of the current menu choice. As a result, when select was pressed, an off-screen tivo was actually chosen.
     
  11. larrs

    larrs Movie Fan-Addict

    1,011
    0
    May 2, 2005
    DFW
    Thanks for the quick response!

    OK, I took this opportunity to go ahead and completely reload vidmgr and go from 1.0 to 2.0. However, I ran into an issue with my settings and I think I have it hosed. I am getting this when accessing on my Tivo and then it quickly exits, can I get some help, please?

    Code:
    Exception happened during processing of request from ('192.168.1.52', 39883)
    Traceback (most recent call last):
      File "C:\Python27\lib\SocketServer.py", line 582, in process_request_thread
        self.finish_request(request, client_address)
      File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "C:\pyhme\start.py", line 139, in __init__
        client_address, server)
      File "C:\Python27\lib\SocketServer.py", line 639, in __init__
        self.handle()
      File "C:\Python27\lib\BaseHTTPServer.py", line 343, in handle
        self.handle_one_request()
      File "C:\Python27\lib\BaseHTTPServer.py", line 331, in handle_one_request
        method()
      File "C:\pyhme\start.py", line 230, in do_GET
        self._page(True)
      File "C:\pyhme\start.py", line 184, in _page
        appinst.mainloop()
      File "C:\pyhme\hme.py", line 1129, in mainloop
        self.startup()
      File "C:\pyhme\vidmgr\__init__.py", line 98, in startup
        config = Config.Config()
      File "C:\pyhme\vidmgr\Config.py", line 66, in __init__
        if not self.cfg.read(fn):
      File "C:\Python27\lib\ConfigParser.py", line 297, in read
        self._read(fp, filename)
      File "C:\Python27\lib\ConfigParser.py", line 538, in _read
        raise e
    ParsingError: File contains parsing errors: C:\pyhme\vidmgr\vidmgr.ini
            [line 267]: ' values=all\n'
    ----------------------------------------
    
    Thanks in advance.
     
  12. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    That looks a lot like the issue john123 was having. Please post your config file.
     
  13. larrs

    larrs Movie Fan-Addict

    1,011
    0
    May 2, 2005
    DFW
    I would but just your comment fixed my issue. It was EXACTLY the problem john123 had... I failed to comment out the virtual share statement. Once I saw the comment on that, I tracked it down and made the change... et voila! I missed that at least 10 times yesterday.

    Thanks a lot- sometimes it is just a small push to get me pointed in the right direction. I am really not as dense as I seem at times. :)

    Thanks again!
     
  14. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    For those interested, I just did a quick check of vidmgr with the new HME for Python 0.20 and encountered no problems.
     
  15. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    Jeff,

    I have another request. Could you build a switch into the BuildCache routine (or a separate routine) that will list the videos that do not match a particular criteria?

    For example, right now the BuildCache routine reports that it is only finding Genre tags for 1561 videos, but I have quite a few more videos than that. Since every video should have at least one Genre tag, clearly there are quite a few metafiles missing those tags. Obviously, they need to be located and fixed, but that is a bit of an issue when one has roughly 2000 metafiles to scrub. It would be best if the switch specified which metatag to detail, because, for example, most of the videos (more than 1200) are missing a producer tag, and I don't want to have to deal with that list when trying to fix a few hundred files that are missing Genre tags.
     
  16. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    fgrep -L -i genre *.txt
     
  17. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    Actually,

    fgrep -L -r -i genre *.txt

    That works, of course, but only on a share-by-share basis, unless all the shares are under one directory, or at least approximately so. It would be nice if it were part of the app.
     
  18. wmcbrine

    wmcbrine Ziphead

    10,368
    22
    Aug 2, 2003
    find `grep ^path pyTivo.conf | cut -f 3 -d " "` -name \*.txt -print0 | xargs -0 fgrep -L -i genre
     
  19. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    It's funny to see this exchange, but I actually just put a new version of vidmgr up on git. I didn't change the release number since the core application didn't change - BuildCache.py now takes a -v command line parameter to indicate "verbose".

    Although I instrumented all of the virtual share types, I actually only added output from virtual shares specified by "tags=" and only in the requested case.
     
  20. lrhorer

    lrhorer Active Member

    6,924
    0
    Aug 31, 2003
    San...
    Aw, shucks. Here William and I were just warming up to a "who can create the longest bash command" competition.
     

Share This Page