# PyTivo Video Manager HME App for pyhme



## jbernardis

This app has been discussed in another thread in this forum, but it was suggested that I start my own thread, and so I am.

There is no new version of the code, but I am reposting the link here.

In recent discussion, I learned that the HME does indeed support an HD interface. based on suggestions from wmcbrine, I have figured out how to do this and decided that it is not all that difficult to have a dual-personality app that will work in either SD or HD mode. I am currently working on it - give me a couple of weeks or so.

Obviously there are differences in screen geometry between HD and SD, and there is also additional screen real estate. I could simply increase the size of lists, etc - and that is indeed how I am starting. But in the HD version, I am trying to figure out if I can add additional information as well - such as the recently requested thumbnails.

I have to admit that when I answered the posts earlier this afternoon, I was not into it at all. But since getting home, firing up eclipse, and starting to work on the code, I got right back into the mood.

One question I have for now - does the HME simulator support HD? I can't find out how. I don't have an HD tivo near the computer. Every time I make a change, I have to walk across the house to try it out. It gets tiresome. If the sim supported HD, I could do a lot of debugging there. Also, the sim lets me see the safe areas of the screen (as pointed out by wmcbrine)

Thanks


----------



## wmcbrine

The standard simulator doesn't do HD. There have been at least a couple of modified versions that do... but as I look at it, of the two I have here, one doesn't run, and the other is half-assed.

For my apps, I mostly just scaled everything up 50% (since 720/480 = 1.5), and then adjusted for the extra horizontal space.


----------



## lew

I understand this is the developers thread but there doesn't seem to be a support thread. I'm not sure if there is an issue with the way I'm configured or if I'm doing something wrong.

I'm running pyTivo with the start on console batch file.

The error message on the pyTivo console says:

Cannont find accountId for TSN 652-0001-8037-XXXX The TSN is correct

Do I need to list the TSN in the configuration file for pyTivo? Doesn't seem to be an option to do so.


----------



## orangeboy

FWIW, I use my TiVo names in place of the TSN.

config.ini:


Code:


[hmeserver]
apps=vidmgr

[tivos]
tivo1.name=TivoS4
tivo1.tsn=TivoS4

[pytivos]
pytivo1.config=\\dl380-server\pyTivo Production\pyTivo.conf
pytivo1.ip=DL380-Server
pytivo1.port=9033
pytivo1.sep=\


----------



## lew

Thanks. Solved the problem.


----------



## jcthorne

Just for the record in case anyone else has the problem, The TSN needs to be listed without the dashes in the config file. I had the same errors before trying that.


----------



## jbernardis

I never even considered that dashes might be in the TSN.

I can easily parse them out when I read in the config.

BTW - The coding is essentially done on the HD version of the program. No real changes to the SD version except to try a bit more to stay in the TV safe zones. But the HD version will display thumbnails if you have them.

Just a bit more testing before I release it. Also, I need to make sure that I haven't broken the SD version.


----------



## jcthorne

Great news! Looking forward to giving it a try.


----------



## arrarrgee

could you tell me where to get the pytivo from? I mean i have been running stream baby and HME/VLC...and tried using the HME/VLC folder to copy vidmgr folder...but the following section turned out to be a bummer..help pls

[pytivos]
pytivo1.config=\\dl380-server\pyTivo Production\pyTivo.conf
pytivo1.ip=DL380-Server
pytivo1.port=9033
pytivo1.sep=\

[/CODE][/QUOTE]


----------



## lew

I'm not enough of a tivo "geek" to have memorized my TSNs .

I logged on to my account at tivo.com and used copy and paste to put the numbers in the configuration file. Tivo listed the number with dashes so I assumed that's the way tivo wanted the numbers.

I suggest you either parse out the - or update the readme file. Whatever is easier for you.

Looks like using our tivo name as our TSN works. Is there any reason why you don't just automatically do that and not even ask for our TSN?


----------



## jbernardis

Tivo name works only by virtue of the fact that tivo mind obviously accepts it. I did not know that and do not process the tivo name in any way.

I have made the change to the code to parse out the - from the entered value. I'm sure there will be somebody who has a dash in the middle of their tivo name and won't like the fact that I do that. I am actually indifferent to it, and will remove this logic if that is what the concensus is here.


----------



## jbernardis

A new version of the app is available at the same github location.

This version - 0.2 - supports HD. It still works on an SD tivo as well, but SD does not give you much in the way of new functionality.

New for HD is artwork - you can have a jpg for each file, or a single jpg for the folder/directory. Processing these images slows thing down a bit, but not unacceptably so. The jpg can be up to 320x444. This is a good aspect ratio for DVD case artwork which is why I chose it.

There are a couple of other new features too - see the README file.


----------



## jbernardis

arrarrgee said:


> could you tell me where to get the pytivo from?


Look for a link in wmcbrine's signature up there in post number 2. He is the keeper of pytivo (at least one of the forks)


----------



## orangeboy

jbernardis said:


> A new version of the app is available at the same github location.
> 
> This version - 0.2 - supports HD. It still works on an SD tivo as well, but SD does not give you much in the way of new functionality.
> 
> New for HD is artwork - you can have a jpg for each file, or a single jpg for the folder/directory. Processing these images slows thing down a bit, but not unacceptably so. The jpg can be up to 320x444. This is a good aspect ratio for DVD case artwork which is why I chose it.
> 
> There are a couple of other new features too - see the README file.


Thank you! :up:

Edit: I like the exts= option. I'm converting my videos to mp4, so this will be a nice filter for natively accepted videos that don't need transcoding. Nice.


----------



## orangeboy

Yessir, I like the artwork feature.
I renamed the existing jpg file from filename.jpg to filename.extension.jpg, but that's no problem.

Nice work jbernardis!


----------



## jcthorne

Look forward to having some time this weekend to install this new version!


----------



## jbernardis

Thank you everybody. Please let me know if you discover any issues. I tested it quite a bit, but it's impossible to catch everything.

Orangeboy:

What do you mean - did you change the code, or did you have to rename your files. I can add logic to also check for <filename>.jpg if <filename>.<extension>.jpg doesn't exist, but of course each file name check adds a bit to the processing time. wmcbrine also suggested I use the image attribute in the meta file, but I am presently not doing this.


----------



## orangeboy

I just renamed the files. As far as adding logic, I don't think it's necessary. The current implementation follows meta data file naming conventions. Speaking of meta data, I did change some code though to increase the font size relating to meta data description. I bumped up from 16 (or was it 20?) to 24. It made it a little easier to read in HD mode.

Edit: What's an image attribute in the meta file? I usually go by this wiki: http://pytivo.sourceforge.net/wiki/index.php/Metadata, but didn't see "image" included.


----------



## jbernardis

Yeah - I'm not too happy with the fonts as they currently exist. I wish there was a way to enumerate the fonts so that I could choose something better - who knows, maybe there is. I have some videos that have long descriptions that fill up the view with the small font I have in place now, but it's not so much the size that bothers me - I can see staircasing and other artifacts in there. It doesn't look like a nicely scalable font, and at the size I have chosen, the quality is not great.


----------



## jcthorne

Just installed, updated a directory of covers to the file name and size requirements and viola!

WOW.

SUPER!

Very nice work indeed. I plan to do a bit of customizing of the design elements to fit our decor and theater theme. I already got thumbgen configured to generate the requred thumnail cover images, going to work on getting it to generate .txt files with meta data.

This is great. THANKS!


----------



## tomm1079

What exactly is this program? I am trying to figure it out by reading this thread but it doesnt tell alot.


----------



## jbernardis

tomm1079 said:


> What exactly is this program? I am trying to figure it out by reading this thread but it doesnt tell alot.


pytivo provides the ability to "push" videos to your tivo through its web interface rather than going to your tivo and "pulling" them. The advantage to pushing is that if the file is in a compatible format (basically mp4 with H.264 video encoding and either AC3 or AAC audio encoding) the file is transfered as is without transcoding. This saves considerable time and space. The problem is that pushing can only be done from your PC.

With this app, you can request pushes from the tivo interface (hence from the TV with your peanut remote control). You are presented with the same directory structure that pytivo knows about. You select which videos you want, and then request that that video be pushed to your tivo. While I was at it, I also added the ability to delete videos since pytivo doesn't have that capability natively.


----------



## innocentfreak

Hmm sounds interesting. I have never set up HME though so I guess I should play with that first.


----------



## lew

I'm using MetaGenerator V2. It displays a copy of the DVD cover and a picture for most TV series. Does anyone know if there is a way to save the image so it can be used with PyTivo Video Manager?

I'm not sure if MetaGenerator is open source. Doesn't look like it's been updated recently.


----------



## jbernardis

lew said:


> I'm using MetaGenerator V2. It displays a copy of the DVD cover and a picture for most TV series. Does anyone know if there is a way to save the image so it can be used with PyTivo Video Manager?
> 
> I'm not sure if MetaGenerator is open source. Doesn't look like it's been updated recently.


Metagenerator did not do it for me - the images seemed too small.

I was able to get most of my images from amazon.com. Where they didn't adhere to the 320x444 size, I used irfanview to resize them while maintaining aspect ratio - simple.


----------



## jcthorne

Try a utility called thumbgen. It will web scrape images from many sources including amazon, netflix, imdb and tvdb. It will also automaticly resize the image to your specs. It does alot more but I have not figured out how to format its metadata into pytivo compatible format yet.


----------



## innocentfreak

Hmm I must have set something up wrong. It shows up on my TiVo but I am getting an error in the window.

----------------------------------------
Exception happened during processing of request from ('192.168.1.2', 54672)
Traceback (most recent call last):
File "C:\Python26\lib\SocketServer.py", line 560, in process_request_thread
self.finish_request(request, client_address)
File "C:\Python26\lib\SocketServer.py", line 322, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\PyHME\start.py", line 141, in __init__
client_address, server)
File "C:\Python26\lib\SocketServer.py", line 617, in __init__
self.handle()
File "C:\Python26\lib\BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "C:\Python26\lib\BaseHTTPServer.py", line 323, in handle_one_request
method()
File "C:\PyHME\start.py", line 232, in do_GET
self._page(True)
File "C:\PyHME\start.py", line 186, in _page
appinst.mainloop()
File "C:\PyHME\hme.py", line 1139, in mainloop
while self.active and self.get_event():
File "C:\PyHME\hme.py", line 1280, in get_event
self.set_resolution(handle())
File "C:\PyHME\vidmgr\__init__.py", line 95, in handle_resolution
self.snd('bonk')
AttributeError: Vidmgr instance has no attribute 'snd'
----------------------------------------


----------



## jbernardis

innocentfreak said:


> Hmm I must have set something up wrong. It shows up on my TiVo but I am getting an error in the window.


First of all - this is a typo. 'snd' should be 'sound' I will post that fix shortly, but you can change the line if you want to move on.

The interesting thing, though, is that you should not even be executing this line. This only executes if your optimal resolution (i.e the contents of self.resolutions[0]) does not have a horizontal resolution of 640 (SD) or 1280 (HD).

I wrote my code by reverse engineering my series 3 Tivos. I don't know what other resolutions are out there. If there is some way that you could give me the contents of this array, it would help me greatly. You could put the following print statement at the beginning of the handle_resolution routine:

print self.resolutions

you will also need some way to capture the output. If you run interactively from a command window, the output will appear in that window and you can cut and paste it here. Then maybe I could be a bit more defensive in my code - perhaps choose an alternate resolution from the array.


----------



## innocentfreak

Like I said, my config maybe off so it might just be due to a bad config. I have never tried to use PyHME prior to this.

My knowledge is very limited so I will try to help as much as I can.

I am assuming you are talking about below in _init_.py in the vidmgr folder?

class Vidmgr(Application):
def handle_resolution(self):
""" Choose the 'optimal' resolution. """
if (self.resolutions[0][0] == 640):
self.res = RES_SD
elif (self.resolutions[0][0] == 1280):
self.res = RES_HD
else:
self.active = False
self.snd('bonk')

return self.resolutions[0]

Where would I insert the print line, assuming I am in the correct section?

EDIT:Got this, not sure if this is what you are looking for
[(720, 480, 10, 11), (1280, 720, 3, 4), (704, 480, 10, 11), (640, 480, 1, 1)]


----------



## jbernardis

OK - there is a new version in the repository.

I made the simple snd -> sound change identified by innocentfreak, but I also changed the handle_resolutions routine to scan through the self.resolutons array for the first resolutions that has a horizontal resolution of 640 or 1280. Prior to this, it was blindly taking the first entry in the array.

I don't know what resolutions were in the array in innocentfreak's case, but at a minimum, this new logic will AT LEAST find the SD resolution and operate in that mode.

The only file that changed from the prior version was vidmgr/__init__.py.

Jeff


----------



## jbernardis

innocentfreak said:


> Like I said, my config maybe off so it might just be due to a bad config. I have never tried to use PyHME prior to this.
> 
> My knowledge is very limited so I will try to help as much as I can.
> 
> I am assuming you are talking about below in _init_.py in the vidmgr folder?
> 
> class Vidmgr(Application):
> def handle_resolution(self):
> """ Choose the 'optimal' resolution. """
> if (self.resolutions[0][0] == 640):
> self.res = RES_SD
> elif (self.resolutions[0][0] == 1280):
> self.res = RES_HD
> else:
> self.active = False
> self.snd('bonk')
> 
> return self.resolutions[0]
> 
> Where would I insert the print line, assuming I am in the correct section?


You would need to add the print statement immediately before if(self.resolutions[0][0] == 640):
It would also need to be indented using tabs to the same depth as the *if* statement (this is my ONLY complaint with python - indentation defines program structure)


----------



## jbernardis

innocentfreak said:


> EDIT:Got this, not sure if this is what you are looking for
> [(720, 480, 10, 11), (1280, 720, 3, 4), (704, 480, 10, 11), (640, 480, 1, 1)]


This line is what I'm looking for. So your optimal resolution is 720x480.

With my new logic, it will choose the second entry and operate in 1280x720 resolution.

I'm not sure what the 3 and 4 are - I think they define the pixel aspect ratio, and I'm also thinking that since it is not 1:1 (like it is in my case) that things might be slightly distorted???? If so, it probably wouldn't effect the text too much - the only thing that might be obvious would be the artwork.


----------



## innocentfreak

Cool that seems to have fixed it so that I can access the shares. Most of my image files come from theTVDB.com along with the metadata.

I was scrolling through a show testing it and got this error.

Exception happened during processing of request from ('192.168.1.2', 42946)
Traceback (most recent call last):
File "C:\Python26\lib\SocketServer.py", line 560, in process_request_thread
self.finish_request(request, client_address)
File "C:\Python26\lib\SocketServer.py", line 322, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\PyHME\start.py", line 141, in __init__
client_address, server)
File "C:\Python26\lib\SocketServer.py", line 617, in __init__
self.handle()
File "C:\Python26\lib\BaseHTTPServer.py", line 329, in handle
self.handle_one_request()
File "C:\Python26\lib\BaseHTTPServer.py", line 323, in handle_one_request
method()
File "C:\PyHME\start.py", line 232, in do_GET
self._page(True)
File "C:\PyHME\start.py", line 186, in _page
appinst.mainloop()
File "C:\PyHME\hme.py", line 1139, in mainloop
while self.active and self.get_event():
File "C:\PyHME\hme.py", line 1192, in get_event
handle(keynum, rawcode)
File "C:\PyHME\vidmgr\__init__.py", line 182, in handle_key_press
self.handle_key_pressList(keynum, rawcode)
File "C:\PyHME\vidmgr\__init__.py", line 286, in handle_key_pressList
self.drawScreen()
File "C:\PyHME\vidmgr\__init__.py", line 519, in drawScreen
self.drawScreenDetail()
File "C:\PyHME\vidmgr\__init__.py", line 661, in drawScreenDetail
flags=RSRC_TEXT_WRAP + RSRC_HALIGN_LEFT + RSRC_VALIGN_TOP)
File "C:\PyHME\hme.py", line 1033, in set_text
self.set_resource(Text(self.app, message, font, color, colornum), flags)
File "C:\PyHME\hme.py", line 713, in __init__
self.put(_CMD_RSRC_ADD_TEXT, 'iis', font.id, color.id, text)
File "C:\PyHME\hme.py", line 553, in put
_pack('ii' + format, cmd, self.id, *params))
File "C:\PyHME\hme.py", line 506, in _pack
return ''.join([func_(value) for i, value in zip(format, values)])
File "C:\PyHME\hme.py", line 466, in _pack_string
return _pack_vdata(value.encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 196: ordina
l not in range(128)_


----------



## jbernardis

The issue is that you have a non-ascii character in your description - not sure which file it is, but one of the meta files has a non-ascii character in the description field.

You can explore that angle of it while I see if there is some way I can be more defensive in my code.


----------



## innocentfreak

This appears to be the file.

seriesTitle : 30 Rock
title : Dealbreakers Talk Show #0001
episodeTitle : Dealbreakers Talk Show #0001
originalAirDate : 2009-12-03T20:30:00Z
time : OAD
description : The tables are turned when production begins on Liz's new talk show, "Dealbreakers," and she experiences what its like to walk a mile in Jenna's shoes. Jack, dealing with pressure from Devin, calculates to make "Dealbreakers" a success. Meanwhile, Tracy takes on the ultimate Hollywood challenge in order to prove his commitment to his wife. Everyone pitches in to help Tracy reach his goal including Kenneth, Dotcom and Grizz.
isEpisode : true
seriesId : SH79488
episodeNumber : 407
vProgramGenre : Comedy
vSeriesGenre : Comedy
vDirector : Don Scardino
vWriter : Kay Cannon
vActor : Alec Baldwin
vActor : Tina Fey
vActor : Tracy Morgan
vActor : Scott Adsit
vActor : Jack McBrayer
vActor : Jane Krakowski
vActor : Keith Powell
vActor : Katrina Bowden
vActor : Judah Friedlander
vActor : Kevin Brown
vActor : Maulik Pancholy
vActor : Lonny Ross
vActor : Grizz Chapman


----------



## jbernardis

innocentfreak,

I'm attaching a new version of metadata.py (you will need to rename the file from metadata.txt to metadata.py). Replace the same named file in the pyhme directory (one dir above vidmgr) and see if it solves your problem. If so, I will commit the change and update the repository.

Jeff


----------



## innocentfreak

Yeah that worked. Thanks, sorry I tend to break things in testing and find the odd results, ask Orangebuy


----------



## jbernardis

No problem - I asked that people test it - I'd rather have working software associated with my name.

The repository will be updated in the next 10 minutes.


----------



## innocentfreak

Quick question is there any way to customize the font size? I find on my plasma the show descriptions are pretty tiny and wouldn't mind being able to make the show names larger also. Of course this may interfere with the images though. 

Also my format is laid out tvshows/series name/season#/episodes
Is there a way to display show art when I am at the series name folder? I can't think of a way but thought I would throw it out there in case.


----------



## wmcbrine

jbernardis said:


> I'm not sure what the 3 and 4 are - I think they define the pixel aspect ratio


Yes. See here about resolutions:

http://www.tivocommunity.com/tivo-vb/showthread.php?t=385669

I hadn't seen 720x480 come up before, but I haven't looked at these in a while.


----------



## lew

jcthorne said:


> Try a utility called thumbgen. It will web scrape images from many sources including amazon, netflix, imdb and tvdb. It will also automaticly resize the image to your specs. It does alot more but I have not figured out how to format its metadata into pytivo compatible format yet.


Thanks for the suggestion.

jbernardis--Thanks for sharing your work. Great tool. I may go back to the SD version. The font size is too small for me to read on a 42" LCD. I suspect you have better eyesight then some of us.


----------



## innocentfreak

Ok glad it wasn't just me with the font size.


----------



## jcthorne

If you go into the .py file, the font sizes and colors are easily adjusted. Jbernardis did a great job of documenting the code throughout.

Any one here want to tackle a project converting meta data in an xml or ifo file to a pytivo compatible .txt file? I'd like to get the data from thumbgen to the tivo but not sure where to start with this.


----------



## wmcbrine

Well, "xml" isn't a format -- you'll have to be more specific. jbernardis' metadata.py is borrowed from pyTivo, although he's trimmed it down. My version already supported importing data from TiVo-style XML (two different kinds just for that), as well as EyeTV (which uses plists, which use XML). But I assume none of those are what you want.

"ifo", I'm not even sure what you mean. There are .IFO files that come as part of a DVD structure, but they don't contain (this kind of) metadata. And then I see ".nfo" files, but those seem to be plain text in no fixed format.


----------



## jbernardis

Version 0.2c is now in the repository. A new option has been added to the config.ini file.

descsize=<size of the font for descriptive text>

For example

descsize=20

If omitted, it will default to its present value of 16.

BTW - I don't think my 54 year old eyes are any better than anyone elses  - I chose the 16 point font because I needed it to fit the larger descriptions on screen.

Also note - if you choose a large font, the image will not be overwritten. The description view does NOT overlap the view for the image. What this means is that is the descriptive font is too large for the text, the text will simply be truncated.


----------



## innocentfreak

I am guessing this will only change the episode summary and not the size of the episode name or series name?


----------



## jbernardis

innocentfreak said:


> I am guessing this will only change the episode summary and not the size of the episode name or series name?


Correct - only the description field.


----------



## jcthorne

wmcbrine said:


> Well, "xml" isn't a format -- you'll have to be more specific. jbernardis' metadata.py is borrowed from pyTivo, although he's trimmed it down. My version already supported importing data from TiVo-style XML (two different kinds just for that), as well as EyeTV (which uses plists, which use XML). But I assume none of those are what you want.
> 
> "ifo", I'm not even sure what you mean. There are .IFO files that come as part of a DVD structure, but they don't contain (this kind of) metadata. And then I see ".nfo" files, but those seem to be plain text in no fixed format.


I should have been more specific. I will try and attach an .nfo file generated by thumbgen here for example. Since thumbgen webscrapes the data and images for both movies and tv shows and is actively being developed, being able to use this data for tivo would prove useful.



Code:


 <?xml version="1.0" encoding="utf-8"?>
<movie xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ThumbGen="1">
  <hasrighttoleftdirection>false</hasrighttoleftdirection>
  <title>Avatar</title>
  <originaltitle>Avatar</originaltitle>
  <year>2009</year>
  <plot>Disabled Marine Jake Sully travels to planet Pandora to become an avatar, ingratiate himself with the natives and help Americans mine lucrative unobtainium. But he finds himself in an interstellar conflict after falling for Na'vi warrior Neytiri.</plot>
  <filename>Avatar.1080p.2009.mp4</filename>
  <tagline>Enter the World of Pandora</tagline>
  <metascore>84</metascore>
  <rating>8.2</rating>
  <homepage>http://www.avatarmovie.com/</homepage>
  <episodes />
  <episodesnames />
  <writers />
  <gueststars />
  <id>tt0499549</id>
  <releasedate>18.12.2009</releasedate>
  <mpaa>Rated PG-13 for intense epic battle sequences and warfare, sensuality, language and some smoking. (also special edition)</mpaa>
  <actor>
    <name>Sam Worthington</name>
    <name>Zoe Saldana</name>
    <name>Sigourney Weaver</name>
    <name>Stephen Lang</name>
    <name>Michelle Rodriguez</name>
    <name>Joel Moore</name>
    <name>Giovanni Ribisi</name>
    <name>CCH Pounder</name>
    <name>Laz Alonso</name>
    <name>Wes Studi</name>
    <name>Dileep Rao</name>
    <name>Matt Gerald</name>
    <name>Dean Knowsley</name>
  </actor>
  <genre>
    <name>Action</name>
    <name>Adventure</name>
    <name>Science Fiction</name>
    <name>Romance</name>
  </genre>
  <director>
    <name>James Cameron</name>
  </director>
  <runtime>162</runtime>
  <certification>PG-13</certification>
  <studio>
    <name>20th Century Fox</name>
  </studio>
  <country>
    <name>United Kingdom</name>
    <name>United States of America</name>
  </country>
  <cover>
    <name>http://cf1.imgobject.com/posters/88c/4cc481d15e73d6778400188c/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/374/4bd29ddd017a3c63e8000374/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/351/4bed3468017a3c37ac000351/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a32/4bc95853017a3c57fe027a32/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/284/4c60d0215e73d63460000284/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a5a/4bc95859017a3c57fe027a5a/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/730/4d4075c67b9aa15bab002730/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/8f4/4d376aac5e73d6334f00d8f4/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/1a5/4c6b23605e73d65f7e0001a5/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/277/4bd29e03017a3c63eb000277/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/3d2/4bd2b01b017a3c63f50003d2/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/255/4bdda594017a3c20c3000255/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/32f/4cb1bc627b9aa1263f00032f/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a3c/4bc95853017a3c57fe027a3c/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/673/4d78c5ef7b9aa157b4000673/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/0cf/4bedd282017a3c45930000cf/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a64/4bc9585d017a3c57fe027a64/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/04b/4bedd253017a3c458900004b/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/527/4ce2dd595e73d60f71000527/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a50/4bc95858017a3c57fe027a50/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a5f/4bc9585a017a3c57fe027a5f/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/5d8/4ce453967b9aa168b00005d8/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a55/4bc95859017a3c57fe027a55/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a4b/4bc95858017a3c57fe027a4b/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/a46/4bc95857017a3c57fe027a46/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/097/4c41ccc25e73d60f3b000097/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/posters/2e2/4d7cf7365e73d651740022e2/avatar-original.jpg</name>
  </cover>
  <backdrop>
    <name>http://cf1.imgobject.com/backdrops/a2e/4bc95852017a3c57fe027a2e/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a0e/4bc95848017a3c57fe027a0e/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/20e/4bd1e35c017a3c63ea00020e/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/2e7/4bd9de08017a3c1c090002e7/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/9ee/4bc95842017a3c57fe0279ee/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a16/4bc9584c017a3c57fe027a16/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a26/4bc9584e017a3c57fe027a26/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a2a/4bc9584f017a3c57fe027a2a/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/0e1/4bdd0e91017a3c20c30000e1/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a1a/4bc9584d017a3c57fe027a1a/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/9ea/4bc9583e017a3c57fe0279ea/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/042/4bd5c1c4017a3c658a000042/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/9f2/4bc95842017a3c57fe0279f2/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a02/4bc95846017a3c57fe027a02/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/9f6/4bc95844017a3c57fe0279f6/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/348/4bd9dcff017a3c1bfb000348/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/ff8/4d29a7e25e73d626b0002ff8/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a1e/4bc9584d017a3c57fe027a1e/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a22/4bc9584e017a3c57fe027a22/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/a12/4bc9584c017a3c57fe027a12/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/9fa/4bc95845017a3c57fe0279fa/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/800/4cf54d7b5e73d6299e000800/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/74d/4cf54e065e73d6299900074d/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/9fe/4bc95846017a3c57fe0279fe/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/833/4cf54e325e73d6299a000833/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/84f/4cf54e425e73d6299b00084f/avatar-original.jpg</name>
    <name>http://cf1.imgobject.com/backdrops/754/4cf54e555e73d62999000754/avatar-original.jpg</name>
  </backdrop>
  <mediainfo>
    <Resolution>
      <Flag>Resolution_1080p</Flag>
    </Resolution>
    <resolution>1080P</resolution>
    <Format>
      <Flag>Format_Mpeg</Flag>
    </Format>
    <format>mpeg4</format>
    <Video>
      <Flag>Video_H264</Flag>
    </Video>
    <video>avc</video>
    <Audio>
      <Flag>Audio_DolbyDigital</Flag>
    </Audio>
    <audio>DD51</audio>
    <Subtitles>
      <Flag>Unknown</Flag>
    </Subtitles>
    <SubtitlesText>Unknown</SubtitlesText>
    <framerate>23.976</framerate>
    <aspectratio>16:9</aspectratio>
    <videoresolution>1920x1080</videoresolution>
    <videocodec>AVC</videocodec>
    <videobitrate>8 Mbps</videobitrate>
    <audiocodec>AC-3</audiocodec>
    <audiochannels>6</audiochannels>
    <audiobitrate>448 Kbps</audiobitrate>
    <durationseconds>9701</durationseconds>
    <durationminutes>161</durationminutes>
    <duration>2h 41m</duration>
    <filesizebytes>10444713701</filesizebytes>
    <filesize>9.73 GB</filesize>
    <container>MPEG-4</container>
    <language>English</language>
    <languagecode>en</languagecode>
    <languages>English</languages>
    <languagecodes>en</languagecodes>
    <externalsubtitles />
  </mediainfo>
</movie>

Just FYI, the author of Thumbgen just messaged me and has agreed to look at adding direct support of pyTivo metadata .txt files to the program. I sent him a link to the wiki site http://pytivo.sourceforge.net/wiki/index.php/Metadata 
and an example of one of my files.


----------



## windracer

Is there an option in config.ini to hide directories? For pyTivo, I use the .meta subfolder to keep all the metadata files. pyTiVo hides this folder but vidmgr does not.


----------



## jbernardis

windracer said:


> Is there an option in config.ini to hide directories? For pyTivo, I use the .meta subfolder to keep all the metadata files. pyTiVo hides this folder but vidmgr does not.


This capability doesn't exist now, but theres no reason I couldn't implement it. Let me think about how it should be designed.

One question - should I ignore all directories below the meta directory? I knew this isn't the way meta directories are used, but it's a possibility my logic needs to consider. Initially my thought is to eliminate any directory that has a node named meta somewhere in the path name beneath the rout.


----------



## windracer

jbernardis said:


> Initially my thought is to eliminate any directory that has a node named meta somewhere in the path name beneath the root.


Or just hide any subdirectory that starts with a period?


----------



## wmcbrine

Yes, a leading period is the Unix convention for hidden files and directories, which is why pyTivo uses it. It pays no special attention to "meta". You probably want the same behavior as pyTivo, since this is a front-end for it.



Code:


if f.startswith('.'):
    continue


----------



## jbernardis

Ok - version 0.2d is now available at github. The only change is to ignore directories that start with a period ala the unix convention.


----------



## windracer

Great, thanks!


----------



## rrr22777

Does this do HD Photos? I am keeping Tivo Desktop running in a VM just for the HD photos.


----------



## jcthorne

vidmgr does not but pytivo does.


----------



## wmcbrine

rrr22777 said:


> Does this do HD Photos? I am keeping Tivo Desktop running in a VM just for the HD photos.


What you can do is to rip the HD Photos app out of TiVo Desktop -- it's in Java, and will run on Linux, Mac, etc. -- and use pyTivo as the backend for it, instead of TD. See here.

Alternatively, if all you want is a slide show, you can use the "Pictures" sample app from the HME for Python package.


----------



## windracer

jcthorne said:


> I already got thumbgen configured to generate the requred thumnail cover images, going to work on getting it to generate .txt files with meta data.


I've been digging around trying to find this on the pyTivo and streambaby wikis, but how do you add the cover art to the metadata files? What's the syntax/format?


----------



## jbernardis

windracer said:


> I've been digging around trying to find this on the pyTivo and streambaby wikis, but how do you add the cover art to the metadata files? What's the syntax/format?


I don't know about pytivo and/or streambaby, but I don't use the metadata file to find the thumbnail. I simply look for a file name following a specific rule.


----------



## windracer

Doh, right there in your readme.  I'll check it out, thanks!


----------



## windracer

Ok, I got thumbnail images working ... as long as the files are in the same directory as the videos. Any chance on allowing them in the .meta directory with the metadata files? I tried moving them in there but then they don't show up.


----------



## jbernardis

windracer said:


> Ok, I got thumbnail images working ... as long as the files are in the same directory as the videos. Any chance on allowing them in the .meta directory with the metadata files? I tried moving them in there but then they don't show up.


Shouldn't be too difficult. If I get a chance, I'll look at it when I get home tonight. Two or three days at the most


----------



## jbernardis

Version 0.2e is now available at github - see my signature for a link.

This version supports artwork in the .meta subdirectory. Search order for thumbnail art:
1) <fn>.jpg
2) .meta/<fn>.jpg
3) folder.jpg
4) .meta/folder.jpg

I didn't really put this through the paces - it was a very easy change. Please let me know if I screwed something up.


----------



## windracer

Hmmm ... not working for me. They show up in the normal folder, but not when in the .meta folder. Any type of debugging or logging I can enable?


----------



## jbernardis

Let me try a few things tonight - like I said I didn't put it through the paces so maybe I overlooked something.

Sorry about that


----------



## jbernardis

OK - it was a stupid mistake. Version 0.2f properly implements the artwork feature. This time I actually did some testing.


----------



## windracer

Yup, that did it. Thanks!! :up:


----------



## jbernardis

I had to deliver another fix. I closed up two holes - both having to do with video deletion. 1) if the meta file was in the .meta directory it was not being deleted, and 2) the artwork file, regardless of what directory it was in, was not being deleted.

These have been fixed. Follow the link in my signature to get the update.


----------



## windracer

I gave ThumbGen a try and managed to get it to automatically download the thumbnails for my movies and drop them, correctly named, in each .meta folder of my video library. I had to do some minor cleanup where it picked the foreign language image (for whatever reason) other than that it worked pretty well. 

Pretty neat. :up:


----------



## windracer

Two quick things:

- in the README.TXT, there's a typo:



> The view into which this graphic is placed is 320 pixels wide by 44 pixels high. If your graphic exceeds those dimensions it will be cropped.


I think that should be 444, not 44?

- any reason why vidmgr is hiding .TiVo files? I added it to my exts= line in config.ini but they don't show up. They do appear in pyTivo.


----------



## jbernardis

windracer said:


> Two quick things:
> 
> - in the README.TXT, there's a typo:
> 
> I think that should be 444, not 44?
> 
> - any reason why vidmgr is hiding .TiVo files? I added it to my exts= line in config.ini but they don't show up. They do appear in pyTivo.


You are correct. I will fix the readme. Sorry if this caused an issue for you.

I updated git, but did not change the version number.


----------



## jbernardis

Didn't see your second question - no reason to hide the .tivo files. I just don't have any in my collection so I never included them. They should show up if you include them in the exts line. This is the line that does this check:

if os.path.splitext(name)[1].lower() in goodexts:

so in other words, the file extension is forced to lower case and compared with what you have in your exts. Do you have mixed case in your config file? Try it with all lower case and see if that works. I can also just force both of them to lower.

This is one of those things that is difficult between Windows (which is not case sensitive for file names) and linux (which is). No matter which way I choose, somebody isn't happy.

Let me know if that was your issue.


----------



## windracer

Yep, that was it. I'm on Linux so I put .TiVo in my config.file. Changed that to just .tivo and they show up now. Thanks!


----------



## jcthorne

windracer said:


> I gave ThumbGen a try and managed to get it to automatically download the thumbnails for my movies and drop them, correctly named, in each .meta folder of my video library. I had to do some minor cleanup where it picked the foreign language image (for whatever reason) other than that it worked pretty well.
> 
> Pretty neat. :up:


Could you take a look at the .nfo and .tgmd files it generates and see if it might be possible to parse out the pytivo metadata .txt file from the info they contain?


----------



## windracer

I turned off all the metadata stuff and was using it just for thumbnails. The moviescreens it could generate were pretty neat, though. To bad we can't use those with vidmgr!

If I get a chance, I'll see if I can check those files ...


----------



## reneg

Loaded this app up yesterday, and it's pretty nice. Thanks for making it available.

I ran into a problem with directory/share traversal. I have lots of pyTivo shares defined (>30) and when I navigate to shares on the second and subsequent pages for directories/shares, and then enter a directory (share), the files within that share are wrong, they typical display files from shares that would be on the first page. It's like the offsets are off.

Just curious how others deal with displaying TV series. I prefer chronological sort of <series>.sXXeYY, so alpha sorting on title doesn't work for me.


----------



## innocentfreak

reneg said:


> Loaded this app up yesterday, and it's pretty nice. Thanks for making it available.
> 
> I ran into a problem with directory/share traversal. I have lots of pyTivo shares defined (>30) and when I navigate to shares on the second and subsequent pages for directories/shares, and then enter a directory (share), the files within that share are wrong, they typical display files from shares that would be on the first page. It's like the offsets are off.
> 
> Just curious how others deal with displaying TV series. I prefer chronological sort of <series>.sXXeYY, so alpha sorting on title doesn't work for me.


My TV series are in a folder labeled TV Shows. Then seperate folders per series. Then in each series folder I have a folder for every season. This is just how the program I use organizes my content though.

As a result all of my listings are just alphabetical. The episodes seem to be in order by episode number though.


----------



## jbernardis

I do something similar to innocentfreak. I have a single share and under that I have folders for TV, Movies, Podcasts, Sports, and Home Movies. And then under these, I organize. For example, under Movies, I have 8 or 9 genre, and under TV, I have a folder for each show title (and under that I have a folder for each season). I have the episode number - and sometimes the season number - as the first part of the file name and as the first part of the title in the metafile. That way they sort into episode order in pytivo and windows, as well as on my PS3. I find this organization works well for me.

Reneg - could you explain a little better about the issue you are seeing where it is displaying the wrong thing? I wouldn't be surprised if there was a bug or two lurking in there somewhere, but I need to know the exact curcumstances under which it occurs if I'm going to fix it.

It almost sounds, from your explanation, that you have shares within shares.


----------



## reneg

jbernardis said:


> I do something similar to innocentfreak. I have a single share and under that I have folders for TV, Movies, Podcasts, Sports, and Home Movies. And then under these, I organize. For example, under Movies, I have 8 or 9 genre, and under TV, I have a folder for each show title (and under that I have a folder for each season). I have the episode number - and sometimes the season number - as the first part of the file name and as the first part of the title in the metafile. That way they sort into episode order in pytivo and windows, as well as on my PS3. I find this organization works well for me.
> 
> Reneg - could you explain a little better about the issue you are seeing where it is displaying the wrong thing? I wouldn't be surprised if there was a bug or two lurking in there somewhere, but I need to know the exact curcumstances under which it occurs if I'm going to fix it.
> 
> It almost sounds, from your explanation, that you have shares within shares.


My directory structure is flat. I have one share per TV series, and under each share is all the episodes of that series. I have enough shares that I have to scroll down to see them all. I think to recreate, it was as simple as scrolling down twice and selecting a directory. For example, scrolling down to the Modern Family share, I would get episodes to Big Bang Theory displayed. I'll verify the steps when I get home tonight. It behaved the same on a Tivo HD & a Premiere.

[Edit] If I scroll down one page on the shares screen and select a directory, it pulls the episodes from the first entry on the previous page. For each position I move down on the second page of shares, it pulls the episodes from the first page. Second row, second page pulls second row, first page. Third row, second page pulls third row, first page. First row, third page pulls first row, first page. etc..


----------



## txporter

I just started playing around with this. Very cool! My wife would love to be able to push from the Tivo rather than having me push from the browser interface.

How would I go about changing the sorting order to be based on filename rather than metadata? Or how about only using the metadata Title rather than seriesTitle:Title? My files are all jumbled up with alphabetical sorting right now.

If I want to use the HD menu on vidmgr, do I need to actually be using the HD menu on my Tivo or can a resolution change be forced in the application?


----------



## jcthorne

Yes it would be very helpful if there was a way to display episode numbers and sort in the correct order for tv shows. Short of editing each metadata file to add episode numbers to the titles, could it sort by episode number if its present and then by file name? ( I am more asking for discussion than resolution just yet as I am not sure the best way to go, just that tv series do not currently show the episode numbers nor sort in order. Open to suggestion here on how best to do this or use the tool.)


----------



## txporter

Yeah, I agree. I have a mod'd version of pytivometathis that adds the episode number before the title, so my metadata looks like this:


Code:


seriesTitle : Torchwood
title : Everything Changes
episodeTitle : 101-Everything Changes
originalAirDate : 2006-10-22T00:00:00Z
description : WPC Gwen Cooper is at the scene of a brutal murder, when the "special ops," known only as Torchwood, arrive. After witnessing the group bring the dead man back to life, Gwen goes in pursuit of this mysterious organisation, only to see weirder things than she could ever imagine existed. Soon after, she begins to regret giving in to her curiosity, when she meets Captain Jack Harkness. 
isEpisode : true
seriesId : SH947230
episodeNumber : 101
vProgramGenre : Action and Adventure
vProgramGenre : Drama
vProgramGenre : Science-Fiction
vSeriesGenre : Action and Adventure
vSeriesGenre : Drama
vSeriesGenre : Science-Fiction
vDirector : Brian Kelly
vWriter : Russell T. Davies
vGuestStar : Paul Kasey
vGuestStar : Mark Heal
vGuestStar : Gary Shepheard
vGuestStar : Gwilym Havard Davies
vGuestStar : Cathryn Davies
vGuestStar : Jams Thomas
vGuestStar : Dion Davis
vGuestStar : Gwyn Vaughan-Jones
vGuestStar : Jason May
vGuestStar : Tom Price
vGuestStar : Guy Lewis
vGuestStar : Rhys Swinburn
vGuestStar : Olwen Medi
vActor : John Barrowman
vActor : Eve Myles
vActor : Gareth David-Lloyd
vActor : Naoko Mori
vActor : Burn Gorman

I have trouble reading through python code since I am not a programmer, but what I wrote before is not correct. I think it was displaying title:episodeTitle whereas I would like it to just be episodeTitle or to sort by filename.


----------



## jcthorne

I never had much luck with pytivometathis and stuck with metagenerator. My metadata files only have episode data in the episodeNumber field. And in the file name but the file names are not all consistant from one tv series to the next. Although and alpha sort of the file name or episodeNumber either one would work in my case.

I think perhaps would like to see video manager display the episode number and sort for it for items with isEpisode = true. That might work in both cases?

Just noticed another difference between metagenerator data and yours from pytivometathis. for metagenerator, title and seriestitle are the same, only episode title contains the episode title information.


----------



## txporter

Yes, metagenerator and pytivometathis do have different information in the different fields. I used to use metagenerator (and still do in the times when pytivometathis cannot grab the show correctly), which makes the alphabetical jumble even worse.

I transcode all of my own shows, which makes the filename consist at least for me. That would be my preferred approach (which I believe is what pytivo does??). I think sorting by episodenumber might also work like you say. Not sure what my Movies folder would look like exactly...but that is sort of a mess anyhow. I have both .mpg and .mp4 files in that folder and pytivo currently sorts those lists separately (.mp4 sorted alphabetically first and then .mpg listed alphabetically). Dunno.


----------



## jbernardis

When I originally wrote this program, I was developing based on my own library which consists mostly of movies - no episode numbers there. However, I can see where this can be useful. I just want to find out how it should be done. I have to write my program to be general. I can't say I want to sort on episode numbers because that does not indicate what should happen to those files that do not have an episode number, or what about those files that don't even have a metafile?

Here's what I presently do:

1) If I have episode title and series title, then the string seriestitle:episodetitle is the key.
2) If I only have episode title it is the key
3) If I only have series title it is the key
4) Otherwise the filename is the key.

Once I've determined the key for everything, I sort into key order putting directories first.

I can certainly add an option to sort on file name only beacuse that is a universal attribute. The question is how and where to consider the episode number. It probably makes sense to consider the episode number OR the episode name, but not both. SO I would propose adding two entries to the front of the above list

-1) If I have episode number and series title, the the string series title:episode number is the key.
0) If I only have the episode number, then it is the key.

and then the above list. I can add an option to ignore the episode number too, to keep with the original algorithm

This will create screwy things if the meta data is weird and you have some that have an episode number and some that don't for example. Garbage in - garbage out.

There is another potential issue here: episode number is not always a numeric value. I've seen things like E01, or even S01E07. I don't think I want to parse this string to get the numeric values, so I'd like to treat it as a string. The problem with this is that "10" sorts before "2" which of course is not what you want. People would have to enter their episode numbers with a consistent length (e.g. 01, 02, 03, ... if there are more than 9).

Would this suffice? Let me know. I'm probably not going to get to this until after Memorial Day, but this will give us a few days to better define the scope.


----------



## txporter

I like your list and the ability to ignore episode number with a setting.

How hard is it to add a setting for what metadata string to display on the Tivo? I organize most everything by series (I have a bunch of folders based on series name) since most of what we watch are TV shows rather than movies. I would prefer to set something so that I only see the episodeTitle for videos that have 'isEpisode : true' and only title for everything else.

Then a similar setting could be made for sorting. Sort based on filenames or metadata.

Thanks for your work! This is a really cool piece of software. I currently never pull anything with pytivo anymore. I only navigate to my shares when I want to look to see what is available. I then log in with my iphone to push the episodes that I want to watch. This shortcuts all of that. Very nice.


----------



## jbernardis

I'm glad it turned out useful. My original purpose was just to explore the HME and hopefullly provide an example that others might benefit from. I think that wmcbrine has done us all a big favor by porting all of this to python. It really provides a nice application development environment.


----------



## jbernardis

I can certainly think about alternate display formats. Right now the sort value and the display text are basically the same thing. I was thinking I'd have to separate these two to have the various sort options, and if I'm going to separate them, it shouldn't prove too tough to have alternatives for display. Again, I'll think on it for a few days while I'm at the shore; we'll probably have something towards the middle to end of next week. I want to explore reneg's issue too - that has be perplexed right now, so I've got to do some debugging there.


----------



## reneg

I think you can check the force_alpha option from the pyTivo.conf file which is a per share option (see get_files in plugin.py). Ideally, I'd like to see episodeTitle & episodeNumber displayed if possible. I make a one line change in the pytivo template to display filename instead of title since my filenames contain SxxExx data so I don't have to drill down another level to see episode number data.

Streambaby has an option, sort.filename=true


----------



## reneg

jbernardis said:


> I want to explore reneg's issue too - that has be perplexed right now, so I've got to do some debugging there.


Maybe this will help, I put a few prints. I hit the channel down key once, and then pressed the select key on the top entry on the second page. I think the problem is in drawScreenList.


Code:


C:\pyhme>c:\python26\python start.py
HME Server for Python 0.19
Not using Zeroconf:
Tue May 24 20:07:06 2011 Server Starts
192.168.1.92:51674 - - [24/May/2011 20:07:24] "GET /vidmgr/icon.png HTTP/1.0" 20
0 -
192.168.1.92:51752 - - [24/May/2011 20:07:36] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.92:51752 - - [24/May/2011 20:07:36] Starting HME: vidmgr
Enter pressShares: shareSelection =  0  shareOffset =  0
Exit  pressShares: shareSelection =  0  shareOffset =  12
Enter pressShares: shareSelection =  0  shareOffset =  12
Enter drawScreenList: shareSelection =  0  shareOffset =  12
Exit  pressShares: shareSelection =  0  shareOffset =  12
Enter pressShares: shareSelection =  0  shareOffset =  12
Exit  pressShares: shareSelection =  0  shareOffset =  12
192.168.1.92:51752 - - [24/May/2011 20:08:28] Ending HME: vidmgr
192.168.1.92:51756 - - [24/May/2011 20:08:29] "GET /vidmgr/icon.png HTTP/1.0" 20
0 -


----------



## jbernardis

Reneg:

I figured it out and it is a simple 1 line fix. The problem is, that I am also making major changes to the program to allow for various display and sorting options. I don't want to deliver these yet because 1) I am not quite finished, and 2) I want to do a LOT of testing before I deliver.

In the meantime, you can make the fix yourself if you are comfortable with it. In the createListing subroutine, a few lines below the cmplist routine, you will see a line like this:


Code:


root = self.share[self.shareSelection]['path']

change this to



Code:


root = self.share[self.shareSelection+self.shareOffset]['path']

Be careful not to change indentation and you should be in business.

I will be delivering this in a few days.


----------



## reneg

Thanks. That fixed the listings, but the sub-title needs a tweak too in drawScreenList:


Code:


		self.SubTitleView.set_text(self.share[self.shareSelection]['name'] + ":" + self.currentDir,
								font=self.fonts.fnt20,
								colornum=0xffffff, flags=RSRC_VALIGN_BOTTOM)

to


Code:


		self.SubTitleView.set_text(self.share[self.shareOffset+self.shareSelection]['name'] + ":" + self.currentDir,
								font=self.fonts.fnt20,
								colornum=0xffffff, flags=RSRC_VALIGN_BOTTOM)


----------



## jbernardis

You're absolutely right - thanks for finding this.

But that's not the only other place - two places at the beginning of DelVideo, and the two places where pushVideo is called from need the same fix.

Damn - I'd like to deliver this instead of just telling you to just make these changes, but I have made significant other changes to the code for the other requests and I can't release it at this time.

All I can say at this point is I will try to get this out by Wednesday, Thursday at the latest. In the meantime all I can tell the community at large is that this is only an issue if you have more than 1 page of shares. If this is your situation, you don't need to make any changes - wait for the update.


----------



## reneg

No rush, I can wait. 

I do have a feature request to consider. Could you check for a background image in each directory as you navigate into it and load it if there is one present? For TV series, I think I'd rather have one background image of the series vs an image for each episode.


----------



## jbernardis

You can already do that - if you have a file named folder.jpg - either in the same directory with the files or in a .meta subdirectory, then it will use that. Of course of you have an image file for a specific video, it will use THAT before using the folder file.


----------



## jbernardis

Alright - I worked on this sooner that I had planned because I wanted to get the fix out there. I haven't released it yet, but I want to hear people's thoughts.

With the new logic, you can specify two new options in the config.ini file, display= and sort=

sort controls how the video files are sorted. If it is omitted or is given a value of "normal" then the present mechanism will be used. To be specific, it is as follows:


title:episodetitle
episodetitle
title
filename

If you specify 'fileonly' then only the filename is used

If you specify 'episodenumber' then the above list is preceded by


title:episodenumber
episodenumber

For display, if you specify 'fileonly; then only the file name is displayed

if you specify 'episodetitle' then the following list is used:


episodetitle
title
filename

if you specify 'episodenumname' then the following list is used:


episodenumber - episodetitle
episodetitle
title
filename

otherwise, the algorithm of today is used:


title:episodetitle
episodetitle
title
filename

The lists all show the order of processing. I start at the top of the list. If I do not have ALL of the meta items to build that string, I move down to the next entry in the list.


----------



## reneg

jbernardis said:


> You can already do that - if you have a file named folder.jpg - either in the same directory with the files or in a .meta subdirectory, then it will use that. Of course of you have an image file for a specific video, it will use THAT before using the folder file.


Oops, there it is right in the readme.

Your sorting & display options seem flexible enough. Will try them when it's available


----------



## jcthorne

jbernardis said:


> Alright - I worked on this sooner that I had planned because I wanted to get the fix out there. I haven't released it yet, but I want to hear people's thoughts.
> 
> .


You have been busy! WOW. The options presented surely cover what I need and sounds like most of the others. This is great. Look forward to the update!


----------



## orangeboy

jbernardis said:


> Sure - I'll make it available, but I'm not quite done yet. Also, I'm not crazy about the idea of providing support for the code, so it would most likely be on an as-provided basis...


I'm glad to see that it appears you've changed your perspective a bit since starting this project! Thank you for making this available! :up:


----------



## windracer

I'm willing to beta test the sorting changes as well. Most of my episodic videos filenames are using the SxxExx nomenclature so they sort "alphabetically" in episode order (using force_alpha = true in pyTivo.conf).


----------



## jbernardis

Thanks windracer - and yes I changed my perspective. I'm a software developer by profession, and there's nothing worse that the pressure I feel when there is a field issue and the customer is waiting (sometimes impatiently) for a fix. I just didn't want that feeling to permeate a hobby.

Instead, what I find is that everyone has been tremendously supportive and it has actually turned somewhat gratifying to accommodate their wants.

With that said, version 0.3 of vidmgr is available at git (follow the link in my signature).

With this fix:
1) I think I fully fixed the problem reported by reneg, 
2) I added sort option to the config.ini file
sort=file will sort on the file name only
sort=episodenumber will sort on the episode number
if omitted or set to 'normal' it will use today's sort method of 'title:episodetitle'
3) I added the display option to config.ini:
display=file will show the file name only
display=eptitle will show the episode title only
display=epnumtitle will show the combination of ep number and title
if omitted or set to 'normal' it will use today's method of 'title:episdoetitle'

Note that for the last two new options, if the indicated meta data is missing, the program will move on to the title, and ultimately the filename, in order to have something to display/sort.

I have to put in a caveat here - I DID do some testing, but I don't have all of the testing rigs that you guys have so I am relying on you to help me identify any bugs.


----------



## windracer

jbernardis said:


> Instead, what I find is that everyone has been tremendously supportive and it has actually turned somewhat gratifying to accommodate their wants.


We're here for ya! :up:


----------



## jcthorne

Too Cool. Installed and had the wife try it. (if there is a bug, she will fall right into it)

Works for me as discribed. GREAT. Thanks. 

One minor I ran into from your post above. The setting is:
display=episodenumtitle 
as stated in your readme not 
display=epnumtitle 
as posted above.

Once I fixed that, it worked as intended.

I'll drive it a bit further when I get home tonight but looks great from here. (installed remotely during my lunch hour and tried it out via sling...)


----------



## jbernardis

Thanks for the input - I'm glad it's holding up for you and hope it continues to do so.


----------



## reneg

Works great, thanks for the update. 

At first I thought there was a bug in the display sorting, but I discovered some metadata issues with some of my older files. Title keyword had been set to the same as EpisodeTitle. Changing Title to SeriesTitle fixed the display sorting.


----------



## windracer

The sorting is definitely cool. Since episodenumtitle is a character sort, it's not that useful to me (episode 6 appears _after_ 11) but since all of my episodic filenames are in SxxEyy format, using the file sort with just episodetitle for the display works great.

One thing I noticed is that vidmgr doesn't show the metadata for .TiVo files like pyTivo does (using tdcat). I guess I just need to generate separate metadata files for those I keep in .TiVo format.


----------



## txporter

The changes sound excellent! I will give them a whirl this weekend. Thanks for your speedy updates!


----------



## reneg

windracer said:


> The sorting is definitely cool. Since episodenumtitle is a character sort, it's not that useful to me (episode 6 appears _after_ 11) but since all of my episodic filenames are in SxxEyy format, using the file sort with just episodetitle for the display works great.


My episode numbers are formatted by season & episode <ee>. I did have to zero pad a series than ran for more than 10 seasons in order to get it to show up the way I wanted.

1) I did run across a minor bug. Vidmgr crashed when it encountered the following filename and metadata file for House.S03E06-Que Será Será.avi. I worked around it by renaming to House.S03E06-Que Sera Sera.avi. What's interesting is that both pyTivo & Streambaby handle the filename and metadata ok. Here is the traceback from the crash:


Code:


----------------------------------------
Exception happened during processing of request from ('192.168.1.92', 56379)
Traceback (most recent call last):
  File "c:\python26\lib\SocketServer.py", line 558, in process_request_thread
    self.finish_request(request, client_address)
  File "c:\python26\lib\SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "start.py", line 141, in __init__
    client_address, server)
  File "c:\python26\lib\SocketServer.py", line 615, in __init__
    self.handle()
  File "c:\python26\lib\BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "c:\python26\lib\BaseHTTPServer.py", line 323, 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 "C:\pyhme\hme.py", line 1139, in mainloop
    while self.active and self.get_event():
  File "C:\pyhme\hme.py", line 1192, in get_event
    handle(keynum, rawcode)
  File "C:\pyhme\vidmgr\__init__.py", line 223, in handle_key_press
    self.handle_key_pressShares(keynum, rawcode)
  File "C:\pyhme\vidmgr\__init__.py", line 387, in handle_key_pressShares
    self.createListing()
  File "C:\pyhme\vidmgr\__init__.py", line 1069, in createListing
    meta = metadata.from_text(fullpath)
  File "C:\pyhme\metadata.py", line 60, in from_text
    path, name = os.path.split(unicode(full_path, 'utf-8'))
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 49-51: invalid d
ata
----------------------------------------

2) Out of habit, I use the clear key when I want to delete something. Hitting the clear key under vidmgr exits vidmgr. I wouldn't mind if it initiated a delete, but could it at least just boink instead of exit?

3) Please consider making the 2nd part of the advance key work like it does on tivo. The first part works great, it takes you to the end of the list. The second part of the advance key is that when you are at the bottom of a list and hit the advance key, it takes you to the top of the list.

Really liking this program.


----------



## txporter

Showed it to my wife last night. She was impressed. Thanks for the nice code! I really like the sorting and display title options. Just what I was looking for.


----------



## dcrowell77

Cool program! One minor feature request - it would be nice if there was some sort of visual acknowledgement that you sent a push successfully. I was playing around with it muted (someone was taking a nap) and I couldn't tell that the program actually accepted my button press.

Thanks for the work!


----------



## txporter

It does. It says something along the lines of 'Queued for Push to (Tivoname)'.


----------



## dcrowell77

txporter said:


> It does. It says something along the lines of 'Queued for Push to (Tivoname)'.


Odd... I didn't see any such message. Though I did see something when it got an error.

And speaking of errors... I got an error message (it said error from pytivo) trying to push files to my TiVoHD box. The same files worked fine on my Series 2. Interestingly, the pushes actually worked just fine. I couldn't see any errors on the pyTiVo console. I'm wondering if there might be a timing issue or something throwing things off (or maybe I just have an old version of pytivo). The files in question happened to be mp4 files that were transferable without transcoding to my TiVoHD.


----------



## jbernardis

It does say 'queued for push to tivoname', but basically all I'm doing here is some simple parsing of the returne message I get back from pytivo, There might be some set of circumstances I didn't anticipate. If you DO get an error message, please get me the exact wording and I can see if I can reproduce it.

I will look at the two issues reneg reported when I get back home on Tuesday - the file naming issue and the clear key. Regarding the second hitting of the advance key, I didn't realize that it did that on the tivo (and I've been using them for 11 years). I programmed the instant replay button to do just that, but I ought to be able to add the logic you're looking for for the advance key too.


----------



## orangeboy

I have installed a user defined Service for HME for Python (hosting the pyTivo Video Manager app) using Windows Resource Kit tools: "Instsrv.exe" and "Srvany.exe", and Window's native command: Regedit.exe. Be sure to read the footnotes!

Install a basic Service using Instsrv.exe and Srvany.exe, using the syntax "Instsrv.exe <Service Name> "<Full path to Srvany.exe>"¹:


Code:


Start > Run > Instsrv.exe  HME-Python  "C:\path\exes\srvany.exe"

Use Regedit.exe to define Srvany.exe application parameters:


Code:


Start > Run > Regedit

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HME-Python

Right-click in the right window pane > New > Key

Name the new Key²: Parameters

Select the Parameters Key in the left window pane

Right-click in the right window pane > New > String Value

Name the new REG_SZ string²: Application

Right-click the new Application string > Modify

Enter the path to Python.exe, followed by the path to Start.py³: 
"C:\Python26\python.exe" "D:\Program Files\HME Python\start.py"

Close Regedit

All the parts should be in place for the new Service. Now just need to start it:


Code:


Start > Run > Services.msc

Find "HME-Python" in the list of Services

Right-click HME-Python > Start

There may be third party apps that make this process a whole lot easier, but I had the Resource Kit Tools already installed, so I used what I had available. You can get both Instsrv.exe and Srvany.exe by themselves in a .zip file here if you didn't want to get the full-blown ResKit Tools. SC.exe is another tool that can configure Windows Services, adding dependencies, changing Display Name, and adding Account information (if needed).

Footnotes:
¹Both Instsrv.exe and Srvany.exe are found in my %path%, but Instsrv.exe requires the full path to the executable in it's options. You will have to specify the path to Instsrv.exe if it is not found in the %path% search order.

²Both "Parameters" and "Application" are required registry entries for Srvany.exe, and _may_ be case sensitive.

³Your path to Python.exe and Start.py will have to be adjusted accordingly.


----------



## lrhorer

wmcbrine said:


> lrhorer, I think you want this thread.


Um, OK. I'm writing the /etc/init.d startup script for pyhme and updating the one for pyTiVo to better meet the standards established for System V scripts. Is there a need (considering vidmgr or any other utility) to restart pyhme if pyTiVo is hard restarted?


----------



## jbernardis

It depends on the reason for the restart. The only actual interface between vidmgr and pytivo is the pytivo http interface - I post requests there to push a video. My program doesn't know the status of the pytivo daemon - it just sends a message there and hope it gets a response.

So the bottom line is that if nothing has changed in the pytivo config, then no vidmgr restart is necessary. If, on the other hand, pytivo is suddenly listening to a different port or if additional shares are created (for example), then vidmgr will need to reread its configuration, and perhaps the best/easiest way to do that will be to restart the process.


----------



## jbernardis

reneg said:


> I did run across a minor bug. Vidmgr crashed when it encountered the following filename and metadata file for House.S03E06-Que Será Será.avi. I worked around it by renaming to House.S03E06-Que Sera Sera.avi. What's interesting is that both pyTivo & Streambaby handle the filename and metadata ok.


Reneg:

I'm not quite sure why this works for you in pytivo. I don't know about streambaby, but the metadata.py file you include in your trace above borrows heavily from the metadata.py file that is part of pytivo, and in fact the line in question is verbatim from pytivo (or at least the version I'm using - perhaps it's old).

The problem is that it is trying to convert the filename to a unicode string with utf-8 encoding and the filename contains characters that do not conform to that spec. I'm not sure why I'd want to do this because the filenames I am using are, in fact, file names I have read off of the disk itself. It seems to me I should be using the filenames verbatim (as I said - I did not write the metadata file - it was "derived" from pytivo).

I'm going to try just removing the unicode calls on this (and one other) line of code to see what happens.


----------



## ajayabb

dcrowell77 said:


> Odd... I didn't see any such message. Though I did see something when it got an error.
> 
> And speaking of errors... I got an error message (it said error from pytivo) trying to push files to my TiVoHD box. The same files worked fine on my Series 2. Interestingly, the pushes actually worked just fine. I couldn't see any errors on the pyTiVo console. I'm wondering if there might be a timing issue or something throwing things off (or maybe I just have an old version of pytivo). The files in question happened to be mp4 files that were transferable without transcoding to my TiVoHD.


I got the same error message "Pytivo Push error" with an h.264 mp4 file. The file still transferred but I also wonder if it was a timing issue.


----------



## jbernardis

ajayabb said:


> I got the same error message "Pytivo Push error" with an h.264 mp4 file. The file still transferred but I also wonder if it was a timing issue.


When you use the pytivo web interface and push a video, what does the resultant web page look like? Mine looks like this:



Code:


Queued for Push to Master Bedroom
 
/Movies/Family/Disney/Shorts/Day and Night.mp4

The page will reload in 5 seconds.

vidmgr basically uses the same HTTP interface to make its push request, and then literally looks for the string 'queue' in a case insensitive manner in the response. If it finds 1 or more occurrences, it assumes that the push went OK. Otherwise it gives the above generic error message.

Perhaps you are using an different version of pytivo where the wording is different? Try it with a browser and let me know what you get. I can perhaps make the code accept additional text to indicate a success.


----------



## wmcbrine

jbernardis said:


> The problem is that it is trying to convert the filename to a unicode string with utf-8 encoding and the filename contains characters that do not conform to that spec. I'm not sure why I'd want to do this because the filenames I am using are, in fact, file names I have read off of the disk itself. It seems to me I should be using the filenames verbatim


The HME protocol only speaks UTF-8 (or ASCII, which is a proper subset of UTF-8). It's not meaningful to say "using the filenames verbatim" -- verbatim in what character set? In Windows, that's usually Windows-1252 (a minor variant of Latin-1), if you're using the 8-bit APIs. Throw that at the TiVo, and it will barf.

pyTivo mostly uses Unicode APIs -- except, for certain things, in Windows -- but uses UTF-8 internally to save memory.


----------



## jbernardis

wmcbrine said:


> The HME protocol only speaks UTF-8 (or ASCII, which is a proper subset of UTF-8). It's not meaningful to say "using the filenames verbatim" -- verbatim in what character set? In Windows, that's usually Windows-1252 (a minor variant of Latin-1), if you're using the 8-bit APIs. Throw that at the TiVo, and it will barf.
> 
> pyTivo mostly uses Unicode APIs -- except, for certain things, in Windows -- but uses UTF-8 internally to save memory.


SO I guess there's nothing to do with this filename except manually change it like the original poster did. I should also probably put a try block around the unicode call. All of this begs the question, then, about the OP saying this file worked for him in pytivo. How did pytivo handle it if the filename violates the TiVo specs?


----------



## wmcbrine

jbernardis said:


> SO I guess there's nothing to do with this filename except manually change it like the original poster did.


What? No, no, no. Either read it with a Unicode call -- in Python, you do this by passing a Unicode path to os.listdir(), for example -- or else recognize the 8-bit character set that's being used, or just assume it, and convert appropriately.


----------



## dcrowell77

jbernardis said:


> When you use the pytivo web interface and push a video, what does the resultant web page look like? Mine looks like this:
> 
> 
> 
> Code:
> 
> 
> Queued for Push to Master Bedroom
> 
> /Movies/Family/Disney/Shorts/Day and Night.mp4
> 
> The page will reload in 5 seconds.
> 
> vidmgr basically uses the same HTTP interface to make its push request, and then literally looks for the string 'queue' in a case insensitive manner in the response. If it finds 1 or more occurrences, it assumes that the push went OK. Otherwise it gives the above generic error message.
> 
> Perhaps you are using an different version of pytivo where the wording is different? Try it with a browser and let me know what you get. I can perhaps make the code accept additional text to indicate a success.


I grabbed the console output from pytivo during the attempt that worked but indicated a failure. I didn't notice any messages using the web interface.



Code:


DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec mpeg2video not compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec mpeg2video not compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.video:Pushing http://192.168.1.7:9032/TV%20Shows/Burn%20Notice/Burn%20Notice%20-%20205%20-%20Scatter%20Point.mpg
DEBUG:pyTivo.mind:__login
{'cams_security_domain': 'tivocom', 'cams_login_config': 'http', 'cams_cb_password': 'd4a1n14c', 'cams_original_url': '/mind/mind7?type=infoGet', 'cams_cb_username': '[email protected]'}
DEBUG:pyTivo.mind:pcBodySearch
{}

<pcBodyList><isBottom>true</isBottom><isTop>true</isTop><pcBody><bucketNumber>-1</bucketNumber><levelOfDetail>low</levelOfDetail><name>pyTivo</name><pcBodyId>tivo:pc.1001335731</pcBodyId><type>pcBody</type></pcBody></pcBodyList>g
DEBUG:pyTivo.mind:pcBodySearch
{}

<pcBodyList><isBottom>true</isBottom><isTop>true</isTop><pcBody><bucketNumber>-1</bucketNumber><levelOfDetail>low</levelOfDetail><name>pyTivo</name><pcBodyId>tivo:pc.1001335731</pcBodyId><type>pcBody</type></pcBody></pcBodyList>g
DEBUG:pyTivo.mind:bodyOfferModify&bodyId=tsn:65200018042EBC4
{'description': '', 'title': 'Burn Notice - 205 - Scatter Point', 'url': 'http://192.168.1.7:9032/TV%20Shows/Burn%20Notice/Burn%20Notice%20-%20205%20-%20Scatter%20Point.mpg?Format=video/mpeg', 'pcBodyId': 'tivo:pc.1001335731', 'bodyId': 'tsn:65200018042EBC4', 'publishDate': '2011-05-31 03:1241', 'source': 'SH924844', 'state': 'complete', 'partnerId': 'tivo:pt.3187', 'duration': 3595, 'encodingType': 'mpeg2ProgramStream', 'size': 1783300643}

<bodyOffer><bodyId>tsn:65200018042EBC4</bodyId><bodyOfferId>tivo:bo.15028161</bodyOfferId><createDate>2011-05-31 03:12:39</createDate><description /><duration>3595</duration><encodingType>mpeg2ProgramStream</encodingType><levelOfDetail>high</levelOfDetail><offerId>tivo:of.bs.15028161</offerId><partnerId>tivo:pt.3187</partnerId><pcBodyId>tivo:pc.1001335731</pcBodyId><publishDate>2011-05-31 23:41:00</publishDate><size>1783300643</size><source>SH924844</source><state>complete</state><title>Burn Notice - 205 - Scatter Point</title><updateDate>2011-05-31 03:12:39</updateDate><url>http://192.168.1.7:9032/TV%20Shows/Burn%20Notice/Burn%20Notice%20-%20205%20-%20Scatter%20Point.mpg?Format=video/mpeg</url></bodyOffer>g
DEBUG:pyTivo.mind:subscribe&bodyId=tsn:65200018042EBC4
{'uiType': 'cds', 'idSetSource': {'contentId': 'tivo:ct.bs.15028161', 'type': 'singleOfferSource', 'offerId': 'tivo:of.bs.15028161'}, 'bodyId': 'tsn:65200018042EBC4', 'title': 'pcBodySubscription'}

<subscribeResult><subscription><autoRecord>true</autoRecord><bodyGeneratesCandidates>false</bodyGeneratesCandidates><bodyId>tsn:65200018042EBC4</bodyId><hdOnly>false</hdOnly><idSetSource><contentId>tivo:ct.bs.15028161</contentId><offerId>tivo:of.bs.15028161</offerId><type>singleOfferSource</type></idSetSource><isAdult>false</isAdult><isForKids>false</isForKids><levelOfDetail>high</levelOfDetail><showStatus>rerunsAllowed</showStatus><subscriptionId>tivo:sb.15028531</subscriptionId><title>pcBodySubscription</title><type>subscription</type><uiType>cds</uiType></subscription></subscribeResult>g
INFO:pyTivo:192.168.1.7 [30/May/2011 22:12:43] "POST /TivoConnect HTTP/1.0" 302
-
INFO:pyTivo:192.168.1.7 [30/May/2011 22:12:43] "GET /None HTTP/1.0" 200 -
DEBUG:pyTivo.video.transcode:CACHE HIT! V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg
INFO:pyTivo:192.168.1.4 [30/May/2011 22:13:08] "GET /TV%20Shows/Burn%20Notice/Burn%20Notice%20-%20205%20-%20Scatter%20Point.mpg?Format=video%2Fmpeg HTTP/1.1" 206 -
DEBUG:pyTivo.video.video:V:\Videos\TV\Burn Notice\Burn Notice - 205 - Scatter Point.mpg is tivo compatible


----------



## jbernardis

Here are the relevant lines from my pytivo log when I do a push.


Code:


2011-05-30 21:47:50,014 INFO  pyTivo.video.video: [30/May/2011 21:47:50] Queued "/media/Videos/Movies/Family/Disney/Shorts/Day and Night.mp4" for Push to Master Bedroom
2011-05-30 21:47:50,015 INFO  pyTivo: 192.168.1.124 [30/May/2011 21:47:50] "POST /TiVoConnect HTTP/1.1" 200 -

Note 2 things: 1) there is a very definite Queued message in my log. I'm not sure why it's not in yours, and 2) My POST response is 200 which indicates success. Yours is 302 which means "Moved Temporarily". I'm not sure why yours gets the 302, but one question I'd have to ask is how recent your pytivo is? Maybe it's time to update it? Just a suggestion.

If I don't see a response from pytivo, I have to pretty much assume a failure. I guess I could go by the HTTP return code instead of the message, but I'm not sure if a 302 is a valid return code in this case. Can anybody offer an opinion here?


----------



## wmcbrine

Yeah, pyTivo doesn't use 302 currently, but it used to. This was changed in Feb. 2010.


----------



## jbernardis

I posted version 0.3a of the app on git. This addresses some of the issues reported here. The clear key no longer directly exits the app. That was actually an early debugging aid when I was testing deeply nested directories - I wanted a quick way out, and I just forgot to remove it.
Also, the advance key now takes you back to the beginning of a list if you're positioned at the end. Otherwise, it takes you to the end.
Also, I removed the calls to unicode from metadata.py. These are not filenames I am trying to send to the tivo - they are file names I am attempting to open locally in order to read the meta data out of them. I felt there was no need to process the file names as such. I'm sure if this causes issues we'll all hear about it here.

I have no additional information for how to proceed with the 302/200 HTTP return code and the missing queued message other than to advise people to update their pytivo installation. Also, someone wanted some kind of a "please wait" type of thing if the requested operation was going to be lengthy. I'm not saying no to that, but it's low on the to do list.


----------



## reneg

jbernardis said:


> I posted version 0.3a of the app on git. This addresses some of the issues reported here. The clear key no longer directly exits the app. That was actually an early debugging aid when I was testing deeply nested directories - I wanted a quick way out, and I just forgot to remove it.
> Also, the advance key now takes you back to the beginning of a list if you're positioned at the end. Otherwise, it takes you to the end.
> Also, I removed the calls to unicode from metadata.py. These are not filenames I am trying to send to the tivo - they are file names I am attempting to open locally in order to read the meta data out of them. I felt there was no need to process the file names as such. I'm sure if this causes issues we'll all hear about it here.


No new issues here. Works great, thanks for the changes!


----------



## dcrowell77

jbernardis said:


> I have no additional information for how to proceed with the 302/200 HTTP return code and the missing queued message other than to advise people to update their pytivo installation.


I made an update and things are working better now. I do see the positive message and I haven't gotten an error.

Thanks!


----------



## lrhorer

jbernardis said:


> Also, someone wanted some kind of a "please wait" type of thing if the requested operation was going to be lengthy. I'm not saying no to that, but it's low on the to do list.


OK. The other thing that hit me was the lack of a listing of the number of videos in a directory. PyTivo and Galleon both do this, and I like it.


----------



## jbernardis

lrhorer said:


> OK. The other thing that hit me was the lack of a listing of the number of videos in a directory. PyTivo and Galleon both do this, and I like it.


I'm at work just thinking about this one. I kind of like that idea too. Does it just show videos, and not subdirectories? Does it just show the number of videos in the immediate subdirectory and not in the entire subdirectory tree?

I could probably do videos in the immediate directory easily enough, but I wouldn't want to do the entire tree, not because it's tough, but because it could be expensive in terms of processing time. Would this suffice?


----------



## jbernardis

Version 0.3b is now on git. A few changes:

1) I added a "please wait" graphic for long running operations - currently this includes pushing a video, deleting a video, and building a directory listing. The latter is not really necessary, but if your directories are large and have thumbnails, they could take a few seconds.
2) I added a file and directory count to directory and share names where they appear on the screen. (These two items at lrhorer's request)
3) I have provided an alternate set of graphics. They are in the skins/blue directory. Just drop all of the png files into the vidmgr directory if you want to try it out. The background is just a simple blue color with a gradient fill of a lighter blue. It's much cleaner and I like it. I was never in love with the original purple screens, but didn't want to spend too much time on that aspect of the app.
4) Because of the alternate skin, I have changed the color of the font used for description text from black to white. I think this too looks better

Happy pushing


----------



## jbernardis

Sorry everyone

There were a couple of bugs in the last delivery, prompting me to deliver 0.3c. This fixes:
1) exception when navigating OUT of an empty directory
2) video count was not updating in the shares list when a video was deleted
3) minor glitch when processing display option in the config file


----------



## jcthorne

Wow, really on a roll with this. Love the updates! Working very well. Thanks!

I have a request to consider. Would it be possible to append the starRating, movieYear, and the first 2 or 3 vActor tags (from the metadata) to the discription or display them in some other way. Perhaps to the right of the cover art in the HD view? Just looking for a way to get just a bit more info presented. 

Thanks again for a very useful bit of software.


----------



## reneg

Latest update is nice. I'll throw a couple requests out there too:
1) Support the info button and display the metadata kind of like how Tivo supports it on individual items.
2) Increase HD lists from 12 rows to 13 rows (not sure 14 rows would fit).


----------



## jbernardis

Ok - let's see

Reneg's request number 2 is trivial - I can see how many lines I can fit and increase it to that.

Reneg's other request kind of works hand in hand with jcthorne's request. There really is not too much space left on the screen - the area to the right of the thumbnail is where I have the push/delete menu and the menu if you have multiple tivo's. But perhaps the info button could bring up some sort of pop-up where I could put more complete metadata information.

Let me think about it for a few days.


----------



## lrhorer

jbernardis said:


> Version 0.3b is now on git. A few changes:
> 
> 1) I added a "please wait" graphic for long running operations - currently this includes pushing a video, deleting a video, and building a directory listing. The latter is not really necessary, but if your directories are large and have thumbnails, they could take a few seconds.


Thanks! 'No thumbnails - at least not yet, but many of my shares have more than 1000 videos in them. Under the old code I could never really be certain whether the button press was lost, or not.



jbernardis said:


> 2) I added a file and directory count to directory and share names where they appear on the screen. (These two items at lrhorer's request)


Yep, and thanks a ton! I'll have to try this out, perhaps tonight if I get a chance.



jbernardis said:


> 3) I have provided an alternate set of graphics. They are in the skins/blue directory. Just drop all of the png files into the vidmgr directory if you want to try it out. The background is just a simple blue color with a gradient fill of a lighter blue. It's much cleaner and I like it. I was never in love with the original purple screens, but didn't want to spend too much time on that aspect of the app.


Yeah, me, either. I had real trouble reading the screen, especially in the livingroom, which is often sunlit. I just created a simple two tone gray HD background shown below for my own use. I'll try yours out and see how I like it. If anyone likes it, they are free to scarf it from my website:










http://fletchergeek.com/images/background.png
http://fletchergeek.com/images/backgroundHD.png
Note: I haven't tried the SD background, myself.



jbernardis said:


> 4) Because of the alternate skin, I have changed the color of the font used for description text from black to white. I think this too looks better


Oh, cool! I agree about the font. I was going to look into this, but you beat me to it.


----------



## lrhorer

jbernardis said:


> I'm at work just thinking about this one. I kind of like that idea too. Does it just show videos, and not subdirectories? Does it just show the number of videos in the immediate subdirectory and not in the entire subdirectory tree?


I'm not sure. Two levels is the deepest I go.



jbernardis said:


> Would this suffice?


For me it certainly would. Perhaps a better compromise, however, would be the total number of videos in the immediate subdirectory plus the number of child directories in the immediate subdirectory.


----------



## jbernardis

lrhorer said:


> I'm not sure. Two levels is the deepest I go.
> 
> For me it certainly would. Perhaps a better compromise, however, would be the total number of videos in the immediate subdirectory plus the number of child directories in the immediate subdirectory.


lrhorer:

This is already in the current git. You can download it and try it today. It tells you the total number of videos PLUS the number of directories - a single sum. This is what pytivo does (at least the version I am using)

I am just about ready to release a version that allows you to press the "info" button to see ALL of the metadata associated with a video - not just the description as it currently does. I expect to upload it by Friday of this week. The logic is relatively complete, but I was just trying to figure out if I have a complete list of meta items. I'm basically using the metadata.py module from pytivo to identify the MANY different tags.


----------



## lrhorer

jbernardis said:


> This is already in the current git. You can download it and try it today.


I have 0.3c. Isn't that the latest as of this moment?



jbernardis said:


> It tells you the total number of videos PLUS the number of directories - a single sum. This is what pytivo does (at least the version I am using)


OK, I really wouldn't notice this, since none of the folders I have created have both videos and folders in them.



jbernardis said:


> I am just about ready to release a version that allows you to press the "info" button to see ALL of the metadata associated with a video - not just the description as it currently does. I expect to upload it by Friday of this week. The logic is relatively complete, but I was just trying to figure out if I have a complete list of meta items. I'm basically using the metadata.py module from pytivo to identify the MANY different tags.


That sounds intriguing. Boy, you're really on a roll with this app!


----------



## jbernardis

lrhorer said:


> I have 0.3c. Isn't that the latest as of this moment?


Yes - 0.3c is the version you want. Basically if you have the version that has the clock icon for long-running operations, you have the correct version since both of these capabilities were released together. If you are not seeing a count of your videos, please let me know and we can do some debugging.


----------



## jbernardis

ok

Version 0.4 is now available - this version adds an info screen. This screen pops up over top of the video list or the details page when you press the info button and it displays the meta data. Pressing clear or left on the popup will dismiss it. While on the pop-up, if there is more than 1 page, channel up/down will allow paging. There is an arrow "cue" at the top and bottom of the page to indicate if there is more information in that direction.

Note - if you are in the habit of just copying the py file, there are new png files - most notably the "info*.png" files, but also, one of the png files in the "blue" collection was
incorrect and is fixed with this delivery (specifically hiliteHD.png).


----------



## reneg

Tried out 0.4 and worked well on my setup. I like the formatting, but not the pink background. Pink is ok in small doses, but that's way too much for me. I haven't compared what is displayed vs my metadata files, but I didn't notice anything I couldn't live without.


----------



## windracer

reneg said:


> I like the formatting, but not the pink background. Pink is ok in small doses, but that's way too much for me.


Try the blue skin ... it's a lot better.


----------



## jbernardis

reneg said:


> Tried out 0.4 and worked well on my setup. I like the formatting, but not the pink background. Pink is ok in small doses, but that's way too much for me. I haven't compared what is displayed vs my metadata files, but I didn't notice anything I couldn't live without.


I agree with windracer - I don't pay too much attention to the original skin anymore - I ship all the png files that are needed, but I spend more time with the blue skin.

If everyone feels this way, I might drop the original files - it's a pain to make sure both sets are updated.


----------



## jbernardis

reneg said:


> I haven't compared what is displayed vs my metadata files, but I didn't notice anything I couldn't live without.


The only thing I explicitly leave out are the isEpisode and isEpisodic flags. I have a dictionary in the program to translate tags into a friendlier name, but If I don't find a label in that dictionary, I just use the label as is. Every tag except for the two mentioned above will be displayed. Also, I force Title, seriesTitle, episodeTitle, and description to the top of the display.

If there are tags that you think I should ignore, translate into a friendlier name, or force to the front, give me your thoughts. The entire thing is based on a dictionary and two lists. It would be easy to extend or change.


----------



## lrhorer

jbernardis said:


> Ok - let's see
> 
> Reneg's request number 2 is trivial - I can see how many lines I can fit and increase it to that.


Have you looked into this, or is it by any chance already part of 0.4c? I would love to have an expanded number of titles by this weekend - I have company coming over. If you ask me, the top selling point of this app is the greater coverage of titles in the video list. Essentially, it displays twice the number of titles the NPL does, because the NPL always retains the top or bottom entry, as the case may be, when moving to a new page. Adding one or two more lines would just be gravy.

I'm looking forward to downloading your latest offering when I get home tomight.


----------



## jbernardis

I totally forgot about Reneg's request with all of the changes for the info screen.
version 0.4b is out on git - I increased the list size for the HD screen from 12 to 14.
It looks OK on my TV, but because the simulator does not do HD, I cannot verify that I am not outside the safe zone.

If I am, let me know. It's a 1 line change, but if there is enough of a difference from tv to tv, maybe I can make it a config option.


----------



## reneg

I made the one line change on my system for 14 rows and it worked well for me. 

I had made my own backgound a couple releases back because I didn't care for the original background. My preference is the blue skin and I believe it would be a more appealing default.

The program is easy to use and has a high acceptance factor in my household. Thanks again for making this available.


----------



## lrhorer

Is there any way the thumbnail could be moved down just a bit? Sometimes the description text overflows it. Perhaps it would also be a good idea to truncate the description text if it is longer than a certain size? Probably both of these should be configurable, as their proper values depend on font size.


----------



## lrhorer

jbernardis said:


> It looks OK on my TV, but because the simulator does not do HD, I cannot verify that I am not outside the safe zone.


What, exactly, is the safe zone?


----------



## jbernardis

lrhorer said:


> What, exactly, is the safe zone?


The safe zone is an area around the perimeter of the screen that you can be reasonably sure will be displayed. Some TV's cut off the edges due to overscan. This potentially cut-off area is the unsafe zone - everything else is the safe zone.

BTW - I made your requested changes to version 0.4c now available on git.

I was able to move the thumbnail down about 20 pixels, but I also added logic to calculate the size of the description view based on the font size. Now it should only show full lines of text and it should not impinge on the thumbnail (and vice-versa). Incidentally, these two views only overlapped by a single pixel before this fix; the situation was exacerbated by the fact that the description view height was just an arbitrary value, and it was only showing the top half of a line of text.


----------



## jbernardis

lrhorer said:


> Probably both of these should be configurable, as their proper values depend on font size.


Although there is presently no way to configure the positions of things on the screen, you CAN configure the description font size via a value in the config.ini.

In the vidmgr section of the file, add a line such as:
descsize=16

The default value is 20. I know 20 might cause an overflow of the current description view, but I deemed that as acceptable since the full meta data is now available by pressing the info key.


----------



## westside_guy

I respectfully suggest that - even if you feel it's easier in the discussions to use the term "pyhme" - your docs should use the correct name "hmeforpython" (or "HME for Python") so it's easier to find the necessary external stuff. Speaking as someone who hasn't been hanging around TC for a while, I can say a Google search for "pyhme" is not particularly enlightening. 

If you choose to release this, I also suggest you consider adding a configuration file toggle that could disable the "delete" functionality.

Thanks for making this! It seems to work well, and it's certainly snappier than streambaby (and likely doesn't have the memory leak issues, being based on python rather than java).


----------



## jbernardis

westside_guy said:


> I respectfully suggest that - even if you feel it's easier in the discussions to use the term "pyhme" - your docs should use the correct name "hmeforpython" (or "HME for Python") so it's easier to find the necessary external stuff. Speaking as someone who hasn't been hanging around TC for a while, I can say a Google search for "pyhme" is not particularly enlightening.
> 
> If you choose to release this, I also suggest you consider adding a configuration file toggle that could disable the "delete" functionality.
> 
> Thanks for making this! It seems to work well, and it's certainly snappier than streambaby (and likely doesn't have the memory leak issues, being based on python rather than java).


Glad you like it. I will take the delete toggle feature into consideration. Seems like a good idea.

I agree that with the many changes that have gone into the program, there is not one place that provides adeqaute documentation. I should simply consolidate everything into one place rather than just have a running log.


----------



## westside_guy

jbernardis said:


> Glad you like it. I will take the delete toggle feature into consideration. Seems like a good idea.


My personal bias is to always err towards caution - but that's just me.

For my own use I just did a quick-and-dirty edit to your code, so I don't have to worry about the kid accidentally deleting the file (or thinking "of course I want to remove it from the Tivo, I'm done watching!"). I didn't even bother removing the button - it just says "no can do" if they hit delete (and simply plays the "bonk" sound if they manage to hit thumbs up and get into the script anyway). 

Anyway, thanks again! Seriously, it's so-ooo nice to have a quick and responsive UI for this.


----------



## jbernardis

I just posted version 0.5 (we're halfway to 1.0) onto git.

I incorporated westside_guy's idea of having a config option to disable delete functionality, but I made MANY other changes as well:

-As stated, I added the ability to specify deleteallowed=False in the config file to prevent file deletions

-I formalized the skin concept. Now skins are kept in separate directories under the skins directory (e.g. skins/blue), and the directory you want to use for a skin is named in the config file (e.g. skin=blue). ALso, changed the
image loading logic such that if the HD version of an image does not exist, then it will use the SD version of that file. This solved the situation where there were duplicate files just to satisfy a naming convention.

-I moved metadata.py into the vidmgr directory. It didn't belong up in the pyhme directory and I never liked having it up there. I was too unfamiliar with python to know how to specify to look in the vidmgr subdirectory
to find the file (it turns out I didn't need to do anything - python found it!!)

-I split README.txt into README.txt and changelog.txt. changelog.txt will contain the change history, and README will be maintained as the always current description of the application

-I fixed the positioning bug in 0.4c where the "Push" button was over top of the bottom line of the description.

Perhaps the easiest way to install all of this over a present installation is to save your config file, and if you have a custom skin, save all of the png files. Delete the vidmgr subdirectory tree, move this package into its place, create a directory for your custom skin under skins (if you had one) and then add your desired skin to the config.ini file. Also, if you do not want delete enabled, set that flag to false.


----------



## westside_guy

This is really cool - thank you for sharing your work with us!

It's amazing what a great group of "community devs" we have - what with pyTivo/X, tivodecode, streambaby, kttmg, the other sundry apps wmcbrine continues to develop, your great new tool, etc. etc. We're very lucky to have all of you guys letting us enjoy the fruits of your labor.


----------



## lrhorer

jbernardis said:


> Glad you like it. I will take the delete toggle feature into consideration. Seems like a good idea.


I second that. Although I have not yet deleted a show on the server accidentally, I don't really ever want to do so, at least not from a TiVo. The other way around, yes, but deleting a file on the server from a TiVo? Uh-uh. For safety I would prefer to have the ability to disable the feature.

Edit - Oh I see you've already done it. You're just too efficient!


----------



## lrhorer

jbernardis said:


> The only thing I explicitly leave out are the isEpisode and isEpisodic flags. I have a dictionary in the program to translate tags into a friendlier name, but If I don't find a label in that dictionary, I just use the label as is. Every tag except for the two mentioned above will be displayed. Also, I force Title, seriesTitle, episodeTitle, and description to the top of the display.


I vote to also force the "movieYear" field to the top, between the titles and the description, followed by director(s), writer(s), and then description, followed by the actors. For me, at least, I would also find the info more readable if there were a blank line between the writer(s) and the description, and another between the description and the actors.



jbernardis said:


> If there are tags that you think I should ignore, translate into a friendlier name, or force to the front, give me your thoughts. The entire thing is based on a dictionary and two lists. It would be easy to extend or change.


The two following fields show up in some of the metafiles, and I have no idea what they are. I think they can be suppressed:

Showing Bits
Display Major Number


----------



## jcthorne

Showing Bits maps to the atributes Closed Captioned, Stereo, Subtitles, Joined in Progress, SAP, 3D, Letterbox, the various advisories for language, violance, nudity. These could be useful to some but I do not use them. Maping info for this is in one of the pytivo metadata threads over on pytivo forum but its been a long time. WMcBrine would know for sure.

Display Major Number is related to channel number it was recorded from.


I would second the request for movie year to display after the title but before the discription. Also the movie star rating (1 star to 5 stars)


----------



## jcthorne

I got 0.5 installed today and it looks great. Love the new features. I updated my custom skin, placed it in a directory as stated and it worked perfectly. Had to add a few new graphics for the new elements but since your skins use easy to work with file types, was no trouble.

I do now have a request that came from my wife flipping through TV shows. She is good a pointing out the obvious....

In my directory structure I have a folder for each tv series. IE NCIS. Under that are a set of folders for each season and in each season folder are the episodes with thier meta data and graphics.

I also have placed a folder.jpg in the series folder and each season folder. Would be great if vidmgr displayed those jpgs when the folder is highlighted. That way the show cover art is displayed when its title is highlighted rather than no art until the episode is selected 3 levels in. IE its as simple as when a folder is highlighed, display the folder.jpg contained in that folder if it exists. Thanks for considering this, look forward to what you come up with next.


----------



## jbernardis

One important step I forgot to mention about installing 0.5 - don't forget to remove the metadata.py (and metadata.pyc) from the pyhme directory. The new home for these files is in the vidmgr directory. Right now, the files would be the same, so if you forget to delete the pyhme copy, no harm done. However, if this file ever changes, the changes will only be delivered to the copy in the vidmgr directory. That means you will have two identically named files with different content, and I'm not sure which one python will use - best simply to delete the copy in the pyhme directory.

Regarding the requested changes to the metadata in the info screen, it seems that everybody wants something different, so I think I'm going to add these lists to the config file - that way you'll get exactly what you want.

I am also looking into the folder thumbnail ides - I like it.


----------



## windracer

Lovin' 0.5, nice work!

I did notice that the changelog.txt file doesn't seem to exist in git yet?


----------



## jbernardis

windracer said:


> I did notice that the changelog.txt file doesn't seem to exist in git yet?


I forgot to include changelog - I forgot to make the changes to my build.xml to stage this file for delivery too, but you'll find it now, because.....

I have just posted 0.5a in git. In addition to now including the changelog, I have also implemented the recently requested changes. You can place metaignore= and metafirst= lines in the config file to override the default values for metadata that is either ignored or placed first in the display.

Also, thumbnails are now displayed for directories. It looks for a file named folder.jpg either in that directory or in the .meta subdirectory.

As I was posting, it hit me that the new directory thumbnail logic does not apply to shares. Many people use shares differently than I do. I have a single share that has subdirectories in it, so thumbnails there didn't make sense, but I know that some people have a different share for each show - in which case showing thumbnails for the share makes sense. It should be able to easily add it if it's wanted.

Jeff


----------



## lrhorer

jbernardis said:


> I have just posted 0.5a in git. In addition to now including the changelog, I have also implemented the recently requested changes. You can place metaignore= and metafirst= lines in the config file to override the default values for metadata that is either ignored or placed first in the display.


Oh, excellent! What about the ability to insert spaces?



jbernardis said:


> Also, thumbnails are now displayed for directories. It looks for a file named folder.jpg either in that directory or in the .meta subdirectory.


Let me make sure I have this straight. If the file name precisely "folder.jpg", or is it <folder>.jpg, where <folder> is the name of the directory? In the case of a .meta subdirectory, that is a subdirectory of <folder>, right, not in the vidmgr directory?



jbernardis said:


> As I was posting, it hit me that the new directory thumbnail logic does not apply to shares. Many people use shares differently than I do. I have a single share that has subdirectories in it, so thumbnails there didn't make sense, but I know that some people have a different share for each show - in which case showing thumbnails for the share makes sense. It should be able to easily add it if it's wanted.


Well, I have more than 1 share, but I don't have a share for every show, or even a share for every genre, so my usage more closely resembles yours, but I can see how some people would make use of the feature.


----------



## jbernardis

lrhorer said:


> Oh, excellent! What about the ability to insert spaces?


Not yet - I am thinking about how to do that. I have an idea, but haven't started implementing yet. I am thinking about adding metaspace= to the config file. You'd name metadata items after which you'd like to have a space.



lrhorer said:


> Let me make sure I have this straight. If the file name precisely "folder.jpg", or is it <folder>.jpg, where <folder> is the name of the directory? In the case of a .meta subdirectory, that is a subdirectory of <folder>, right, not in the vidmgr directory?


the file is literally named folder.jpg - NOT the directory name, and the .meta directory is within the folder itself, not in the vidmgr directory



lrhorer said:


> Well, I have more than 1 share, but I don't have a share for every show, or even a share for every genre, so my usage more closely resembles yours, but I can see how some people would make use of the feature.


I'm already well along adding this feature. It will be there in the next release.


----------



## lew

jbernardis said:


> -As stated, I added the ability to specify deleteallowed=False in the config file to prevent file deletions


Thank you. I didn't ask for it but I'll use it.

It's a shame there isn't a way to select PyTivo Video Manager from either the main tivo menu or from the Now Playing list.

I doubt it can be done, at least on a stock tivo, but it would be nice to replace the add on the main tivo menu with your application.


----------



## lrhorer

TiVo needs to look at this application to see what the NPL *should* should be like, user configurations and all. This is looking better and better by the day - by the hour almost.

One more question / request: Does the content text from the metafile have to be so far over to the right on the info screen? There's a big gap between the field name and the field text. This not only makes the fields longer, it makes it harder to read. Adding the blank line for which I have asked will help, but moving the text to the left will help even more.


----------



## lrhorer

Could you see your way to program a paged jump based on a number press? Thus, pressing the 1 button would take the user 1/10th the way down the current list, 2 will take the user 2/10s down the list, etc? With some of these shares and share folders having titles numbering in the hundreds and even the thousands, being able to jump only to the beginning the end, or up / down 14 titles doesn't really cut it, sometimes.

(I don't suppose we could get more than 14 titles on the screen?)


----------



## rrr22777

Where do I put the contents of config.merge? I dont have config.ini. Running everything on linux.

ERRORyTivo:hmeserver - 'type'
ERRORyTivoytivos - 'type'
ERRORyTivo:tivos - 'type'
ERRORyTivo:vidmgr - 'type'
INFOyTivo:192.168.0.250 [13/Jun/2011 13:10:10] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -


----------



## windracer

Just rename it to be config.ini and put it in the main folder where you have HME for Python installed (one level up from vidmgr). You only need to "merge" that info if you have an existing config.ini file.


----------



## jbernardis

windracer said:


> Just rename it to be config.ini and put it in the main folder where you have HME for Python installed (one level up from vidmgr). You only need to "merge" that info if you have an existing config.ini file.


Be aware though - if you are running without a config.ini, that means it is simply running All apps that it finds. If you want this to continue, make sure you do NOT have an apps line in the config file - if you do, then pyhme will run ONLY the named apps.


----------



## jbernardis

Version 0.5b is now on git. 

I added the following:

- thumbnails are now displayed for shares as well as for directories. The same rules - just put folder.jpg in the root of the share or in a .meta directory that lives there.

- added "metaspace=" to the config file to indicate if a blank line should be added to the display after the named metadata items. The default is an empty list.

- added "infolabelpercent=" to config file to specify the width of the label on the info screen. This value should be expressed as a percent. The default value is 30, but I have found that 20 works OK for HD screens


----------



## jbernardis

lrhorer said:


> Could you see your way to program a paged jump based on a number press? Thus, pressing the 1 button would take the user 1/10th the way down the current list, 2 will take the user 2/10s down the list, etc? With some of these shares and share folders having titles numbering in the hundreds and even the thousands, being able to jump only to the beginning the end, or up / down 14 titles doesn't really cut it, sometimes.
> 
> (I don't suppose we could get more than 14 titles on the screen?)


Great idea - I never thought about it with my directories having at most 15 or 20 videos. It should be easy to do - let me think about it for a bit. I may call on you to do some testing since you have such huge directories.

I think 14 is as many as we're going to see with the current layout.


----------



## lrhorer

rrr22777 said:


> Where do I put the contents of config.merge? I dont have config.ini. Running everything on linux.
> 
> ERRORyTivo:hmeserver - 'type'
> ERRORyTivoytivos - 'type'
> ERRORyTivo:tivos - 'type'
> ERRORyTivo:vidmgr - 'type'
> INFOyTivo:192.168.0.250 [13/Jun/2011 13:10:10] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -


Silly web conference software... FYI, the software interprets the sequence ":" and then "p" as a smiley face. To avoid this, put such sequences in a code frame:



Code:


ERROR:pyTivo:hmeserver - 'type'
ERROR:pyTivo:pytivos - 'type'
ERROR:pyTivo:tivos - 'type'
ERROR:pyTivo:vidmgr - 'type'
INFO:pyTivo:192.168.0.250 [13/Jun/2011 13:10:10] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -[/QUOTE]


----------



## lrhorer

jbernardis said:


> Version 0.5b is now on git.


You are just too cool.


----------



## lrhorer

jbernardis said:


> Great idea - I never thought about it with my directories having at most 15 or 20 videos.


My largest has 1893 and counting. 

Now that you mention, it (OK, OK, I mentioned it), is there any code optimization that could take place when writing the cache? The first time one enters a large directory, it takes quite a while - nearly a minute.



jbernardis said:


> It should be easy to do - let me think about it for a bit. I may call on you to do some testing since you have such huge directories.


Of course! I'd be more than happy to help with development testing. You can PM me or I can provide you with FTP access to my main website.



jbernardis said:


> I think 14 is as many as we're going to see with the current layout.


Yeah, I figured. It would proabbly require a smaller font. I also personally don't care about the safe zone, but both could be problematical for people with smaller, less "overscanned" TVs, and you need to consider that. Of course, providing a user-defined variable that allows the user to break the rules would be a reasonable compromise, but it also probably means a headache for the developer. That would be you. 

It never hurts to ask, though.


----------



## lrhorer

Something's wrong with the git. The download never happens.


----------



## jbernardis

lrhorer said:


> Something's wrong with the git. The download never happens.


You're right - I think it must be their site, I was able to retrieve it just fine with firefox though - just IE gave me problems


----------



## jbernardis

lrhorer said:


> Now that you mention, it (OK, OK, I mentioned it), is there any code optimization that could take place when writing the cache? The first time one enters a large directory, it takes quite a while - nearly a minute.


I have to think about a caching method. I made a conscious decision early that I was going to treat the directories as volatile information; I do no real caching in the program - hme provides a bit, but I simply read the entire directory every time I enter it. Perhaps it's faster the second time because of hme and/or os caching.

This will be a tough one.


----------



## cweb

Can I use video manager with my OSX Pytivo installation?


----------



## jbernardis

cweb said:


> Can I use video manager with my OSX Pytivo installation?


I know nothing about the MAC environment, and I have no way to test there, but it's simple python code. If hme for python runs there I see no reason why this wouldn't as well. Give it a try and let us know. We could probably even resolve simple issues by working together on it.


----------



## lrhorer

jbernardis said:


> - added "metaspace=" to the config file to indicate if a blank line should be added to the display after the named metadata items.


One tiny bug, here. If I have



Code:


metafirst = title seriesTitle episodeTitle movieYear vWriter vDirector description
metaspace = vDirector description vActor

Things lay out the way I want as long as the metafile has vDirector fields, but some of the metafiles don't have that field. Would it be possible to do a Boolean, something like:



Code:


metafirst = title seriesTitle episodeTitle movieYear vWriter vDirector description
metaspace = movieYear+vWriter+vDirector description vActor

That way a newline will be added after whichever the last of the 3 which exists in the metafile.



jbernardis said:


> - added "infolabelpercent=" to config file to specify the width of the label on the info screen. This value should be expressed as a percent. The default value is 30, but I have found that 20 works OK for HD screens


A value of 15% seems to work fine, here, with a font size of 20. I may increase the font size a bit, though, to make it nicer for the folks in the back row.


----------



## lrhorer

cweb said:


> Can I use video manager with my OSX Pytivo installation?


No, it's not allowed on a Mac. The state computing police will come haul you away. 

Give it a shot. If you have pyHME working, the rest is a breeze. If you have to set up pyHME, it's still not really very difficult.


----------



## jbernardis

lrhorer said:


> One tiny bug, here. If I have
> 
> 
> 
> Code:
> 
> 
> metafirst = title seriesTitle episodeTitle movieYear vWriter vDirector description
> metaspace = vDirector description vActor
> 
> Things lay out the way I want as long as the metafile has vDirector fields, but some of the metafiles don't have that field. Would it be possible to do a Boolean, something like:
> 
> 
> 
> Code:
> 
> 
> metafirst = title seriesTitle episodeTitle movieYear vWriter vDirector description
> metaspace = movieYear+vWriter+vDirector description vActor
> 
> That way a newline will be added after whichever the last of the 3 which exists in the metafile.
> 
> A value of 15% seems to work fine, here, with a font size of 20. I may increase the font size a bit, though, to make it nicer for the folks in the back row.


I anticipated this issue. I was actually thinking of doing it this way:
I would have two config file options metaspace would become metaspaceafter and work as it does now, and metaspacebefore would put a space before - but the logic would never put out 2 consecutive spaces


----------



## lrhorer

jbernardis said:


> You're right - I think it must be their site, I was able to retrieve it just fine with firefox though - just IE gave me problems


Hmm. It works here under IceWeasel, but not FireFox.


----------



## lrhorer

jbernardis said:


> I anticipated this issue. I was actually thinking of doing it this way:
> I would have two config file options metaspace would become metaspaceafter and work as it does now, and metaspacebefore would put a space before - but the logic would never put out 2 consecutive spaces


That would work.


----------



## jbernardis

lrhorer:

I have attached a new __init__.py (I had to rename it to .txt). This is not released yet and has not been thoroughly tested. This has both the key based paging mechanism you described as well as the new metaspacebefore and metaspaceafter that was discussed. metaspaceafter is a synonym for metaspace in the config.ini file.

Give it a try and let me know. I'll release it after you get back to me.


----------



## lrhorer

jbernardis said:


> I have to think about a caching method. I made a conscious decision early that I was going to treat the directories as volatile information; I do no real caching in the program - hme provides a bit, but I simply read the entire directory every time I enter it. Perhaps it's faster the second time because of hme and/or os caching.


OS - level caching would be my guess, or actually more likely the hard drives. I also tried decreasing the nice value of the Python process, and, qualitatively, it seemed to help some. I need to do some more rigorous testing to be sure.



jbernardis said:


> This will be a tough one.


Yeah, and I can understand if you are reticent to spend a lot of resources on it.


----------



## jbernardis

lrhorer said:


> OS - level caching would be my guess, or actually more likely the hard drives. I also tried decreasing the nice value of the Python process, and, qualitatively, it seemed to help some. I need to do some more rigorous testing to be sure.
> 
> Yeah, and I can understand if you are reticent to spend a lot of resources on it.


The main issue as I see it is that these are short-lived processes - not like pytivo that is resident at all times. The work of accessing the disk has to be done - and there is no improving the response time the first time it runs, caching will be helpful if I could somehow retain this information from run to run. But then I couldn't take it at faith - I'd still need to verify that the cache was accurate.

All I'm really doing is processing the directory (except for loading of thumbnails). I'm not sure how much I'd save by only needing to verify the cache contents.

I'm going to give this some thought - I'm not ruling it out entirely. I just wanted you to know that you weren't going to get a response in an hour like has been the norm


----------



## wmcbrine

They're only threads, not processes. You can store common info at the class level, or the module level. This is how I do two-player games in Reversi. pyTivo actually works in a similar way, even though it's not HME.


----------



## lrhorer

jbernardis said:


> lrhorer:
> 
> I have attached a new __init__.py (I had to rename it to .txt). This is not released yet and has not been thoroughly tested. This has both the key based paging mechanism you described as well as the new metaspacebefore and metaspaceafter that was discussed. metaspaceafter is a synonym for metaspace in the config.ini file.
> 
> Give it a try and let me know. I'll release it after you get back to me.


Seems to be working perfectly, both the number jump and the metaspacebefore directive.

I almost never use the numeric buttons on my remote. Now I'll start using them!


----------



## jbernardis

wmcbrine said:


> They're only threads, not processes. You can store common info at the class level, or the module level. This is how I do two-player games in Reversi. pyTivo actually works in a similar way, even though it's not HME.


I understand that they're threads. I guess what it boils down to is if I exit to live TV and come back into the app, is there any memory of the previous instantiation.

I noticed that the "mainline" code - code outside of any classes or subroutines - executes at import time, but I would think there is very little I could do here - certainly nothing with any of the HME classes. I assume this is what you are referring to as module-level. I would guess that I could create some empty data structures at this level, and then fill them in as I traverse directories while within the app. They would then be available for subsequent invocations.


----------



## jbernardis

lrhorer said:


> Seems to be working perfectly, both the number jump and the metaspacebefore directive.
> 
> I almost never use the numeric buttons on my remote. Now I'll start using them!


Thanks much - I'll package it up and get it up on git.


----------



## jbernardis

OK - Version 0.5c with the above described features is now available at git


----------



## rrr22777

jbernardis said:


> Be aware though - if you are running without a config.ini, that means it is simply running All apps that it finds. If you want this to continue, make sure you do NOT have an apps line in the config file - if you do, then pyhme will run ONLY the named apps.


Should I see something in the pytivo log after I add this?



Code:


[[email protected] pytivo]# ls
beacon.py     hdphotos.jnlp   mind.pyc     pyTivo.conf.dist        vidmgr
beacon.pyc    httpserver.py   mutagen      pyTivoConfigurator.pyw  xmpp
Cheetah       httpserver.pyc  nohup.out    pyTivo.py               Zeroconf.py
config.ini    lrucache.py     plugin.py    pyTivoService.py        Zeroconf.pyc
config.merge  lrucache.pyc    plugin.pyc   README
config.py     metadata.py     plugins      stager.py
config.pyc    metadata.pyc    PYCC.pf      stager.pyc
content       mind.py         pyTivo.conf  templates
[[email protected] pytivo]# cat config.ini
[vidmgr]
exts=.mpg .mp4 .avi .wmv .m4v
descsize=16

[tivos]
tivo1.name=Family Room
tivo1.tsn=748-0001-902C-E861


[pytivos]
pytivo1.config=pyTivo.conf
pytivo1.ip=192.168.0.100
pytivo1.port=9032
pytivo1.sep=/
[[email protected] pytivo]# python /u03/samba/HMO/pytivo/pyTivo.py
INFO:pyTivo.beacon:Announcing shares...
INFO:pyTivo.beacon:Registering: MyMovies
INFO:pyTivo.beacon:Registering: MyMusic
INFO:pyTivo.beacon:Registering: MyPhotos
INFO:pyTivo.beacon:Scanning for TiVos...
INFO:pyTivo:pyTivo is ready.
INFO:pyTivo:192.168.0.250 [14/Jun/2011 16:10:17] "GET /TiVoConnect?Command=QueryContainer&Container=%2F&DoGenres=1 HTTP/1.0" 200 -


----------



## lrhorer

rrr22777 said:


> Should I see something in the pytivo log after I add this?


No, this doesn't run under pyTivo. It runs under HME for Python. It looks to me like you put the code in the wrong directory and modified the wrong config file. Well, sort of.

pyTivo:


Code:


RAID-Server:/usr/share/pyTivo# ls
alphagroup  Cheetah     content    httpserver.py       __init__.py   metadata.py   mind.pyc   plugin.pyc  pyTivo            pyTivoConfigurator.pyw  README      xmpp
beacon.py   config.py   dategroup  httpserver.pyc      lrucache.py   metadata.pyc  mutagen    plugins     pyTivo.conf       pyTivo.py               templates   Zeroconf.py
beacon.pyc  config.pyc  eyeD3      httpserver.py.orig  lrucache.pyc  mind.py       plugin.py  pyshares    pyTivo.conf.dist  pyTivoService.py        Unverified  Zeroconf.pyc
RAID-Server:/usr/share/pyTivo# cat pyTivo.conf
[RAID Server]
force_alpha = True
type = video
path = /RAID/Recordings

[_tivo_SD]

[_tivo_00000DEADBEEF]

[Server]
tivo_password = xxxxxxxxxxx
tivo_mak = yyyyyyyyyy
ffmpeg = /usr/bin/ffmpeg
togo_path = /RAID/Server-Main/Movies/TiVo_TS
debug = True
tivo_username = zzzzzzzzz
port = 9032

[_tivo_HD]

[Videos by Genre]
force_alpha = True
type = video
path = /usr/share/pyTivo/pyshares

[Group by Alpha]
force_alpha = True
type = video
path = /usr/share/pyTivo/alphagroup

[Unverified]
type = video
path = /usr/share/pyTivo/Unverified

[DVD]
path = /RAID/DVD
force_alpha = True
type = dvdvideo
fast_index = true

[Videos by Date]
force_alpha = True
type = video
path = /usr/share/pyTivo/dategroup

pyHME:


Code:


RAID-Server:/usr/share/pyhme# ls
config.ini  hme.py  hme.pyc  pyHME  start.py  vidmgr  Zeroconf.py  Zeroconf.pyc
RAID-Server:/usr/share/pyhme# cat config.ini 
[hmeserver]
apps=vidmgr

[vidmgr]
exts=.mpg .mp4 .avi .wmv .m4v
descsize=20
sort=file
skin=local
deleteallowed=false
metafirst = title seriesTitle episodeTitle movieYear vDirector vWriter description
metaspaceafter = vWriter description vActor
metaspacebefore = description vActor
infolabelpercent = 15
metaignore = isEpisode isEpisodic showingBits displayMajorNumber

[tivos]
tivo1.name=LivingRoom
tivo1.tsn=###-####-####-####
tivo2.name=Theater
tivo2.tsn=###-####-####-####
tivo3.name=TiVoHD
tivo3.tsn=###-####-####-####


[pytivos]
pytivo1.config=/usr/share/pyTivo/pyTivo.conf
pytivo1.ip=192.168.1.50
pytivo1.port=9032
pytivo1.sep=/

And looking at the servers:


Code:


RAID-Server:/usr/share/pyhme# ps -ef | grep py
root     13245     1  0 Jun13 pts/1    00:01:21 /usr/bin/python2.6 /usr/share/pyhme/start.py
root     14763     1  0 10:03 pts/1    00:00:42 /usr/bin/python2.6 /usr/share/pyTivo/pyTivo.py /dev/null

Except when pushing a video, the output will be from pyHME, not pyTivo. It will look someting like this:



Code:


RAID-Server:/usr/share/pyhme# cat /var/log/pyhme.log 
192.168.1.101:4119 - - [13/Jun/2011 23:21:23] "GET /vidmgr/icon.png HTTP/1.0" 200 -
192.168.1.102:1762 - - [13/Jun/2011 23:24:34] "GET /vidmgr/icon.png HTTP/1.0" 200 -
192.168.1.102:1801 - - [13/Jun/2011 23:24:47] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.102:1801 - - [13/Jun/2011 23:24:47] Starting HME: vidmgr
192.168.1.102:1801 - - [13/Jun/2011 23:29:27] Ending HME: vidmgr
192.168.1.102:1802 - - [13/Jun/2011 23:29:43] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.102:1802 - - [13/Jun/2011 23:29:43] Starting HME: vidmgr
192.168.1.102:1802 - - [13/Jun/2011 23:41:28] Ending HME: vidmgr
192.168.1.102:1807 - - [13/Jun/2011 23:41:31] "GET /vidmgr/icon.png HTTP/1.0" 200 -
192.168.1.102:1846 - - [13/Jun/2011 23:41:35] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.102:1846 - - [13/Jun/2011 23:41:35] Starting HME: vidmgr
192.168.1.102:1846 - - [13/Jun/2011 23:49:23] Ending HME: vidmgr
192.168.1.102:1856 - - [14/Jun/2011 00:59:53] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.102:1856 - - [14/Jun/2011 00:59:53] Starting HME: vidmgr
192.168.1.102:1856 - - [14/Jun/2011 01:00:37] Ending HME: vidmgr
192.168.1.102:1860 - - [14/Jun/2011 01:00:38] "GET /vidmgr/icon.png HTTP/1.0" 200 -
192.168.1.102:1899 - - [14/Jun/2011 01:00:44] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.102:1899 - - [14/Jun/2011 01:00:44] Starting HME: vidmgr
192.168.1.102:1899 - - [14/Jun/2011 01:04:20] Ending HME: vidmgr
192.168.1.102:1942 - - [14/Jun/2011 01:25:02] "GET /vidmgr/icon.png HTTP/1.0" 200 -
192.168.1.102:1982 - - [14/Jun/2011 01:25:15] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.102:1982 - - [14/Jun/2011 01:25:15] Starting HME: vidmgr
192.168.1.102:1982 - - [14/Jun/2011 01:29:26] Ending HME: vidmgr
192.168.1.102:1983 - - [14/Jun/2011 01:30:07] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.102:1983 - - [14/Jun/2011 01:30:07] Starting HME: vidmgr
192.168.1.102:1983 - - [14/Jun/2011 01:35:31] Ending HME: vidmgr
192.168.1.101:4234 - - [14/Jun/2011 10:29:46] "GET /vidmgr/icon.png HTTP/1.0" 200 -
192.168.1.101:4273 - - [14/Jun/2011 10:30:05] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.101:4273 - - [14/Jun/2011 10:30:05] Starting HME: vidmgr
192.168.1.101:4273 - - [14/Jun/2011 10:30:21] Ending HME: vidmgr
192.168.1.101:4278 - - [14/Jun/2011 10:30:22] "GET /vidmgr/icon.png HTTP/1.0" 200 -

rather than the output from pyTivo:


Code:


RAID-Server:/usr/share/pyhme# more /var/log/pyTivo.log 
INFO:pyTivo.beacon:Announcing shares...
INFO:pyTivo.beacon:Registering: DVD
INFO:pyTivo.beacon:Registering: Group by Alpha
INFO:pyTivo.beacon:Registering: RAID Server
INFO:pyTivo.beacon:Registering: Unverified
INFO:pyTivo.beacon:Registering: Videos by Date
INFO:pyTivo.beacon:Registering: Videos by Genre
INFO:pyTivo.beacon:Scanning for TiVos...
INFO:pyTivo.beacon:HD Theater
INFO:pyTivo.beacon:HD Livingroom
INFO:pyTivo:pyTivo is ready.
INFO:pyTivo:192.168.1.102 [14/Jun/2011 10:03:37] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
INFO:pyTivo:192.168.1.101 [14/Jun/2011 10:03:37] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:04:37] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:11:15] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:11:16] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:11:16] "GET /TiVoConnect?Command=QueryContainer&Container=%2F HTTP/1.0" 200 -
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:11:24] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
DEBUG:pyTivo.dvdvideo:mobileagent: -1 useragent: tvhttpclient
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:11:24] "GET /TiVoConnect?Command=QueryContainer&Container=DVD&SortOrder=!CaptureDate&ItemCount=8&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-
mpeg,video%2F* HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:11:28] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
DEBUG:pyTivo.dvdvideo:mobileagent: -1 useragent: tvhttpclient
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:11:28] "GET /TiVoConnect?Command=QueryContainer&Container=DVD%2F39%20Steps&SortOrder=!CaptureDate&ItemCount=8&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,vi
deo%2Fx-tivo-mpeg,video%2F* HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.103 [14/Jun/2011 10:11:33] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
DEBUG:pyTivo.video.transcode:starting ffmpeg, will wait 10 seconds for it to complete
DEBUG:pyTivo.video.transcode:ffmpeg output=FFmpeg version SVN-r25838, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jan 21 2011 08:21:58 with gcc 4.4.5
  configuration: --enable-libdc1394 --prefix=/usr --extra-cflags='-Wall -g ' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --en
able-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-avfilter --enable
-libdirac --disable-decoder=libdirac --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-libvpx --enable-librtmp --extra-libs=-lgcrypt --disable-altivec --disable-
armv5te --disable-armv6 --disable-vis
  libavutil     50.33. 0 / 50.33. 0
  libavcore      0.14. 0 /  0.14. 0
  libavcodec    52.97. 2 / 52.97. 2
  libavformat   52.87. 1 / 52.87. 1
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.65. 0 /  1.65. 0
  libswscale     0.12. 0 /  0.12. 0
  libpostproc   51. 2. 0 / 51. 2. 0
pipe:: Invalid data found when processing input


----------



## orangeboy

Hooray for DEAD BEEF! It's fun to spell in Hex.


----------



## lrhorer

Damn! I keep forgetting the pyTivo.conf file has some modestly sensitive information in it.


----------



## rrr22777

lrhorer said:


> ...


Thank you for the example. Got things working well except this error when trying to browse.



Code:


[[email protected] pyhme]# python start.py
HME Server for Python 0.19
Tue Jun 14 19:31:19 2011 Server Starts
Registering: vidmgr
192.168.0.250:37550 - - [14/Jun/2011 19:31:25] "GET /vidmgr/icon.png HTTP/1.0" 200 -
192.168.0.250:37551 - - [14/Jun/2011 19:31:28] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.0.250:37551 - - [14/Jun/2011 19:31:28] Starting HME: vidmgr
----------------------------------------
Exception happened during processing of request from ('192.168.0.250', 37551)
Traceback (most recent call last):
  File "/usr/lib64/python2.6/SocketServer.py", line 560, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib64/python2.6/SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "start.py", line 141, in __init__
    client_address, server)
  File "/usr/lib64/python2.6/SocketServer.py", line 617, in __init__
    self.handle()
  File "/usr/lib64/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/usr/lib64/python2.6/BaseHTTPServer.py", line 323, 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 "/u03/samba/HMO/pyhme/hme.py", line 1139, in mainloop
    while self.active and self.get_event():
  File "/u03/samba/HMO/pyhme/hme.py", line 1192, in get_event
    handle(keynum, rawcode)
  File "/u03/samba/HMO/pyhme/vidmgr/__init__.py", line 314, in handle_key_press
    self.handle_key_pressList(keynum, rawcode)
  File "/u03/samba/HMO/pyhme/vidmgr/__init__.py", line 463, in handle_key_pressList
    self.drawScreen()
  File "/u03/samba/HMO/pyhme/vidmgr/__init__.py", line 761, in drawScreen
    self.drawScreenDetail()
  File "/u03/samba/HMO/pyhme/vidmgr/__init__.py", line 896, in drawScreenDetail
    if self.listing[self.indexDetail]['thumb']:
IndexError: list index out of range
----------------------------------------


----------



## orangeboy

lrhorer said:


> Damn! I keep forgetting the pyTivo.conf file has some modestly sensitive information in it.


As does pyHME...


----------



## jbernardis

rrr22777 said:


> Thank you for the example. Got things working well except this error when trying to browse.
> 
> 
> 
> Code:
> 
> 
> [[email protected] pyhme]# python start.py
> HME Server for Python 0.19
> Tue Jun 14 19:31:19 2011 Server Starts
> Registering: vidmgr
> 192.168.0.250:37550 - - [14/Jun/2011 19:31:25] "GET /vidmgr/icon.png HTTP/1.0" 200 -
> 192.168.0.250:37551 - - [14/Jun/2011 19:31:28] "GET /vidmgr/ HTTP/1.1" 200 -
> 192.168.0.250:37551 - - [14/Jun/2011 19:31:28] Starting HME: vidmgr
> ----------------------------------------
> Exception happened during processing of request from ('192.168.0.250', 37551)
> Traceback (most recent call last):
> File "/usr/lib64/python2.6/SocketServer.py", line 560, in process_request_thread
> self.finish_request(request, client_address)
> File "/usr/lib64/python2.6/SocketServer.py", line 322, in finish_request
> self.RequestHandlerClass(request, client_address, self)
> File "start.py", line 141, in __init__
> client_address, server)
> File "/usr/lib64/python2.6/SocketServer.py", line 617, in __init__
> self.handle()
> File "/usr/lib64/python2.6/BaseHTTPServer.py", line 329, in handle
> self.handle_one_request()
> File "/usr/lib64/python2.6/BaseHTTPServer.py", line 323, 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 "/u03/samba/HMO/pyhme/hme.py", line 1139, in mainloop
> while self.active and self.get_event():
> File "/u03/samba/HMO/pyhme/hme.py", line 1192, in get_event
> handle(keynum, rawcode)
> File "/u03/samba/HMO/pyhme/vidmgr/__init__.py", line 314, in handle_key_press
> self.handle_key_pressList(keynum, rawcode)
> File "/u03/samba/HMO/pyhme/vidmgr/__init__.py", line 463, in handle_key_pressList
> self.drawScreen()
> File "/u03/samba/HMO/pyhme/vidmgr/__init__.py", line 761, in drawScreen
> self.drawScreenDetail()
> File "/u03/samba/HMO/pyhme/vidmgr/__init__.py", line 896, in drawScreenDetail
> if self.listing[self.indexDetail]['thumb']:
> IndexError: list index out of range
> ----------------------------------------


Do you see anything on the TV before this message? What is in the directory you are currently in? Can you give me a dierctory listing?


----------



## jbernardis

I have a new version out on git that addressed some of the concerns of lrhorer. This is version 0.5d. The changes are:
Version 0.5d 6/14/11
- added logic to load thumbnails just in time rather than ahead of time. This speeds up initial painting of a page, but slows down navigation within the page. Beacuse of this, 
- I added an image cache to speed up image processing. This is just an in-memory cache, but if you exit the app cleanly - by hitting left all the way out - the cache is saved to disk for future runs. The cache quickly got too big to save to disk with every change, so this was a compromise
- added logic to scale the thumbnail to fit in the 320 pixel wide view frame. Thanks to wmcbrine for the picture sample hme app that told me how to do this. A side effect of this - you need to have the python image lib (PIL) installed. Just google PIL and you will find links for the version of python you have installed.

I am a bit concerned over the size the cache can grow to - so I'd be interested if lrhorer could give me his experience with this. I might have to implement something that limits the size of the cache.

I could also provide a tool to generate the cache ahead of time if there is interest in that. Right now, there is a little sluggishness the first time you load an image, but once it's in the cache, things are snappier. If you pre-create the cache, you avoid this first time pain.


NOTE there is a new py file (thumbcache.py) in the vidmgr directory.


----------



## lrhorer

orangeboy said:


> As does pyHME...


What, the TSNs? Are those sensitive?


----------



## lrhorer

jbernardis said:


> I have a new version out on git that addressed some of the concerns of lrhorer. This is version 0.5d. The changes are:
> Version 0.5d 6/14/11


It's not on the git, yet. Did you upload it? Also, the download is still not working here in FireFox. It works for IceWeasel.


----------



## wmcbrine

jbernardis said:


> I might have to implement something that limits the size of the cache.


pyTivo uses the lrucache module for this purpose.


----------



## jbernardis

lrhorer said:


> It's not on the git, yet. Did you upload it? Also, the download is still not working here in FireFox. It works for IceWeasel.


Sorry about this everybody - I guess I was tired last night. Apparently I forgot to upload to git. I THOUGHT I had done so. I am at work and do not have the latest code with me - it will have to wait until this evening.


----------



## jbernardis

wmcbrine said:


> pyTivo uses the lrucache module for this purpose.


I was thinking of some kind of LRU algorithm, but I didn't realize python has one already. I need to explore the modules more.

I also need to explore how to make the cache threadsafe. Since the cache exists at the module level, there could potentially be multiple threads using it. I assume python has some kind of mutex mechanism.


----------



## jbernardis

rrr22777 said:


> Thank you for the example. Got things working well except this error when trying to browse.


rrr22777 - I'm just looking a bit closer at the code, and I think I know what happened. I just want to make sure my assumptions are accurate:

Since it appears you are new to pytivo also, I guessed that 1) you have no videos in your shares, and 2) you only have a single share.

I think I see where the logic falls apart in that case. In that situation, there is basically nothing for the app to do - there is nothing to navigate. I can test that tonight - I already know how to fix it, and if I am right, I will post the fix with the release I apparently forgot to upload last night.


----------



## orangeboy

lrhorer said:


> What, the TSNs? Are those sensitive?


Hmm... Good question. But yes, that's what I was referring to. There's been some discussion about disclosing one's TSN publicly, but really no examples of what another could do with such a TSN.

Apologies for meandering off-topic.


----------



## rrr22777

jbernardis said:


> rrr22777 - I'm just looking a bit closer at the code, and I think I know what happened. I just want to make sure my assumptions are accurate:
> 
> Since it appears you are new to pytivo also, I guessed that 1) you have no videos in your shares, and 2) you only have a single share.
> ...


Long time pytivo user. Also use streambaby but pytivo never crashes while steambaby does on some videos. Both are running on the same computer with the same ffmpeg binary.

As for pytivo only 1 video share but about 50 folders in that share with videos in various formats. Gives me an error saying it cannot transfer on all videos but only crashes on some foldesr. I am mostly looking into this app for the delete functionality. Can the ability to just initiate a regular download to tivo be added if the video does to conform to the right standard?

I can upload more debug info when I get home if you would like. 100% with the poster that said Tivo needs to learn a few things about how to display its NPL based on this app.


----------



## jbernardis

It's interesting that it only crashes on some folders. This app does not process the files at all - it makes push requests to pytivo through its HTTP interface. All my app does, basically, is process directories and read some metadata information.

Whatever info you can get to me would be beneficial - particularly the contents of the directories that crash. I think for some reason my app thinks you have an empty directory but yet it is continuing to process it. I can't figure out why.

Also, do you know what version you are running? I just added a print statement at startup that displays the version number, but this wasn't in early versions. The version number is up near the top of the __init__.py file.


----------



## jbernardis

This time I made certain of my posting - version 0.5d is definitely on git. It's probably best that this was delayed a day because I was able to address the concerns I mentioned yesterday. I now use LRU logic to maintain the last X images in memory. X is initially set to 100. It's currently not configurable because the cache is initialize at module import time and "normal" access to the config file is unavailable. I can parse the file myself if we find we need to be able to tune this parameter.

I limited it to 100 because I was concerned about memory use - especially on my system (which is my readynas server). Since the cache is maintained at the module level, I needed to add mutex protection; however, this also means that the cache will be maintained from one usage to the next. In addition to this, if you exit the app cleanly - by hitting left all the way out, the cache will be written to disk - so it will survive a stop/restart of the server (although the lru ordering will not survive a restart)

Overall, I'm not 100% on board with the cache. I think we gained sufficient performance gain my loading the images just in time rather that in advance. I think the marginal gain realized by the cache might not be worth the processing required. But again, we'll see how it goes.

rr22777:

I definitely found a hole in the logic that would have caused the exact problem you saw. Frankly I'm surprised it hasn't surfaced before now. Try this version and see if it solves your problem.

Version 0.5d 6/15/11
- added logic to load thumbnails just in time rather that ahead of time. This speeds up initial painting
of a page, but slows down navigation within the page. Beacuse of this, 
- I added an image cache. If you exit the app cleanly - by hitting left all the way out - the cache is saved to disk
for future runs. The cache got too big to save to disk with every change, so this was a compromise. The cache uses lru
logic to keep the last X used images in memory. I had to choose some kind of limit here - I chose 100 for now - we'll
see how that works out. Also, the cache exists at the module level, but yet is accessed, and possible changed, at the
HME thread level. Because of this, I had to mutex exclusion around parts of the cache logic.
- added logic to scale the thumbnail to fit in the 320 pixel wide view frame. Thanks to wmcbrine for the picture
sample hme app that told me how to do this. Side effect of this - you need to have the python image lib (PIL) installed
- widened the right hand margin on the info page a bit


----------



## lrhorer

jbernardis said:


> This time I made certain of my posting - version 0.5d is definitely on git. It's probably best that this was delayed a day because I was able to address the concerns I mentioned yesterday. I now use LRU logic to maintain the last X images in memory. X is initially set to 100. It's currently not configurable because the cache is initialize at module import time and "normal" access to the config file is unavailable. I can parse the file myself if we find we need to be able to tune this parameter.


Ooh. That's definitely much, much faster ( ~3 seconds vs. 39 seconds on an 800+ video share ), and the cache code seems to be working just fine, but the PIL code has introduced a bug. A large number of the .jpg files in my shares are still 0 bytes in length. (They are place-holders.) Whenever I try to select one of the videos whose thumbnail is 0 bytes in length, vidmgr locks up. I can exit the app in the TiVo by pressing the <TiVo> button (the left arrow does not work), but if I enter vidmgr again, it is still locked up. I have to restart pyHME to get it working again. I'm still working on getting thumbnails for all my videos, but at this point in time, nearly half are still 0 bytes.



Code:


Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 560, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/share/pyhme/start.py", line 141, in __init__
    client_address, server)
  File "/usr/lib/python2.6/SocketServer.py", line 617, in __init__
    self.handle()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 323, in handle_one_request
    method()
  File "/usr/share/pyhme/start.py", line 232, in do_GET
    self._page(True)
  File "/usr/share/pyhme/start.py", line 186, 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 322, in handle_key_press
    self.handle_key_pressList(keynum, rawcode)
  File "/usr/share/pyhme/vidmgr/__init__.py", line 469, in handle_key_pressList
    self.drawScreen()
  File "/usr/share/pyhme/vidmgr/__init__.py", line 768, in drawScreen
    self.drawScreenDetail()
  File "/usr/share/pyhme/vidmgr/__init__.py", line 942, in drawScreenDetail
    self.listing[self.indexDetail]['name'])
  File "/usr/share/pyhme/vidmgr/__init__.py", line 1424, in getThumb
    data = tc.getImageData(tfn)
  File "/usr/share/pyhme/vidmgr/thumbcache.py", line 129, in getImageData
    self.cache[filename]['data'] = resizePic(filename, self.width, self.height)
  File "/usr/share/pyhme/vidmgr/thumbcache.py", line 17, in resizePic
    pic = img.open(fn)
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1980, in open
    raise IOError("cannot identify image file")
IOError: cannot identify image file


----------



## jbernardis

lrhorer said:


> Ooh. That's definitely much, much faster ( ~3 seconds vs. 39 seconds on an 800+ video share ), and the cache code seems to be working just fine, but the PIL code has introduced a bug. A large number of the .jpg files in my shares are still 0 bytes in length. (They are place-holders.) Whenever I try to select one of the videos whose thumbnail is 0 bytes in length, vidmgr locks up. I can exit the app in the TiVo by pressing the <TiVo> button (the left arrow does not work), but if I enter vidmgr again, it is still locked up. I have to restart pyHME to get it working again. I'm still working on getting thumbnails for all my videos, but at this point in time, nearly half are still 0 bytes.


I can, and probably should, put a try block around that code. I'll get something out right away.

Great to hear the other changes are for the better.


----------



## lrhorer

jbernardis said:


> - added logic to scale the thumbnail to fit in the 320 pixel wide view frame. Thanks to wmcbrine for the picture
> sample hme app that told me how to do this. Side effect of this - you need to have the python image lib (PIL) installed


You weren't clear in your e-mails why increasing the width of the view frame would be an issue, but I would definitely still like to lobby for a wider view frame, if it is at all a reasonable thing to implement in code. In my opinion, there is absolutely no question that this










and this










are far more impressive on-screen than this










and this










There's plenty of screen real-estate to support these pictures.


----------



## lrhorer

jbernardis said:


> I can, and probably should, put a try block around that code. I'll get something out right away.


Thanks! I suspect non-zero length, but still invalid, files might also cause the problem.



jbernardis said:


> Great to hear the other changes are for the better.


Oh, they are, they are. You rock, man!


----------



## jbernardis

lrhorer said:


> You weren't clear in your e-mails why increasing the width of the view frame would be an issue, but I would definitely still like to lobby for a wider view frame, if it is at all a reasonable thing to implement in code. In my opinion, there is absolutely no question that this
> 
> and this
> 
> are far more impressive on-screen than this
> 
> and this
> 
> There's plenty of screen real-estate to support these pictures.


I don't dispute the quality of the pics, and it's really simple code to have a different size image. It's just a question of layout.

Right now, the entire left half of the screen is devoted to the various lists, the right half for details. The top of the right is for description, and the area to the right of the image is for the sub menu (push/delete) and the tivo menu.

In the meantime, 0.5e is on git with the try block


----------



## jbernardis

Would people rather have a landscape oriented view for thumbnails as opposed to the portrait one I have? I chose the present orientation because it is a good aspect ratio for DVD cover art, but I also know that people have been using video thumbnail maker, which would lend itself to landscape orientation. I'm willing to lay the screen out with a landscape orientation if that seems to be the concensus among users. Let me know.


----------



## lrhorer

jbernardis said:


> In the meantime, 0.5e is on git with the try block


It works just great. Thanks, yet again.


----------



## lrhorer

jbernardis said:


> Would people rather have a landscape oriented view for thumbnails as opposed to the portrait one I have? I chose the present orientation because it is a good aspect ratio for DVD cover art, but I also know that people have been using video thumbnail maker, which would lend itself to landscape orientation. I'm willing to lay the screen out with a landscape orientation if that seems to be the concensus among users. Let me know.


Almost all of my thumbnails are taken from cover art, and so approximate a portrait layout. There are a number of exceptions. In addition to the photos above, which are thumbnails taken from some slideshows I produced using my own photographs, there are the following, none of which are portrait aspects:










































My preference would be not to scale the images at all.


----------



## jbernardis

lrhorer said:


> Almost all of my thumbnails are taken from cover art, and so approximate a portrait layout. There are a number of exceptions. In addition to the photos above, which are thumbnails taken from some slideshows I produced using my own photographs, there are the following, none of which are portrait aspects:
> 
> My preference would be not to scale the images at all.


That's all fine, but I'm not really talking about scaling. In the HME model, I have to define rectangular areas of the screen (called views) into which I place resources (such as text or images). Now these views CAN overlap, but I have certain aspets of the screen that need to be visible. The bottom line is that I need to devote a retangular area of the screen to these images and I don't want it to overlap with any of the other "controls". The question is do you want that to be landscape or portrait.

As far as scaling, I can change the scaling so that it only scales DOWN if images are too big. Aspect ratio will always be maintained.


----------



## lrhorer

jbernardis said:


> I don't dispute the quality of the pics, and it's really simple code to have a different size image. It's just a question of layout.
> 
> Right now, the entire left half of the screen is devoted to the various lists, the right half for details. The top of the right is for description, and the area to the right of the image is for the sub menu (push/delete) and the tivo menu.


That's a very reasonable argument. I counter, however, by pointing out that the user generally spends very little time with the sub-menu up. Most of the time is spent browsing the video list to decide which video(s) to transfer (or delete if the user has that funtion enabled - I don't). When the decision is made, the transfer is selected in a few moments and the user continues on browsing the list, or else exits vidmgr. As a test, I changed the view frame in your code to 600 pixels and selected a couple of shows to transfer. The small selection images dutifully popped up over the middle-ground photo for selection. It was not in the least objectionable, and the middle-ground photos were displayed in all their glory.

Of course, it is entirely your call, but my definite preference would be to allow the user to set / create whatever size and aspect he wanted for each individual photo, and have the system simply crop the picture (the way your code did originally) and not worry about the aspect. Even with thumbnails that are more nearly portrait aspect, re-sizing them produces some unpleasant results. That, and 444 pixels is too large for the height, IMO. It causes the photos to protrude down below the title frame, which causes the screen to look lopsided.


----------



## jbernardis

lrhorer said:


> That's a very reasonable argument. I counter, however, by pointing out that the user generally spends very little time with the sub-menu up. Most of the time is spent browsing the video list to decide which video(s) to transfer (or delete if the user has that funtion enabled - I don't). When the decision is made, the transfer is selected in a few moments and the user continues on browsing the list, or else exits vidmgr. As a test, I changed the view frame in your code to 600 pixels and selected a couple of shows to transfer. The small selection images dutifully popped up over the middle-ground photo for selection. It was not in the least objectionable, and the middle-ground photos were displayed in all their glory.
> 
> Of course, it is entirely your call, but my definite preference would be to allow the user to set / create whatever size and aspect he wanted for each individual photo, and have the system simply crop the picture (the way your code did originally) and not worry about the aspect. Even with thumbnails that are more nearly portrait aspect, re-sizing them produces some unpleasant results. That, and 444 pixels is too large for the height, IMO. It causes the photos to protrude down below the title frame, which causes the screen to look lopsided.


We're both responding at the same time and our responses are criss-crossing 

SO you're saying that when you made the view for the thumbnails the full width of the screen, that the submenus overlapping the image was not objectionable.

Actually looking at the code, it's only because I defined the thumbnail view BEFORE the submenu views that the submenu was even visible. But that''s OK - we can take advantage of that fact, even though that's not why it was done like this.

If I do this, It would remove the PIL dependency and quicken the response time a bit when navigating because there is less image processing going on. At the same time, it allows for more dramatic thumbnails as you showed.

Ok - you convinced me - but I need to unplug for a while - maybe tomorrow 

Back when I had to be convinced that I should share this app, the argument was made that the community would help make it better. If it was just me using it, I would have been happy with the SD text-based version. Looking back over the past couple of weeks, I'd have to say this has been a great ride. I'd glad so many people are enjoying using this app. I just hope that it eventually settles down to where it changes a little less often.


----------



## lrhorer

jbernardis said:


> That's all fine, but I'm not really talking about scaling. In the HME model, I have to define rectangular areas of the screen (called views) into which I place resources (such as text or images). Now these views CAN overlap, but I have certain aspets of the screen that need to be visible.


That's clear.



jbernardis said:


> The bottom line is that I need to devote a retangular area of the screen to these images and I don't want it to overlap with any of the other "controls". The question is do you want that to be landscape or portrait.


That isn't. What's wrong with a control being on top of an image? Certainly all the controls are on top of the background image, so how is a middle-ground image so different? Fundamentally, what's wrong with this:










That's how it wound up looking - more or less - in my test.



jbernardis said:


> As far as scaling, I can change the scaling so that it only scales DOWN if images are too big. Aspect ratio will always be maintained.


I think that's better than stretching.


----------



## reneg

jbernardis said:


> Would people rather have a landscape oriented view for thumbnails as opposed to the portrait one I have? I chose the present orientation because it is a good aspect ratio for DVD cover art, but I also know that people have been using video thumbnail maker, which would lend itself to landscape orientation. I'm willing to lay the screen out with a landscape orientation if that seems to be the concensus among users. Let me know.


I prefer portrait as most of my files are tv series related and I've been pulling poster images from thetvdb.com which fits within your thumbnail boundaries.

Just an idea if I might offer up a possible alternative, in each directory (or video file) check for a backgroundHD file in the directory or filename.backgroundHD. That could give up to 1280x720 pixels for whatever image the user want.


----------



## lrhorer

jbernardis said:


> We're both responding at the same time and our responses are criss-crossing


Kind of like chat, isn't it.



jbernardis said:


> SO you're saying that when you made the view for the thumbnails the full width of the screen, that the submenus overlapping the image was not objectionable.


Yeah, see above. Another one of my criss-crossed mesages. 



jbernardis said:


> Actually looking at the code, it's only because I defined the thumbnail view BEFORE the submenu views that the submenu was even visible. But that''s OK - we can take advantage of that fact, even though that's not why it was done like this.


Serendipity.



jbernardis said:


> If I do this, It would remove the PIL dependency
> and quicken the response time a bit when navigating because there is less image processing going on. At the same time, it allows for more dramatic thumbnails as you showed.


Yeah the PIL issue doesn't really bother me - personally at least - since PIL is automatically included with my distro. I don't know about the Windows and Mac folks, or even other Linux distros. The image processing time is a little more of a philosophical concern, although on this system it's not objectionable. The last bit, obviously, pushes a button for me.



jbernardis said:


> Ok - you convinced me - but I need to unplug for a while - maybe tomorrow


Take all weekend, if you ask me. You deserve a break.



jbernardis said:


> Back when I had to be convinced that I should share this app, the argument was made that the community would help make it better. If it was just me using it, I would have been happy with the SD text-based version.


Yeah, for a guy who said he didn't want to develop or support the app, you are sure doing a good imitation of both. 



jbernardis said:


> Looking back over the past couple of weeks, I'd have to say this has been a great ride. I'd glad so many people are enjoying using this app.


We are. I hope it's been fun for you. On that note, are you accepting donations?



jbernardis said:


> I just hope that it eventually settles down to where it changes a little less often.


I think it will, quickly. Realize, too, that there is nothing forcing you to meet any schedule. If you want to delay implementing a feature, or even refuse to implement it altogether, you should not feel any compulsion to second guess yourself just because we want it. I figure you've got to be experiencing the onset of burn-out.


----------



## jbernardis

lrhorer said:


> Take all weekend, if you ask me. You deserve a break.


Actually - I had to see it for myself - it was really a trivial change - it's already on git as version 0.5f - is this a record yet?



lrhorer said:


> Yeah, for a guy who said he didn't want to develop or support the app, you are sure doing a good imitation of both.
> 
> We are. I hope it's been fun for you. On that note, are you accepting donations?


No donations please!! I do this for fun.



lrhorer said:


> I think it will, quickly. Realize, too, that there is nothing forcing you to meet any schedule. If you want to delay implementing a feature, or even refuse to implement it altogether, you should not feel any compulsion to second guess yourself just because we want it. I figure you've got to be experiencing the onset of burn-out.


But like I trid to say earlier - all of the suggestions - especially yours, have helped to turn what was a pretty mediocre app into one I am proud of. Yes it's approaching burn out. My wife has forgotten what I look like (and vice-versa) but when I get into something like this, I get consumed.


----------



## jbernardis

reneg said:


> I prefer portrait as most of my files are tv series related and I've been pulling poster images from thetvdb.com which fits within your thumbnail boundaries.
> 
> Just an idea if I might offer up a possible alternative, in each directory (or video file) check for a backgroundHD file in the directory or filename.backgroundHD. That could give up to 1280x720 pixels for whatever image the user want.


Have no fear - with the changes made, your portrait images will be unchanged. Actually as I say this, I seem to think that they'll be centered in the larger window - and I was right - I just verified that by checking on my tivo. Actually though, the centered image was not upsetting.

If people want, though, I can make a simple change to left justify the image so it looks like it did before.


----------



## lrhorer

jbernardis said:


> Have no fear - with the changes made, your portrait images will be unchanged. Actually as I say this, I seem to think that they'll be centered in the larger window - and I was right - I just verified that by checking on my tivo. Actually though, the centered image was not upsetting.


I wouldn't think so.



jbernardis said:


> If people want, though, I can make a simple change to left justify the image so it looks like it did before.


I think I prefer the left-justified, but it's a mild preference. Centered is fine.


----------



## jbernardis

Ok - this is it - at least for today. And to show a sense of finality, I'm bumping the version number, not the letter - version 0.6 is on git.

This one corrects the left justification oversight from the last version. Images are now, by default, left justified. HOWEVER, I also added a config.ini option, thumbjustify, that can be set to center or right if you want that. If you omit this, it will default to left.

Goot night everyone


----------



## jcthorne

I am having some diffeculty in getting vidmgr (and PythonHME) to run properly on my Synology NAS. Its strange. If I execute the following at an SSH command line:

python /usr/local/pythonHME/start.py

It starts normally with the response text shown in the SSH session. Running through the menus on the tivo it works normally. However pythonHME stops when I exit the SSH session.

If i use this command in a startup script executed at bootup:

/opt/bin/python /usr/local/pythonHME/start.py > /dev/null 2>&1 &

It starts pythonHME but ignores the config.ini file as if it cannot read it. Starts all apps, rather than just vidmgr listed in the apps section and vidmgr bombs if its called from the tivo, likely because its missing information from the config.ini file like path and pytivo location etc.

Suggestions?


----------



## orangeboy

jbernardis said:


> Would people rather have a landscape oriented view for thumbnails as opposed to the portrait one I have? I chose the present orientation because it is a good aspect ratio for DVD cover art, but I also know that people have been using video thumbnail maker, which would lend itself to landscape orientation. I'm willing to lay the screen out with a landscape orientation if that seems to be the concensus among users. Let me know.


Could you use image.size to determine the dimensions of the image, and choose orientation dynamically?



Code:


width=image.size[0] 
height=image.size[1]

if width > height:
    orientation=landscape
else:
    orientation=portrait


----------



## windracer

jcthorne said:


> I am having some diffeculty in getting vidmgr (and PythonHME) to run properly on my Synology NAS.


Maybe make sure in your script you 'cd' into your pyhme directory first? In my startup script, I do this:


Code:


    cd /etc/tivo/pyhme
    /etc/tivo/pyhme/start.py > /var/log/pyhme.log 2>&1 &


----------



## orangeboy

windracer said:


> Maybe make sure in your script you 'cd' into your pyhme directory first? In my startup script, I do this:
> 
> 
> Code:
> 
> 
> cd /etc/tivo/pyhme
> /etc/tivo/pyhme/start.py > /var/log/pyhme.log 2>&1 &


Yeah, I had issues with start.py and/or installed apps finding the config file when invoking start.py outside it's directory. Adding in a cd command clear things right up for me (on Windows).


----------



## jbernardis

orangeboy said:


> Could you use image.size to determine the dimensions of the image, and choose orientation dynamically?


The final (for now) design that I ended up with just drops the image into the view whatever its orientation - no scaling. The view is no longer 320X444 - it is now 620x450 - basically the entire lower right. If you have portrait thumbs that fit into the old view - nothing will change - they will be top/left justified in the view and appear the same. If you have larger (and wider) images, then as much as possible will fit into the viewport - this will allow for landscape images also. The difference is that for these wide images, the push/delete/tivo buttons COULD overlay the actual image.


----------



## jcthorne

tried your suggestion. No Go. Here is my startup script called startHME.sh:



Code:


`sleep 60`
cd /usr/local/pythonHME
/opt/bin/python /usr/local/pythonHME/start.py > /dev/null 2>&1 &

Is the name of the folder start.py is located in significant? I notice yours is /pyhme

I ran the script from a command line and get this feedback:



Code:


: not foundtc/rc.d/startHME.sh: line 1: 
/usr/syno/etc/rc.d/startHME.sh: cd: line 2: can't cd to /usr/local/pythonHME
: not foundtc/rc.d/startHME.sh: line 3:

after this start.py is running but again did not ready the config.ini file


----------



## jbernardis

jcthorne said:


> tried your suggestion. No Go. Here is my startup script called startHME.sh:
> 
> 
> 
> Code:
> 
> 
> `sleep 60`
> cd /usr/local/pythonHME
> /opt/bin/python /usr/local/pythonHME/start.py > /dev/null 2>&1 &
> 
> Is the name of the folder start.py is located in significant? I notice yours is /pyhme


The name of the pyhme folder is not significant, but all of the apps, including vidmgr, should be off of that directory and must be named the same as the application class in the __init__.py file (vidmgr) in my case.

Try running it without throwing away your output - or redirect it to a real file - to see what is says.


----------



## lrhorer

jcthorne said:


> /opt/bin/python /usr/local/pythonHME/start.py > /dev/null 2>&1 &
> 
> It starts pythonHME but ignores the config.ini file as if it cannot read it. Starts all apps, rather than just vidmgr listed in the apps section and vidmgr bombs if its called from the tivo, likely because its missing information from the config.ini file like path and pytivo location etc.
> 
> Suggestions?


I do this:



Code:


#! /bin/bash
PIDFILE=/var/run/pyHME.pid
RUNDIR=/usr/share/pyhme
LOGFILE=/var/log/pyhme.log
cd $RUNDIR
/usr/bin/nohup $RUNDIR/start.py > $LOGFILE 2>&1 &
echo $! > $PIDFILE
exit 0

This in turn is called from the startup script:



Code:


RAID-Server:/usr/share/pyhme# cat /etc/init.d/pyHME 
#! /bin/sh
### BEGIN INIT INFO
# Provides:          pyHME
# Required-Start:    $remote_fs $syslog $network $pyTivo
# Required-Stop:     $remote_fs $syslog $network $pyTivo
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: HME Services
# Description:       Provides HME services for TiVo
#
### END INIT INFO

# Author: Leslie Rhorer

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="HME Services"
NAME=pyHME
DAEMON=/usr/share/pyhme/$NAME
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
        if [ -e "$PIDFILE" ];
        then
                PIDVAL=$( cat $PIDFILE )
                ps -ef | grep $PIDVAL | grep -qv grep && return 1
                rm $PIDFILE
        fi
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        if [ -e $PIDFILE ];
        then
                PIDVAL=$( cat $PIDFILE )
                rm -f $PIDFILE
                kill -15 $PIDVAL 2> /dev/null
                return "$?"
        else
                return 1
        fi
}

case "$1" in
  start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  restart)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                        0) log_end_msg 0 ;;
                        1) log_end_msg 1 ;; # Old process is still running
                        *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
        exit 3
        ;;
esac


----------



## lrhorer

jcthorne said:


> I am having some diffeculty in getting vidmgr (and PythonHME) to run properly on my Synology NAS. Its strange. If I execute the following at an SSH command line:
> 
> python /usr/local/pythonHME/start.py
> 
> It starts normally with the response text shown in the SSH session. Running through the menus on the tivo it works normally. However pythonHME stops when I exit the SSH session.


Use nohup to prevent the process from terminating when the shell quits. Normally, a spawned process is assigned the calling shell as the parent. Nohup causes the process to be assigned init ( PID 1) as the parent.


----------



## jcthorne

lrhorer said:


> I do this:


OK. Thanks, I think. Where do you run those scripts? where is the output shown? I have no idea how to implement most of that, way over my head and a simple copy/paste is not going to run due to the directories all being different from mine. Why is all that necessary just to start pyhme?


----------



## jcthorne

Running this script from a command line:



Code:


`sleep 60`
cd /usr/local/pythonHME
/opt/bin/python /usr/local/pythonHME/start.py > /usr/local/pyhme.log 2>&1 &

yields these results:



Code:


: not foundtc/rc.d/startHME.sh: line 1: 
/usr/syno/etc/rc.d/startHME.sh: cd: line 2: can't cd to /usr/local/pythonHME
: not foundtc/rc.d/startHME.sh: line 3:

pyHME is running but did not read the config file. pyhme.log is a zero length file so it did not capture any output.


----------



## jbernardis

You don't need the tick marks around sleep 60 - thats actually running sleep 60 and then trying to execute its output - which of course is null.

I don't know why you're getting the other errors, but remove the ticks and try it again


----------



## jcthorne

jbernardis said:


> You don't need the tick marks around sleep 60 - thats actually running sleep 60 and then trying to execute its output - which of course is null.
> 
> I don't know why you're getting the other errors, but remove the ticks and try it again


running the scripts without the tick marks yields:

'leep: invalid number '60

in addtion to the other errors. very strange.

Using lrhorer's suggestion of using nohup at least lets me start it from a command line and leave it running. Still have no idea why it will not start from the startup script at boot time.

Took me quite a while to get pytivo running from boot time but it does. pyHME starts but does not read its config.ini file. Since this is a pyHME problem and not a vidmgr problem, I'll go ask for help in that thread and quit hogging this one.

I really do appreciate the newbee help. What was so easy for me to do in Window is a major learning curve in linux....slowly I am getting there.


----------



## jcthorne

lrhorer said:


> Use nohup to prevent the process from terminating when the shell quits. Normally, a spawned process is assigned the calling shell as the parent. Nohup causes the process to be assigned init ( PID 1) as the parent.


Thanks, this one at least lets me start it and leave it running.


----------



## lrhorer

jcthorne said:


> OK. Thanks, I think. Where do you run those scripts? where is the output shown? I have no idea how to implement most of that, way over my head and a simple copy/paste is not going to run due to the directories all being different from mine. Why is all that necessary just to start pyhme?


The nohup script is what arranges for the code itself to be loaded, detaches the process from its parent, creates the log file, and creates the PID file. This can be run from anywhere, by any process, and as long is as pyHME is not already running, it should work. You will, of course, need to adjust the directory names to match your system.

The output from the nohup script shows up in two places. The file /var/log/pyHME.log contains the stdout and stderr produced by python when running the start.py script. The /var/run/pyHME.pid file contains the PID of the python process. This can be used to kill or reinitialize the python process. The two following commands should contain the same number when pyHME is running:

ps -ef | grep start.py
cat /var/log/pyHME.log

The startup script is how Debian and Debian derivatives implement dependency based booting. I won't go into the details here, but basically different distribution families handle the init process - the thing that runs all the accessories once the kernel is up and running - in different ways. If your NAS is not Debian based (it doesn't look like it), then the init script will have a different form, but, ignoring the header, the init script I posted demonstates how to implement a script that will allow the user (or another script) to manage the pyHME load by running

/<directory containing the startup script>/pyHME start | stop | restart

If your system is not Debian based, it may be quite possible to merge the two scripts into a single script, perhaps implementing the nohup script as a subroutine. It's even possible under Debian, but it may not work too well, because the init scripts do not run under bash when booting.

Note in general, this can be shortened by creating a symlink to the process in one of the directories pointed to by the $PATH variable, but since init scripts are not usually run by users, this is not usually done for init scripts.


----------



## lrhorer

Hey, I've got a question. Is it posible for HME for Python to deliver a .gif file, specififally an animated .gif file, to the Tivo and for the TiVo to display it properly? It would be kinda neat to have some animated thumbnails.


----------



## lrhorer

jbernardis,

When you get a chance to peek at the code again, I think it would be a good idea to add a try block around the video listings as well as the thumbnails. The app also locks up if it encounters a broken link to a video file. I got the following response when attempting to enter the "F" directory of the alphabetically grouped links after I had deleted the target for the link to "/RAID/Recordings/First Wives Club, The test (Recorded Sat Apr 09, 2011, MAXHD).mpg"



Code:


Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 560, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/share/pyhme/start.py", line 141, in __init__
    client_address, server)
  File "/usr/lib/python2.6/SocketServer.py", line 617, in __init__
    self.handle()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 323, in handle_one_request
    method()
  File "/usr/share/pyhme/start.py", line 232, in do_GET
    self._page(True)
  File "/usr/share/pyhme/start.py", line 186, 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 328, in handle_key_press
    self.handle_key_pressList(keynum, rawcode)
  File "/usr/share/pyhme/vidmgr/__init__.py", line 446, in handle_key_pressList
    self.createListing()
  File "/usr/share/pyhme/vidmgr/__init__.py", line 1349, in createListing
    meta = metadata.basic(fullpath)
  File "/usr/share/pyhme/vidmgr/metadata.py", line 98, in basic
    mtime = os.stat(full_path).st_mtime
OSError: [Errno 2] No such file or directory: '/usr/share/pyTivo/alphagroup/F/First Wives Club, The test (Recorded Sat Apr 09, 2011, MAXHD).mpg'

Until then, everyone should be advised they need to delete any broken links caused by deleting, moving, or renaming a video file served by vidmgr, or else the application may lock up when reading a share directory.


----------



## jbernardis

I took a look at the code this morning - no changes yet - and I'm not so sure that a simple try block would suffice. At this point in the code, we've already assumed that the file is present because there is a directory entry for it. Now we find that we can't stat the file - we have to drop the data structure we're in the midst of building. I think I need to stat the file earlier and treat it as if the file were never found in the first place (after writing out an error message of course).

In the meantime, I have made some changes to the code - nothing has been delivered yet. Among the new changes are:

- I discovered that I can implement a cleanup method that is the proper place to save the image cache - so I moved the save to there,
- I added logic to allow folder.txt to hold metadata for a folder. If I find such a file, and if it has a meta item named 'description' (like the video metafile) then this description will be shown on the folder (and share) lists above the thumbnail
- although I widened the right hand margin in the info screen, I made it customizable via the config file.

These will all be in the next release, as well as a fix to this broken link issue.


----------



## reneg

Feature creep request - Please consider adding the ability to initiate a push of a video from one tivo to another through video manager interface.


----------



## jbernardis

reneg said:


> Feature creep request - Please consider adding the ability to initiate a push of a video from one tivo to another through video manager interface.


You already can push a video that is managed by pytivo to ANY tivo you have defined from ANY tivo, the same one or otherwise.

Tivo itself does not support pushing anywhere. You'd have to get the video under pytivo management first.

I suppose you could have an HME app that can query the tivo NPL, upload a chosen video, and then push it out somewhere else, but that is very different from the app we have today (but not a bad idea for a new app)


----------



## lrhorer

jbernardis said:


> I added logic to allow folder.txt to hold metadata for a folder. If I find such a file, and if it has a meta item named 'description' (like the video metafile) then this description will be shown on the folder (and share) lists above the thumbnail


Oh, that's nice.



jbernardis said:


> although I widened the right hand margin in the info screen, I made it customizable via the config file.


Oh, that's nice, too. What are the limits?


----------



## jbernardis

lrhorer said:


> ...What are the limits?


I don't know - what do you think they ought to be?

Right now, the value is expressed in pixels. Obviously it should be a positive number, so the minimum would be 0, but there should be a maximum value too. How about 50 or 100? ANything higher than that is probably not practical. The default value is 20 (although in the version last released, I was using a value of 15)


----------



## jbernardis

As promised, version 0.6a is now on github. I put try block protection around the stat operation in metadata.basic routine. The action if the file cannot be stat'ed is to simply state that fact in the description field of the metadata. That way, there is an on-screen indication of the problem.

The full change log for this version:

- put a try block around the stat operation in metadata.basic to catch broken links and other errors. The action
is to simply put an error message into the metadata description field
- made use of the cleanup method as the correct place to save the cache
- added support for folder/share metadata. If a folder or share has a file named folder.txt (or .meta/folder.txt)
then the contents will be read as metadata, and any description field that is found will be displayed on the screen
above the thumbnail
- added inforightmargin to configuration file - the number of pixels of right margin to leave on the info screen, default=20


----------



## lrhorer

jbernardis said:


> I don't know - what do you think they ought to be?
> 
> Right now, the value is expressed in pixels. Obviously it should be a positive number, so the minimum would be 0, but there should be a maximum value too. How about 50 or 100? ANything higher than that is probably not practical. The default value is 20 (although in the version last released, I was using a value of 15)


I'll have to take a look, but I would think anything beyond 100 would start to be too much under any circumstances.


----------



## innocentfreak

Hmm looks like at least with the latest release, some of my series cover art pulled from theTVDB isn't displaying correctly. Some of the older shows are fine, but it seems the newer images are too large so they are cut off on the screen. 

I haven't been keeping up like I should as far as options. Is there a way to have the image resize so that the full image displays? 

Also it appears some of the images aren't pulling even though they are named folder.jpg. For example Breaking In pulls, but is cut off halfway, yet Breaking Bad doesn't.


----------



## lrhorer

jbernardis said:


> I don't know - what do you think they ought to be?
> 
> Right now, the value is expressed in pixels. Obviously it should be a positive number, so the minimum would be 0, but there should be a maximum value too. How about 50 or 100? ANything higher than that is probably not practical. The default value is 20 (although in the version last released, I was using a value of 15)


Yeah, looking at it, 100 seems more than plenty to me.

What does everyone else think?


----------



## lrhorer

innocentfreak said:


> Hmm looks like at least with the latest release, some of my series cover art pulled from theTVDB isn't displaying correctly. Some of the older shows are fine, but it seems the newer images are too large so they are cut off on the screen.


I suggest you run the images through an image converter that has a maximum image size setting.



innocentfreak said:


> I haven't been keeping up like I should as far as options. Is there a way to have the image resize so that the full image displays?


We went around about this issue a couple of days ago, concerning producing an auto-scale function. My vote was, "definitely not". An acceptable compromize solution to me would be, "only if the image is too large." I'd rather handle all the scaling myself.



innocentfreak said:


> Also it appears some of the images aren't pulling even though they are named folder.jpg. For example Breaking In pulls, but is cut off halfway, yet Breaking Bad doesn't.


My guess would be there is an error in the image.


----------



## innocentfreak

lrhorer said:


> I suggest you run the images through an image converter that has a maximum image size setting.
> 
> We went around about this issue a couple of days ago, concerning producing an auto-scale function. My vote was, "definitely not". An acceptable compromize solution to me would be, "only if the image is too large." I'd rather handle all the scaling myself.
> 
> My guess would be there is an error in the image.


I would agree only if the image is too large. My metadata program automatically pulls the image so I don't want to deal with the hassle of running every image through an image converter.

Hmm the image displays fine on everything else.


----------



## jbernardis

I can put image scaling back in if the image is too large. Actually there weren't too many versions released that did any scaling, and they were only available for a few hours somewhere in the flurry of releases a few days ago. 

One fact that everyone needs to know about the versions that did scaling - the image cache I implemented cached the scaled image. This means that unless the jpg file is touched, or unless the image drops off the 100 least recently used images, you will still see the scaled image even though I no longer do scaling. The simplest solution for this is to stop the server, delete the cache (thumbs.cache in the vidmgr directory), and then restart the server.

This will still be true after I add scaling back in - the cache will have unscaled images, so unless the image drops off or the LRU list or the file is touched, the cache will not change.


----------



## innocentfreak

Thanks, yeah that would work for me. Like all the stuff I am seeing so far. I just wish I had more time to sit down and play with it.


----------



## jbernardis

Alright - I think this should please everyone. 0.6b is available at github.

I added scaling back in, but only for images that are too large. It compares the image height to the view height, and the image width to the view width, and chooses the ratio that is the larger of the two to apply to both axes.


Again, as I noted in my earlier message, the cache will not think that its contents are out of date, so images that are too big that are already in the cache will not be reread. It is best to simply delete the cache before restarting the server.


----------



## innocentfreak

Thanks so far looks to be working great.


----------



## orangeboy

jbernardis said:


> It is best to simply delete the cache before restarting the server.





innocentfreak said:


> Thanks so far looks to be working great.


Sound familiar 'freak?


----------



## innocentfreak

orangeboy said:


> Sound familiar 'freak?


Lol someone got me in the habit so I planned to do it even if he didn't tell me to


----------



## westside_guy

cweb said:


> Can I use video manager with my OSX Pytivo installation?


Python is installed on the Mac by default - and this works very well on my Mac.


----------



## cweb

I'm attempting to get vidmgr running under osx for me. When I run start.py I get the message: "Skipping: vidmgr - No module named Image".

Any clue what it is looking for?


----------



## jbernardis

cweb said:


> I'm attempting to get vidmgr running under osx for me. When I run start.py I get the message: "Skipping: vidmgr - No module named Image".
> 
> Any clue what it is looking for?


Yes - it's looking for the python image library. Google "PIL", and download and install the version that goes with your python. Then this should go away.

I use the PIL to resize thumbnail images if they are too big.


----------



## cweb

Well after what seemed like a zillion hours, I got PIL to install on my OS X 10.6.7 with python 2.7.2. and vidmgr starts up. However, when I access the app from my tivo it just immediately exits back to the "Music, Photos, & Showcases" screen.

It seems that at least one problem is it doesn't like the path to the pyTivo.conf file (~/Library/'Application Support'/pyTivoX/). It appears the space throws it. Quotes doesn't seem to help.

Any thoughts. Thanks.


----------



## lew

innocentfreak said:


> I would agree only if the image is too large. My metadata program automatically pulls the image so I don't want to deal with the hassle of running every image through an image converter.
> 
> Hmm the image displays fine on everything else.


What metadata program are you using?


----------



## innocentfreak

lew said:


> What metadata program are you using?


I use sick beard. It wasn't designed for my usage, but I like it. It makes it much easier to organize and track even the shows I don't transfer to my pc.


----------



## jbernardis

cweb said:


> Well after what seemed like a zillion hours, I got PIL to install on my OS X 10.6.7 with python 2.7.2. and vidmgr starts up. However, when I access the app from my tivo it just immediately exits back to the "Music, Photos, & Showcases" screen.
> 
> It seems that at least one problem is it doesn't like the path to the pyTivo.conf file (~/Library/'Application Support'/pyTivoX/). It appears the space throws it. Quotes doesn't seem to help.
> 
> Any thoughts. Thanks.


I would try putting the entire string in quotes - not just the part with the space: ( '~/Library/Application Support/pyTivoX/' ). I don't have a mac though so I can't test this idea.

The parsing of the config file is done with the python configparser module, and I'm not sure of the details of its operation. The doc page (http://docs.python.org/library/configparser.html) doesn't really say anything about this situation.


----------



## cweb

jbernardis said:


> I would try putting the entire string in quotes - not just the part with the space: ( '~/Library/Application Support/pyTivoX/' ). I don't have a mac though so I can't test this idea.


I tried your single quotes response (both with ~ and with full path) with no luck. Its's the space between Application and Support that is throwing it.

As an experiment, I copied pytivo.conf to a temp directory with no spaces in the path and the program worked great! I just need a way to correctly parse the real path. I don't believe pytivo or pytivox allows you to specify a settings directory.


----------



## jbernardis

cweb said:


> I tried your single quotes response (both with ~ and with full path) with no luck. Its's the space between Application and Support that is throwing it.
> 
> As an experiment, I copied pytivo.conf to a temp directory with no spaces in the path and the program worked great! I just need a way to correctly parse the real path. I don't believe pytivo or pytivox allows you to specify a settings directory.


Here is the code that reads in the config file name:
key = "pytivo" + str(i) + ".config"
if not cfg.has_option(section, key): break
cfgfile = cfg.get(section, key)
self.parseCfgFile(cfgfile, ip, port, sep)

and here is the code that reads the config file: 
def parseCfgFile(self, cf, ip, defport, sep):
pyconfig = ConfigParser.ConfigParser()
configs_found = pyconfig.read(cf)

I'm not doing any processing or manipulation of the filename. I'm just reading in the string using a configparser get method and I'm passing that string to the configparser read method. SOmewhere in there this is happening, but there is nothing (at least evident to me) that I can do differently in the vidmgr code.

Does anybody on a MAC have any insight into this?

Have you tried without any quoting whatsoever?


----------



## cweb

jbernardis said:


> Have you tried without any quoting whatsoever?


Problem solved. I looked at other python apps (pytivo and streambaby) to see how there configs laid out the path name. I have to use the whole path name (/Users/xxxxx/Library/Application Support/pyTivoX/pyTivo.conf with no quotes) vs the short hand path (~/Library/Application Support/pyTivoX/pyTivo.conf).

I thought I had done this previously a couple of times before, but perhaps there was a spelling error along the way. Anyway it now works.

Thanks.


----------



## lrhorer

In *nix (and probably the Mac) the interpreter (bash, ksh, csh, etc) expands the ~ into the home directory name, but if the ~ is enclosed in quote marks, then it is taken to be a literal - which is to say a directory named "~". OTOH, placing quote marks within the interior of the path is probably not a valid expression for Python. The bottom line is, putting unexpanded expressions like ~ or * in a config file is not generally a good idea unless you know for a fact the interpreter you are using will expand the expressions in the way you think it will. Even then, it's not a terribly good idea.


----------



## jbernardis

Yeah - I know nothing of MAC's either, but on Unix systems, the ~ and * expressions used in filenames (known as globbing) is expanded by the shell. The program being invoked knows nothing about whether or not these expressions are used - it simply receives a list of fully expanded matching filenames.


----------



## wmcbrine

OS X is just another flavor of BSD at this level. It _is_ a Unix system.


----------



## lrhorer

wmcbrine said:


> OS X is just another flavor of BSD at this level. It _is_ a Unix system.


That I knew. What I don't now is what interpreters it employs at the CL, and of course I'm not directly familiar with how Python interprets strings.


----------



## lrhorer

jbernardis said:


> Yeah - I know nothing of MAC's either, but on Unix systems, the ~ and * expressions used in filenames (known as globbing) is expanded by the shell. The program being invoked knows nothing about whether or not these expressions are used - it simply receives a list of fully expanded matching filenames.


In terms of what is received from parameters passed by stdin, I would expect this to be true, but not necessarily from a config file read directly by the interpreter - in this case Python. Unless I misread the original post, he's putting this expression in a config file, isn't he? I don't recall that I have ever attempted to pass a globbed expression to the kernel. I wouldn't expect it to work, so I've never even tried.


----------



## lrhorer

OK, I have another request that I think should not be too difficult. Lucasnz over on the pyTivo forum has picked up development of the DVD plugin for pyTivo, and has re-worked the code so that (with one small fork differential) pyTivo can now push DVD titles. It would be great if vidmgr supported this functionality. See the thread here.


----------



## jbernardis

lrhorer said:


> In terms of what is received from parameters passed by stdin, I would expect this to be true, but not necessarily from a config file read directly by the interpreter - in this case Python. Unless I misread the original post, he's putting this expression in a config file, isn't he? I don't recall that I have ever attempted to pass a globbed expression to the kernel. I wouldn't expect it to work, so I've never even tried.


This is my point. The shell is NOT going to interpret a config file. It's up to the program to do that. Many people think that the wildcards you use on the command line are processed internally by the program, and therefore it should be no hardship (or at least no different) to also process wildcards from a config file.

This is not the case, however. The invoked program has no idea that wildcards were used on the command line - the shell takes care of the expansion/file name matching. If wildcards are in a config file, however, the reading program would have to do the expansion explicitly. Most languages provide facilities for doing this (at least I know Perl does and I assume python does too) but it's not a normal practice to do so.


----------



## jbernardis

lrhorer said:


> OK, I have another request that I think should not be too difficult. Lucasnz over on the pyTivo forum has picked up development of the DVD plugin for pyTivo, and has re-worked the code so that (with one small fork differential) pyTivo can now push DVD titles. It would be great if vidmgr supported this functionality. See the thread here.


I have never used the DVD plugin myself, but it looks intriguing. I noticed when it was first announced, but haven't followed its evolution. I am actually using vidmgr and pytivo to manage some DVD rip videos, but am having some issues with the proper format. Maybe this plugin will solve my issues.

Let me get it going on my installation so that I know better how it's used. After I'm familiar with it, I'll evaluate how it could best be incorporated into vidmgr, and what the impacts on the program will be.


----------



## lrhorer

jbernardis said:


> I have never used the DVD plugin myself, but it looks intriguing. I noticed when it was first announced, but haven't followed its evolution. I am actually using vidmgr and pytivo to manage some DVD rip videos, but am having some issues with the proper format. Maybe this plugin will solve my issues.


With the exception of some audio track selection issues, which the most recent updates have fixed, I've never had any problems with simply ripping the DVD using DVD Decrypter, renaming the directory to suit my taste, and going about my business.



jbernardis said:


> Let me get it going on my installation so that I know better how it's used.


Aside from support for rather more complex and numerous metafiles, to the user it is almost identical to the mainstream pyTivo program. The only major difference is each DVD has its own directory, rather than just being a single file.


----------



## jbernardis

FYI - I have been working on this and am just about finished. I am away from home right now, but have taken the source code with me and I believe I have finished my changes, Problem is I won't be able to test until I get home, so it still could be quite a while before it's released.

There are some significant differences between processing these shares and normal video shares. Most notably, when I am processing a video share, if there is no meta data available, I at least have the file name as a reasonable title substitute and I can easily count up the number of titles in any directory. Not so with a dvdvideo share - the only real way to know how many titles I am dealing with is to process the binary IFO files, and that just gives me the count - There is no real title.

So I made a simplifying decision. I am ONLY processing the metadata. If a directory contains a VIDEO_TS directory but does not have any metadata, then I assume that there is only a single title (with the same name as the directory name). If there is metadata, the number of titles and their text is extracted from there.


----------



## lrhorer

jbernardis said:


> FYI - I have been working on this and am just about finished.


Terrific!



jbernardis said:


> I am away from home right now, but have taken the source code with me and I believe I have finished my changes, Problem is I won't be able to test until I get home, so it still could be quite a while before it's released.


'A little less terrific, but still good news.



jbernardis said:


> There are some significant differences between processing these shares and normal video shares. Most notably, when I am processing a video share, if there is no meta data available, I at least have the file name as a reasonable title substitute and I can easily count up the number of titles in any directory. Not so with a dvdvideo share - the only real way to know how many titles I am dealing with is to process the binary IFO files, and that just gives me the count - There is no real title.


Absolutely. Metadata is essential with the DVD plug-in.



jbernardis said:


> So I made a simplifying decision. I am ONLY processing the metadata. If a directory contains a VIDEO_TS directory but does not have any metadata, then I assume that there is only a single title (with the same name as the directory name).


Indubitably. I don't see how else you could reasonably attack the problem.



jbernardis said:


> If there is metadata, the number of titles and their text is extracted from there.


Excellent.

Does the DVD Plug-in solve the issues you were having with your rips?


----------



## jbernardis

lrhorer said:


> Does the DVD Plug-in solve the issues you were having with your rips?


Not quite - I'm not sure that I'm going to end up using the dvdvideo plugin for several reasons.

1) Even though we are "pushing" videos, there is still some ffmpeg processing going on. When I push a dvd video using this plugin, it's takes about 5 times as long as pushing the same video transcoded into MP4 (and the MP4 file is not significantly smaller)

2) All I ever want from a DVD is the main title - this plugin introduces another level in the directory hierarchy, which is unnecessary for a single title.

3) I have several movies that span multiple disks. With all of the video tools I have at my disposal, I am able to combine these into a single file. This is impossible with the dvdvideo plugin.

4) I have some series with multiple titles on multiple disks. In this situation, adding a disk level to the hierarchy and needing to traverse up and then down into another directory to continue with the series seems unnatural to me.

5) I also play these videos on my PS3 - which I can do directly from my NAS with the native software of the PS3. I'm not sure if this would be possible if the files were in VIDEO_TS format.

I think I'm just going to continue transcoding my videos to either MP4 or MPG format.


----------



## lrhorer

jbernardis said:


> 1) Even though we are "pushing" videos, there is still some ffmpeg processing going on. When I push a dvd video using this plugin, it's takes about 5 times as long as pushing the same video transcoded into MP4 (and the MP4 file is not significantly smaller)


Odd. Still, since all DVDs are SD, they still transfer at several times real-time, and since there are no commercials, I rarely have any reason to FF or RW.



jbernardis said:


> 2) All I ever want from a DVD is the main title - this plugin introduces another level in the directory hierarchy, which is unnecessary for a single title.


You don't have any multi-title DVDs? I have several, plus several with theatrical and non-theatrical releases. There are also several whose extra features I like. Admittedly, most I only want the main title, but there are a number of exceptions.



jbernardis said:


> 3) I have several movies that span multiple disks. With all of the video tools I have at my disposal, I am able to combine these into a single file. This is impossible with the dvdvideo plugin.


It's not impossible, at all. I only have one, that I recall (Exodus), and I ripped it to a pair of MPEG files, and then re-authored / spliced it using VideoRedo.



jbernardis said:


> 4) I have some series with multiple titles on multiple disks. In this situation, adding a disk level to the hierarchy and needing to traverse up and then down into another directory to continue with the series seems unnatural to me.


You could splice it into a single, multi-title collection. You may not consider this convenient, however.



jbernardis said:


> 5) I also play these videos on my PS3 - which I can do directly from my NAS with the native software of the PS3. I'm not sure if this would be possible if the files were in VIDEO_TS format.


That, I can't say.



jbernardis said:


> I think I'm just going to continue transcoding my videos to either MP4 or MPG format.


OK. I definitely prefer just ripping and forgetting about it. I haven't done even a single rip in ages, but when I was archiving my DVDs, I sometimes ripped four at a time.


----------



## jbernardis

Ok - version 0.7 is out on git - follow the link in my signature.

This version adds support for the dvdvideo plugin. As mentioned in the above posts, this is highly dependent on accurate metadata. If you do not have metadata, then I assume that there is only 1 title - the main feature - available.

lrhorer - I am counting on you doing some testing here. I put a few dvds up on my NAS, but as I stated, I do not use the dvdvideo plugin. The few dvds I inserted allow me to do little more than elementary testing. I certainly do not have the variety of scenarios that I think you have


----------



## lrhorer

jbernardis said:


> Ok - version 0.7 is out on git - follow the link in my signature.


'Just downloaded it.



jbernardis said:


> lrhorer - I am counting on you doing some testing here. I put a few dvds up on my NAS, but as I stated, I do not use the dvdvideo plugin. The few dvds I inserted allow me to do little more than elementary testing. I certainly do not have the variety of scenarios that I think you have


Oh, you bet. I'm going to try a couple right now. I won't be able to do any real testing until this weekend, though.


----------



## lrhorer

Um, something is broken. First of all it is no longer possible to gracefully exit vidmgr, or even to get back to the main menu from any of the shares. In the main menu, hitting left arrow does nothing, and once I have entered a share, the left arrow won't take me back to the main menu. I can drill into subdirectories inside a share and get back to the root of a share, but that's as far as I can get. Hitting the <TiVo> button takes me back to the main TiVo menu, though.

The DVD share doesn't work, at all, though. No folder icon shows up next to the DVD share. Hitting the right arrow brings up a very slight shadow of an icon (the clock, icon, I think) in the middle of the screen, and then the app locks up tight. I'm including a copy of the log, gained from moving around various places in the app. The log file is gzipped, but I changed the extension to .zip so I could upload it.


----------



## jbernardis

It always seems to be related to the display of an icon. I can certainly make the code more defensive here, but it almost seems to me that one of your png files is missing, although I didn's see a message in the logs you provided. I didn't state it explicitly in my last email, but there is a new png file - dvdfolder.png. If you are using your own skin, make sure to copy this over from eith the skins/blue or skins/orig directory.

The exception happens because the listing dictionary has a value of None for key 'icon', and the only way this can happen is if one of the png files is missing.

Edit: Possible reason why the error message is not showing up - Are you only directing stderr to your log file and NOT stdout? My message is going to stdout. I can fix this too - but before I make a change, let's find out if your file is missing.


----------



## lrhorer

jbernardis said:


> It always seems to be related to the display of an icon. I can certainly make the code more defensive here, but it almost seems to me that one of your png files is missing, although I didn's see a message in the logs you provided. I didn't state it explicitly in my last email, but there is a new png file - dvdfolder.png. If you are using your own skin, make sure to copy this over from eith the skins/blue or skins/orig directory.


Oops. That would do it. I have skin=local set in my config.ini file. When I pulled the git, I simply copy over the entire directory structure, but of course nothing gets copied to the ./vidmgr/skins/local directory, by design.



jbernardis said:


> The exception happens because the listing dictionary has a value of None for key 'icon', and the only way this can happen is if one of the png files is missing.


Yep, that did the trick. From now on, I'll have to remember to scan the ./vidmgr/skins/orig/ directory for new files whenever I pull a git. I like the icon, BTW. It provides a nice visual cue to the fact these are DVDs.



jbernardis said:


> Edit: Possible reason why the error message is not showing up - Are you only directing stderr to your log file and NOT stdout? My message is going to stdout. I can fix this too - but before I make a change, let's find out if your file is missing.


That was established. Meanwhile:



Code:


#! /bin/bash
PIDFILE=/var/run/pyHME.pid
RUNDIR=/usr/share/pyhme
LOGFILE=/var/log/pyhme.log
cd $RUNDIR
/usr/bin/nohup $RUNDIR/start.py > $LOGFILE 2>&1 &
echo $! > $PIDFILE
exit 0

This is called from



Code:


NAME=pyHME
DAEMON=/usr/share/pyhme/$NAME
PIDFILE=/var/run/$NAME.pid

...

start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON || return 2

in /etc/init.d. Stdout and stderr are both being re-directed to the logfile. Nohup and the daemon service manager should not interfere with stdout. Obviously, since stderr is being re-directed to stdout, and the messages from stderr are showing up in the log file, stdout must be properly re-directed. For some reason, the message is not showing up to stdout.


----------



## jbernardis

I can't explain the missing message - there IS a print statement if an image file is missing.

But since copying the file got you going, I'm not going to worry too much about that. I am going to make a delivery with defensive code in case the icon file is missing, but there is no urgency for it (unless you report further issues)

Incidentally - I apologize for not emphasizing that there was a new graphic file in this release. I intended to do so, but it slipped my mind while I was composing the message.


----------



## lrhorer

jbernardis said:


> I can't explain the missing message - there IS a print statement if an image file is missing.


Hmm. Odd. I have no explanation.



jbernardis said:


> But since copying the file got you going, I'm not going to worry too much about that. I am going to make a delivery with defensive code in case the icon file is missing, but there is no urgency for it (unless you report further issues)


Quite the contrary. Everything so far looks perfect. As I mentioned, however, my testing so far has been fairly perfunctory. I won't be able to really beat up the app until this weekend.

One very interesting note. I noticed if there is a folder.jpg file in the directory for a DVD, but no individual __Txx.mpg.jpg file, then rather than display no cover art, for the specific title, the app displays the main folder.jpg artwork. I like that.



jbernardis said:


> Incidentally - I apologize for not emphasizing that there was a new graphic file in this release. I intended to do so, but it slipped my mind while I was composing the message.


No worries. It was more my fault for not thinking of it. Given the fact I have a custom icon folder, scanning your release skin folders for new artwork files should have been SOP for me whenever I pull a new git all along.


----------



## jbernardis

lrhorer said:


> One very interesting note. I noticed if there is a folder.jpg file in the directory for a DVD, but no individual __Txx.mpg.jpg file, then rather than display no cover art, for the specific title, the app displays the main folder.jpg artwork. I like that.


Actually, the folder.jpg behavior was my original intent. It wasn't until I finished coding that I realized the __Txx.mpg.jpg "feature" was going to be a by-product. I had a note to myself to try to work this in, and then I realized that it just ought to work. So I tried it and sure enough the existing logic already took care of it. Glad you like it.


----------



## jbernardis

BTW - did you notice that if you are looking at the directory listing and have the hilite on the DVD folder, if you press the info button, you see the info from the default.txt file, including the list of titles.


----------



## lrhorer

jbernardis said:


> BTW - did you notice that if you are looking at the directory listing and have the hilite on the DVD folder, if you press the info button, you see the info from the default.txt file, including the list of titles.


No, I didn't catch that. Neat.


----------



## lrhorer

OK, I've hit the DVD feature at least once with everything of which I can think, and it seems to be performing flawlessly with one tiny exception. Subdirectories are not properly sorted by Alpha even though force_alpha = True is set in pyTivo.conf. OTOH, when I double-checked, the pyTivo DVD plug-in does not sort properly, either. If vidmgr relies on the DVD plug-in to relay the directory listing back to the app, then this is more properly a small bug in the DVD plug-in. If not, then both the DVD plug-in and vidmgr have the same little bug-let.

Edit: Oh, pfft! Nevermind. Silly me. If forgot on an Alph sort, 25 comes before 3 and 4, and 43 comes before 6.


----------



## lrhorer

OK, no sooner did I submit a false bug report, than I have another feature request, if it isn't too difficult to manage. (No one can say I don't have chutzpah, I guess.) Would it be possible to make folder descriptions multi-line? I was thinking something like the following.

If the file default.txt in "/Videos/Twilight Zone" has the lines



Code:


description : Four Episodes from the original TV series
description : 1. Steel
description : 2. A Game of Pool
description : 3. Walking Distance
description : 4. Kick the Can

Then rather than only the first line showing up in the info text, all four will show up like so:



Code:


Four Episodes from the original TV series
1. Steel
2. A Game of Pool
3. Walking Distance
4. Kick the Can

Of course, I could put them all on one line, but this reads easier, especially when there are a number of titles.


----------



## jbernardis

1. The sorting was deliberate. I chose to sort in title number order. Perhaps I can make this into some type of option.

2. So let me get this straight - you want the description - on both the main screen and the info screen - to contain the titles. It's simple enough to include the text, but formatting might be an issue. Inserting text into a view does not, to my knowledge, have a rich set of text formatting tools. Even something so simple as starting on a new line is difficult - I don't know what happens if a new line character is in the text. Let me do some experimenting and I'll let you know.


Glad it's working for you otherwise

EDIT: after thinking about it, adding a list of titles to the info screen wouldn't be difficult - they're already there - it's just a matter of where they are placed. Also, on the info screen, I am managing the display lines myself to allow the two column layout I am using - so it's no big deal to add additional text like this.

The description on the details screen, however, has the issues discussed above.


----------



## lrhorer

jbernardis said:


> 1. The sorting was deliberate. I chose to sort in title number order. Perhaps I can make this into some type of option.


That was just me being stupid. I simply changed 3 and 4 to 03 and 04, etc. in the directory names. Unless someone else sees this as necessary, I don't see a need for it.



jbernardis said:


> 2. So let me get this straight - you want the description - on both the main screen and the info screen - to contain the titles.


Or potentially other items separated by a newline. The ability to indent would be nice, too.

Mainly the intent is to have the subdirectory info available when the folder is highlighted without having to move away from the current directory level.



jbernardis said:


> It's simple enough to include the text, but formatting might be an issue. Inserting text into a view does not, to my knowledge, have a rich set of text formatting tools. Even something so simple as starting on a new line is difficult


Yeah, that's what I figured. The indent might be even tougher.



jbernardis said:


> I don't know what happens if a new line character is in the text. Let me do some experimenting and I'll let you know.


OK.



jbernardis said:


> EDIT: after thinking about it, adding a list of titles to the info screen wouldn't be difficult - they're already there - it's just a matter of where they are placed. Also, on the info screen, I am managing the display lines myself to allow the two column layout I am using - so it's no big deal to add additional text like this.
> 
> The description on the details screen, however, has the issues discussed above.


Yeah, understood. What I am looking for, as you can see, is the ability to list the contents of the subdirectory without having to drill into something.


----------



## jbernardis

lrhorer said:


> Mainly the intent is to have the subdirectory info available when the folder is highlighted without having to move away from the current directory level.
> What I am looking for, as you can see, is the ability to list the contents of the subdirectory without having to drill into something.


You should have this already. When the hilite is on the DVD Folder line - where the icon is a DVD - if you press the info button, you can see the titles, in title order, in amongst the other meta data. Of course this only happens if you have the titles in the metadata.


----------



## lrhorer

jbernardis said:


> You should have this already. When the hilite is on the DVD Folder line - where the icon is a DVD - if you press the info button, you can see the titles, in title order, in amongst the other meta data. Of course this only happens if you have the titles in the metadata.


Well, actually, no, it doesn't. Evidently your code processes the last "description :" line and discards the others. When I put the following in default.txt



Code:


seriesTitle : The Twilight Zone
description : Volume 43
description : This is test 2
description : This is test 3
description : This is test 4.
isEpisode : true

All that shows up in the description window is the text



Code:


This is test 4.

and the only description line displayed in the info pop-up is



Code:


Description      This is test 4.

Getting back to the main point, however: even if the text showed up in the info pop-up, that still requires moving away from the current level. Basically, I am looking for something that is on the screen (in the description window) without having to drill into something, such as pressing the <Info> button or the Right Arrow key. I realize that it may be too difficult to implement to be practical, in which case the request will have to be abandoned, but if not, then I think it would be a good feature.


----------



## jbernardis

lrhorer said:


> Well, actually, no, it doesn't. Evidently your code processes the last "description :" line and discards the others. When I put the following in default.txt
> 
> 
> 
> Code:
> 
> 
> seriesTitle : The Twilight Zone
> description : Volume 43
> description : This is test 2
> description : This is test 3
> description : This is test 4.
> isEpisode : true
> 
> All that shows up in the description window is the text
> 
> 
> 
> Code:
> 
> 
> This is test 4.
> 
> and the only description line displayed in the info pop-up is
> 
> 
> 
> Code:
> 
> 
> Description      This is test 4.


Actually that's accurate and the same way that pytivo does it (since it's the same code basically - or at least it was) Description is a multiline field - it should be entered all together with no new lines in between:



Code:


seriesTitle : The Twilight Zone
description : Volume 43. This is test 2. This is test 3. This is test 4.
isEpisode : true

If you have multiple description lines, each line will successively overwrite the previous, and the last one will be the only one that is kept.

Also, if you have Title information in the metadata:


Code:


Title 1: This is Title 1
Title 2: This is Title 2
Title 3: This is Title 3

then the titles will show up in the information pop-up for the DVD folder (although NOT in the description on the main screen)


----------



## lrhorer

jbernardis said:


> When the hilite is on the DVD Folder line - where the icon is a DVD - if you press the info button, you can see the titles, in title order, in amongst the other meta data.


Oh, I see. When you said, "titles", I was thinking "descriptions".

Is the <Info> button supposed to work on folders in regular shares? I've never had default.txt files in the directories before, but after having put several in the DVD share directories, I put one in a regular share directory. The description shows up in the description panel, but pressing the <info> button elicits a "Bonk!". It works on individual videos and in the DVD share, but not in directories in the regular video shares.


----------



## jbernardis

lrhorer said:


> Is the <Info> button supposed to work on folders in regular shares? I've never had default.txt files in the directories before, but after having put several in the DVD share directories, I put one in a regular share directory. The description shows up in the description panel, but pressing the <info> button elicits a "Bonk!". It works on individual videos and in the DVD share, but not in directories in the regular video shares.


Historically no - when the app was first developed, there was no metadata for folders at all. At some point someone asked to support description on the main screen, so I added the folder.txt to support that, but the only data item of interest was the description.

Then later, when I added support for the info pop-up, I felt that since all that was there for folders was the description, I needn't support folders on the pop-up. But the app actually supports generic folder meta data with no way to currently get at anything other than the description. The info pop-up would be a good place for this.

Let me work on this. I think I will still have the bonk if there is no metadata for the folder.


----------



## jbernardis

Verson 0.7a is now on git. Two changes: 1) added support for info pop-up screen for folders. Current behavior of a bonk sound will continue if there is no metadata available. 2) I am now more defensive if icon files are missing - no icon is displayed instead of an exception being raised.


----------



## lrhorer

Did I mention you really rock?


----------



## lrhorer

Uh-oh. Something's broken, again, and it looks like it's icon related, again. I looked through the icons, and can't find anything obvious:



Code:


Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 560, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/share/pyhme/start.py", line 141, in __init__
    client_address, server)
  File "/usr/lib/python2.6/SocketServer.py", line 617, in __init__
    self.handle()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 323, in handle_one_request
    method()
  File "/usr/share/pyhme/start.py", line 232, in do_GET
    self._page(True)
  File "/usr/share/pyhme/start.py", line 186, 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 1215, in get_event
    handle()
  File "/usr/share/pyhme/vidmgr/__init__.py", line 338, in handle_active
    self.drawScreen()
  File "/usr/share/pyhme/vidmgr/__init__.py", line 800, in drawScreen
    self.drawScreenShares()
  File "/usr/share/pyhme/vidmgr/__init__.py", line 894, in drawScreenShares
    if self.listing[sx]['icon'] == None:
IndexError: list index out of range


----------



## jbernardis

Stupid code-copying error - version 0.7b is now up on git with the fix


----------



## lrhorer

I've come across an anomaly. One of the DVDs has a whole bunch of titles, but as is sometimes the case, the titles are not numbered consecutively. I don't know if that has anything to do with the issue, but vidmgr is not properly handling the titles. The DVD Plug-in apparently is, however. I have the default.txt file set to ignore everything but Title 1 and Title 8. I have a specific metafile for Title 8, but not Title 1. The DVD plugin properly shows and transfers the two videos, but vidmgr only shows one. No errors are generated.

default.txt:


Code:


title : The Mark of Zorro
movieYear : 1940
description : Posing as a foppish coward, Spanish nobleman Diego (Tyrone Power) fights injustice in colonial California. Upon his return from Spain, Diego realizes that Captain Pasquale (Basil Rathbone) is terrorizing the district and levying unreasonable taxes. Disguised as Zorro -- a masked swashbuckler -- the young Spaniard menaces the local authorities, to the delight of all the peasants and his beloved (Linda Darnell).
isEpisode : true
Title 0 : ignore
Title 1 : The Mark of Zorro
Title 3 : ignore
Title 5 : ignore
Title 6 : ignore
Title 8 : The Last Idol - A&E Biography of Tyrone Power
Title 11 : ignore
Title 12 : ignore
Title 13 : ignore
Title 14 : ignore
Title 15 : ignore
Title 17 : ignore
Title 19 : ignore
starRating : x5
mpaaRating : N8
vProgramGenre : Action & Adventure
vProgramGenre : Classic Movies
vProgramGenre : Classic Action & Adventure
vDirector : Rouben Mamoulian
vActor : Tyrone Power
vActor : Linda Darnell
vActor : Basil Rathbone
vActor : Gale Sondergaard
vActor : Eugene Pallette
vActor : J. Edward Bromberg
vActor : Montagu Love
vActor : Janet Beecher
vActor : George Regas
vActor : Chris-Pin Martin
vActor : Robert Lowery

__T08.mpg.txt:


Code:


title : The Last Idol - A&E Biography of Tyrone Power
movieYear : 1996
description : A&E investigates the life and career of film star Tyrone Power.
isEpisode : true
starRating : x5
mpaaRating : N8
vProgramGenre : Biography
vProgramGenre : Documentary
vDirector : Elizabeth Bronstein
vActor : Richard Kiley
vActor : Frederick Lawrence Guiles
vActor : J. Watson Webb Jr.
vActor : Evie Wynn Johnson
vActor : Roddy McDowall
vActor : Annabella Power
vActor : Alice Faye
vActor : Linda Christian
vActor : Piper Laurie
vActor : Taryn Power
vActor : Terry Moore
vActor : Tyrone Power


----------



## jbernardis

lrhorer said:


> I've come across an anomaly. One of the DVDs has a whole bunch of titles, but as is sometimes the case, the titles are not numbered consecutively. I don't know if that has anything to do with the issue, but vidmgr is not properly handling the titles. The DVD Plug-in apparently is, however. I have the default.txt file set to ignore everything but Title 1 and Title 8. I have a specific metafile for Title 8, but not Title 1. The DVD plugin properly shows and transfers the two videos, but vidmgr only shows one. No errors are generated.


Not entirely sure if this is the issue or not, but vidmgr does not know how many Titles it is going to find in the metadata, so it starts at Title 0 and keeps incrementing until it finds a gap. In your case, it won't find Title 8 because there are gaps in the sequence.

I guess I can alter the logic to find all of the keys that match Title xx.

I'm not sure the effect it would have on the dvdvideo plugin, but if you put in ignore lines for the intervening titles, at lease vidmgr would be happy. This would also be a good experiment for me to know if this is the issue.


----------



## lrhorer

Yes, padding the default.txt file with the additional titles seems to make vidmgr happy, and doesn't seem to have any affect on the DVD plug-in. I just noticed something else, though. It looks like vidmgr is pulling the info for actors, director, writers, etc from default.txt, rather than __Txx.mpg.txt. The way vigmgr handles the "Title x :" entries is a bit distracting, too.


----------



## jbernardis

lrhorer said:


> Yes, padding the default.txt file with the additional titles seems to make vidmgr happy, and doesn't seem to have any affect on the DVD plug-in. I just noticed something else, though. It looks like vidmgr is pulling the info for actors, director, writers, etc from default.txt, rather than __Txx.mpg.txt. The way vigmgr handles the "Title x :" entries is a bit distracting, too.


to the first point - I chose to use the same metadata strategy that pytivo uses. Basically it searches for default.txt, <filename>.txt, .meta/default.txt and then .meta/<filename>.txt in that order. If multiple files are found, their contents are merged, so if they have the same keys, a subsequent file will overwrite the same key from a previous file. The only exception to this is the keys that start with a v that usually consist of a list of names. The existing metadata logic will merge this data from ALL of the files it finds.

This seemed like reasonable logic (although I feel that the two default.txt files should be searched before either of the <filename>.txt files) so I just kept it.

As far as the second point, I assume you are referring to the fact that I list the titles on the pop-up infor screen. Again, this was a conscious decision because I wanted to provide that information without requiring that you dive into that "directory".

I am not really using this feature, so if there is a concensus that others want it some other way, I am open to changes. Just give me some requirements.

BTW - did you try the changes I emailed to you? If that works, I want to post it to GIT.


----------



## lrhorer

jbernardis said:


> to the first point - I chose to use the same metadata strategy that pytivo uses. Basically it searches for default.txt, <filename>.txt, .meta/default.txt and then .meta/<filename>.txt in that order. If multiple files are found, their contents are merged, so if they have the same keys, a subsequent file will overwrite the same key from a previous file. The only exception to this is the keys that start with a v that usually consist of a list of names. The existing metadata logic will merge this data from ALL of the files it finds.


That doesn't work very well with DVDs. First of all, the individual titles may have only one detail in common. For example, on the DVD Seabiscuit, the extra documentary does not have any of the actors, the director, or anything else in common with the main video. In The Mark of Zorro, the biography of Tyrone Power only has Tyrone Power in common with the main title. Alfred Hitchcock did not direct The Ghost Goes West, nor are any of the other actors from The 39 Steps other than Robert Donat in the film, but the app displays the text from both files so it looks like Alfred Hitchcock directed and a ton of others starred in The Ghost Goes West. I suppose I could create a specific metafile for the primary film and exclude everything from default.txt. I'll give it a shot.



jbernardis said:


> As far as the second point, I assume you are referring to the fact that I list the titles on the pop-up infor screen. Again, this was a conscious decision because I wanted to provide that information without requiring that you dive into that "directory".


Yeah, but they are listed oddly. First of all, an alphabetic sort, rather than an alphanumeric sort, looks a bit weird. Secondly, it seems to eliminate the text prior to the last hit on the description. Listing all the fields with no sort (other than what is sorted in the metafile), but excluding any "ignore" lines would be better, I think.



jbernardis said:


> BTW - did you try the changes I emailed to you? If that works, I want to post it to GIT.


'Just did. It looks like it is working.


----------



## lrhorer

lrhorer said:


> I suppose I could create a specific metafile for the primary film and exclude everything from default.txt. I'll give it a shot.


Wait, that doesn't really work, either. Then the main folder is missing a bunch of stuff. IMO, the specific files, if they exist, should replace everything in default.txt.


----------



## thomb

I'm sure I've configured something wrong here, hopefully someone can suggest a fix or three -

My goal is to copy 250+ DVDs to my primary windows 7 box and have them accessible from my 2 Tivo HD boxes. Here's what I've done so far -
1) Install Python
2) Install pyTivo
3) Install HME
4) Install Video Manager
5) Install DVD Decrypter
6) Install MetaGenerator

My first pass at installing everything last night was mostly successful. I am able to rip my DVDs and then transfer them to either Tivo box (pulled from the Tivo). However, when I start hme I get a couple errors:
A) "Not using Zeroconf:" (i see this setting in the hme config.ini file set as False, but I'm not sure what it does).
B) "Cache file does not exist - no thumbnails loaded"

And then a message stating "Server Starts", so I'm not sure what problems A & B are causing me, but I suspect HME or video manager is not working correctly for me. From the TV, all I see is the classic Tivo user interface - Now Playing > MyMovies > {the names of the DVDs I've ripped} and the metadata for the movies - except for:
C) No cover art is showing on the Tivo

Finally, the last issue is from a navigation perspective:
D) In order to view the metadata on any movie the navigation is - Now Playing > MyMovies > Gattaca > Video_ts > Gattaca > {and then you can finally read about Uma}. Clearly this is coming from my Windows directories, but is it possible to see the Gattaca listing once and never see Video_ts? That would eliminate two clicks each time. Are there settings to avoid this directory structure or do I have to do it manually for each DVD?


----------



## jbernardis

Don't worry about message B - that is normal on the first startup - there is no cache yet.

Message A is from the hme code itself - usually it means it is unable to import the Zeroconf module, but you also state that it is set as false in the config.ini file - perhaps that is why you are seeing the message.

Zeroconf allows pytivo and pyhme to both find the tivos on the network and to advertise their own services without any specific configuration on your part (hence the name zeroconf). Others on this forum are more versed in this than I am.

As far as your other statements - if you are going through the now playing list, then you are not using vidmgr. pytivo is what is showing the directory structure in this case. If you want to use vidmgr, you need to go into the "Music, Photos, and Showcases" (at least that's what it's called on my S3), wait for the list to be built, and then choose "Pytivo Video Manager" from there.

Get that done, and then we can see where you are.


----------



## thomb

jbernardis said:


> ... if you are going through the now playing list, then you are not using vidmgr. pytivo is what is showing the directory structure in this case. If you want to use vidmgr, you need to go into the "Music, Photos, and Showcases" (at least that's what it's called on my S3), wait for the list to be built, and then choose "Pytivo Video Manager" from there.


That's what I suspected - my HME is messed up somehow. None of the HME apps are showing up in the "music, photos..." menu. Here's my config.ini: 
==================
[hmeserver]
port=7288
address=192.168.1.100
zeroconf=False
basepath=D:\Program Files (x86)\pyhme
datapath=d:\
apps=picture clock vidmgr

[picture]
path=d:\pictures
delay=2
exts=.jpg .png

[vidmgr]
exts=.mpg .mp4 .avi .wmv .m4v

[tivos]
tivo1.name=Downstairs
tivo1.tsn=652-0001-abcd-efgh
tivo2.name=Kitchen
tivo2.tsn=652-0001-ijkl-mnop

[pytivos]
pytivo1.config=D:\Program Files (x86)\pytivo\pyTivo.conf
pytivo1.ip=192.168.1.100
pytivo1.port=9032
pytivo1.sep=\
==========================


----------



## wmcbrine

Just take out the zeroconf=False line. Why is it there?


----------



## thomb

Thanks that fixed it, hme is correctly launching the apps. However, now when I go into vidmgr (from the Tivo) it shows my folder structure, but no videos show up.

Edit:
Problem solved. It seems that I had forgotten to add the .vob extension to the file types in the config.ini. Once I added it everything magically began to show up.

Thanks everyone for your help!


----------



## lrhorer

That should not be necessary, and may not work properly.

If you are ripping your entire DVD to File, then you need pyTivo to set up a virtual file system in order to be able to transfer any or all titles from the DVD. To do this, you need to rip each DVD to a separate directory containing at a minimum a VIDEO_TS directory which holds all the .IFO and .VOB files. In addition, each DVD's directory can optionally contain:

folder.jpg - cover art for the entire folder
default.txt - metadata for the folder
__Txx.mpg.txt - metadata for each title, where xx is the title number
__Txx.mpg.jpg - cover art for each title

Note the first two can be contained in any directory of the DVD share. In order to share these DVDs, however, you will need a section in pyTivo's pyTivo.conf file like the following:



Code:


[DVD]
path = d:\RAID\DVD
force_alpha = True
type = dvdvideo
fast_index = true

So, for example, I have a Robert Donat DVD with two movies on it, The 39 Steps and The Ghost Goes West. Here is the contents of "/RAID/DVD/39 Steps":



Code:


RAID-Server:/RAID/DVD/39 Steps# ll
total 144
drwxrwxrwx  3 lrhorer lrhorer  4096 Jul 26 22:09 .
drwxrwxrwx 54 root    root     4096 Jul 24 13:05 ..
-rwxrw-rw-  1 lrhorer lrhorer   715 Jul 23 06:49 default.txt
-rw-rw-rw-  1 lrhorer lrhorer 33999 Jul 14 01:01 folder.jpg
-rw-rw-rw-  1 lrhorer lrhorer 34648 Jul 14 01:01 __T02.mpg.jpg
-rwxrw-rw-  1 lrhorer lrhorer   857 Jul 26 22:09 __T02.mpg.txt
-rw-rw-rw-  1 lrhorer lrhorer 33999 Jul 14 01:01 __T03.mpg.jpg
-rw-rw-rw-  1 lrhorer lrhorer   962 Jul  1 19:01 __T03.mpg.txt
drwxrwxrwx  2 lrhorer lrhorer  4096 Jun 12 15:52 VIDEO_TS

Title 0 and Title 1 are not videos I care to have on the TiVo in this case, so in default.txt I have:



Code:


movieYear : 1935
description : Robert Donat stars in two 1935 films, Alfred Hitchcock's "The 39 Steps" and Rene Clair's comedy "The Ghost Goes West".
Title 0: Ignore
Title 1: Ignore
Title 2: The Ghost Goes West
Title 3: The 39 Steps
isEpisode : true

__T02.mpg.jpg is the cover art for The Ghost Goes West, __T02.mpg.txt is its metafile, __T03.mpg.jpg is the cover art for The 39 Steps, and of course __T03.mpg.txt is its metadata.

Also, I have four different Harry Potter films still on DVD, so I collect them under a single directory, but I want cover art and metadata for the folder, so in the "/RAID/DVD/Harry Potter" directory I have:



Code:


RAID-Server:/RAID/DVD/Harry Potter# ll
total 156
drwxrwxrwx  6 lrhorer lrhorer   4096 Jul 21 00:49 .
drwxrwxrwx 54 root    root      4096 Jul 24 13:05 ..
drwxrwxrwx  3 lrhorer lrhorer     56 Jul 15 21:10 and the Chamber of Secrets
drwxrwxrwx  3 lrhorer lrhorer     56 Jul 16 21:11 and the Goblet of Fire
drwxrwxrwx  3 lrhorer lrhorer     56 Jul 16 21:11 and the Prisoner of Azkaban
drwxrwxrwx  3 lrhorer lrhorer    122 Jul 26 22:26 and the Sorcerer's Stone
-rwxr--r--  1 lrhorer lrhorer 139436 Jun 14 02:48 folder.jpg

I'll be adding a default.txt file to the directory when I get the chance.


----------



## lrhorer

Now this is not the only way to skin this cat. You can rip the DVD to IFO or to ISO and wind up getting the video to the TiVo, but if you have multi-title DVDs, DVDs with extra features you like, or DVDs with alternate audio tracks you want to manage, then the PyTivo DVD plug-in is the quickest and easiest way to publish the DVD. Jbernardis, the author of vidmgr, prefers to rip to h.24 files for several reasons, as do others, so there is no "right" or "wrong" method, but I definitely prefer the DVD-plug-in.


----------



## jcthorne

I would like to present an idea I have been mulling over for video manager. See what others think, especially Jbernardis since it is HIS program 

A the moment, vidmgr presents a directory of movies in the same hiearchy as the file system on the server. In my case:

Movies
-Genre
--Title

Since vidmger has available to it the year, title, genre, major actors, it would be really cool if the films could be sorted by these items rather than in just filepath order. You could use the same button tivo does in the myshows list to toggle between them. If so the files could better be managed in a flat file path.

Now I realize this would require vidmgr to build a db in the background of all the pertinant data, but the data is there and it does not have to be done before the first normal directory is displayed, only available after the db is built and cached. Harmonium works much this way now for music. I would not see this being done for tv shows but only for movies, but others may have ideas on how to do this as well.

I looked at lrhorer's method of using symlinks but its just too much on going work to maintain and asking for some sort of automation under windows....well, beyond the scope of most current software. I thought an extension of vidmgr that does this would eliminate the need for most of that and make finding a film much easier. 

Heck the db could be built ahead of time by the user and stored as a spreadsheet or other common and easily editable file type.


----------



## windracer

jcthorne said:


> Harmonium works much this way now for music.


Galleon can do that as well (although I personally never use that feature). I believe everything is stored in an Apache Derby database.


----------



## jcthorne

Can Galleon have pytivo PUSH an mp4? Has it been updated to HD menus? I admit to never having actually tried Galleon but I like the menus and graphics we have in vidmgr now, just was hoping for a bit more functionality.


----------



## windracer

No, Galleon doesn't interact with pyTivo at all. I was just pointing out another example of an app that can parse metadata (MP3 tags in this case) and present different sorting/filtering options to the user.

Galleon does have a GoBack feature for video files, which I used sparingly back in the old days before pyTivo, streambaby, and vidmgr.


----------



## lrhorer

jcthorne said:


> I looked at lrhorer's method of using symlinks but its just too much on going work to maintain


I don't do any maintenance, at all. The scripts take care of all the work.



jcthorne said:


> and asking for some sort of automation under windows....well, beyond the scope of most current software. I thought an extension of vidmgr that does this would eliminate the need for most of that and make finding a film much easier.


That's definitely a non-trivial request.

Isn't your Synology NAS Linux based? Why not just modify the scripts I use for use on the Synology system? They will automatically create and delete shares sorted by date, genre, alpha groups, etc.



jcthorne said:


> Heck the db could be built ahead of time by the user and stored as a spreadsheet or other common and easily editable file type.


I do have the scripts create a database, but I've never made any real use of it.


----------



## jcthorne

That would be beyond my current linux capabilities or desire to learn. I no longer run pytivo or vidmgr on the synology box either. I had those two running fine and then started working toward java and harmonium and really mucked up the works. I failed the primary purpose of the NAS...the RAID. I got all the data back and reflashed the NAS back to an updated stock configuration and went back to running all the interface software under windows since the small interface server that used to function as file server was not going away. It does downloads, pytivo, harmonium and system backups.


Anyway, I am back to running all this under windows. The files are all on the NAS. If you think you can give me the scripts and a bit of direction, I'll give them a go under windows. What language are they in?

I did realize my suggested addition to vidmgr was not trivial. Just thought that managing the vids and presenting them in various sort orders was a logical next step if Jbernardis is interested.


----------



## jbernardis

jcthorne said:


> I would like to present an idea I have been mulling over for video manager. See what others think, especially Jbernardis since it is HIS program


It's a great idea, but unfortunately I don't have the bandwidth to tackle that right now. Maybe for vidmgr 2.0 

Of course the downside of a flat file system and relying on metadata is that the PyTivo NPL representation would lose its structure. I'm like you - I have my films all divided into directories by genre, but I also still use the PyTivo pull interface too and I like to see them consistent with one another.


----------



## jcthorne

Available time I really understand.

I no longer use the pytivo pull interface at all since all my video is stored as mp4 and would have to be transcoded to transfer.

My biggest problem with filing by genre is that so many movies belong in more than one category and when I go looking for one....I always am looking in the wrong one. Perhaps using a browse interface for searching is the wrong approach.

Have you seen any easy way to gather the movie meta data into a single file? Getting all of it to a simple spreadsheet would at least allow me an index to keep handy. Suppose I could relearn visual basic and do it in excel.


----------



## lrhorer

jcthorne said:


> Anyway, I am back to running all this under windows. The files are all on the NAS. If you think you can give me the scripts and a bit of direction, I'll give them a go under windows. What language are they in?


Bash. I know there are at least a couple of bash interpreters for Windows out there. I have no idea how well they work or whether they support any of the newer bash forms. A better solution might be Take Command.


----------



## lrhorer

jcthorne said:


> My biggest problem with filing by genre is that so many movies belong in more than one category and when I go looking for one....I always am looking in the wrong one.


You may have lost me, there.



jcthorne said:


> Perhaps using a browse interface for searching is the wrong approach.


If you are going to relegate the function to a PC, rather than the TiVo, then what I would do is write CGI scripts that relegate the functions to a web page. You can use Perl, PHP, or whatever to write the script, and arrange the database any way you like. Indeed, you could create the data base using whatever database manager you like. I'm doing that very thing here.

You will have to either run a web server on one of your machines, or else purchase a web page from one of the myriad web hosting services.



jcthorne said:


> Have you seen any easy way to gather the movie meta data into a single file? Getting all of it to a simple spreadsheet would at least allow me an index to keep handy. Suppose I could relearn visual basic and do it in excel.


Collecting the relevant data into a single file is not difficult. 'Simply parse the metafiles and extract the fields into a database file. A tab-delimited file would work, or perhaps semicolon. Extracting a page for display filtering by genre is also not difficult.


----------



## lrhorer

Here are the scripts I use to manage the links (among other things).


----------



## philhu

Hi

I just added your vidmgr to my pyhme installation...fyi-Pyhme worked fine before this was added.

Iadded to the config, and restarted HME, get the following error:

C:\Program Files\TiVo\hme-vlc kit>start.py
HME Server for Python 0.17
Traceback (most recent call last):
File "C:\Program Files\TiVo\hme-vlc kit\start.py", line 352, in <module>
app = __import__(name)
File "C:\Program Files\TiVo\hme-vlc kit\vidmgr\__init__.py", line 14, in <modu
le>
print time.asctime(), TITLE + " version " + version + " starting"
NameError: name 'time' is not defined

C:\Program Files\TiVo\hme-vlc kit>

It looks like a pretty basic error. Any idea what I did wrong? Looks like it can't even use the time function?


----------



## jcthorne

Thanks for your usual very detailed response. I often learn quite a bit from them even if they only lead me in directions I had not considered before. That can be a good thing :up:



lrhorer said:


> You may have lost me, there.


By example, From Russia With Love belongs in each of the following Genre

Classics
Action Adventure
Thrillers

In my case its located in the Action & Adventure directory but I would just as likely go looking for it in the Thrillers or Classics sections. Symlinks could help with this but I still am not sure I can make this work effectively under windows. The basic problem being that windows does not keep track of the links. When the base file is moved, renamed or deleted, the symlinks do not get updated and now point to the wrong place.


----------



## jcthorne

lrhorer said:


> If you are going to relegate the function to a PC, rather than the TiVo, then what I would do is write CGI scripts that relegate the functions to a web page. You can use Perl, PHP, or whatever to write the script, and arrange the database any way you like. Indeed, you could create the data base using whatever database manager you like. I'm doing that very thing here.
> 
> You will have to either run a web server on one of your machines, or else purchase a web page from one of the myriad web hosting services.
> 
> Collecting the relevant data into a single file is not difficult. 'Simply parse the metafiles and extract the fields into a database file. A tab-delimited file would work, or perhaps semicolon. Extracting a page for display filtering by genre is also not difficult.


I would like the info presented to the user on the tivo, not on a pc. Away from the tivo, a simple spreadsheet database is sufficient. dlfl provided a simple utility to do just that:

metatoexcel

My Synology box has a built in simple web page server so could to that but its not for the pc, I need it on the tivo.

Thanks for the scripts. I am studying them for ideas but at the moment don't see how to use them or similar under windows in an effective manner.


----------



## philhu

philhu said:


> Hi
> 
> I just added your vidmgr to my pyhme installation...fyi-Pyhme worked fine before this was added.
> 
> Iadded to the config, and restarted HME, get the following error:
> 
> C:\Program Files\TiVo\hme-vlc kit>start.py
> HME Server for Python 0.17
> Traceback (most recent call last):
> File "C:\Program Files\TiVo\hme-vlc kit\start.py", line 352, in <module>
> app = __import__(name)
> File "C:\Program Files\TiVo\hme-vlc kit\vidmgr\__init__.py", line 14, in <modu
> le>
> print time.asctime(), TITLE + " version " + version + " starting"
> NameError: name 'time' is not defined
> 
> C:\Program Files\TiVo\hme-vlc kit>
> 
> It looks like a pretty basic error. Any idea what I did wrong? Looks like it can't even use the time function?


Ping

This seems a fundamental error, but I cannot get around it, please, anybody?


----------



## philhu

Ok, got past my previous error, editted out the time part of the line 

No it seems to work well, except, when I say push file and try to push, I select the tivo to push to, any selection returns a button labelled: 

'Exception during push request'

Any ideas why? The console log shows nothing except, 'vidmgr exitting'

I tried to push .avi, .mp4, all caused exceptions as described.


Also, does vidmgr support .mkv files?

I added .mkv to the config and it now sees and describes the episodes, but it gets exception too.

BTW, the hme stuff and pytivo work perfectly......


----------



## lrhorer

jcthorne said:


> By example, From Russia With Love belongs in each of the following Genre
> 
> Classics
> Action Adventure
> Thrillers
> 
> In my case its located in the Action & Adventure directory but I would just as likely go looking for it in the Thrillers or Classics sections.


OK, I see what you are saying. You only have it extant under one category. It was this very dilemma that prompted me to start down this path.



jcthorne said:


> Symlinks could help with this but I still am not sure I can make this work effectively under windows.


It will definitely be more difficult than in Linux. Once again, Take Command may help. Cmd.exe is really awful.



jcthorne said:


> The basic problem being that windows does not keep track of the links. When the base file is moved, renamed or deleted, the symlinks do not get updated and now point to the wrong place.


Linux does not, either. Hypothetically it could be possible for an OS to keep track of symlinks, but it's probably not practical. That means the app has to do it, or else the user. In the files I posted, the `Verify` routine is run manually to add a title to the list of verified movies (which means basically it has been edited to suit my tastes and has been pushed to a TiVo to make sure it transfers without error.) In addition to adding it to the verified list of movies, it also asks the user to classify the video by genre. All of this could fairly easily be automated to pull the info from the metafile, should one choose to do so, and it could be run once an hour, say. The Windows scheduler is quite pathetic, but it is sufficient for this task.

I have set up the `Verify` routine so the user does not have to enter the entire video name. Any part of it is sufficient to bring up a list of all videos whose names contain the string. Thus, for the video "Raiders of the Lost Ark (Recoded Sun Jan 07, 2004, HBOHD)" one need only enter the string "raid" or "ark". Of course, using as common a string as "ark" may bring up more than one video name. On my server, it brings up 14 different names. The user simply enters the number of the video in question from the list. Note coding this was very easy using the Linux command `find`. It will be more difficult under cmd.exe. Take Command may have a suitable function, I don't know.

Once the user has selected the video, the `Verify` routine cleans up all the temporary files that went into creating the video, and then it checks to see if the video is already listed as being verified. If not, it renames the video to eliminate leading articles ( "The" or "A" ) by calling the routine `Rename`.

Once this is all done, the `Verify` script calls the routine `Vlinks`, which creates all the links based upon the users selections. Again, a list of 25 genres is displayed for the user, and the user selects which ones apply. As I mentioned, this could be easily automated to pull the info from the metafile, requiring no user input at all. My biggest issue with this - and the reason I do not do it - is the genre data may be missing or IMO incorrect in the metafile. That, and the genre info in the metafiles encompasses more genre specifications than I care to consider.

At the very end of the `Verify` script, I also run the `GroupAlpha` routine, which creates a symlink to every video from a directory whose name name is equal to the first letter of the name of video (or "0-9" if the first character is a number). This share allows me to find a video by name in the NPL or vidmgr very quickly, despite having literally thousands of videos on the server. I also run the `GroupAlpha` routine under cron twice an hour.

If the user moves the file, the `Verify` routine will need to be run again. (Or if the user is not concerned about the verification aspect, one could simply run `Vlinks` directly on the fully qualified file name.) With little trouble, this could also be easily automated to run every hour or so if the `Vlinks` routine were modified to pull the info from the metadata.

Obviously, none of this takes care of any broken links caused by moving or deleting the file. To handle this, I have the routine `AuditDatabase`, which also runs twice an hour. It first checks for broken links, removing any it finds. Then it updates the database of movies with any links it finds that do not have any corresponding genre entry in the database (this functionality could be removed if the system obtains the genres from the metafiles). Finally, it creates any links that are missing according to the database.

I also manage the video system using the script `VideoScribe`. This typically runs automatically twice an hour, although I frequently run it manually. Among other things, it creates links for all videos that have not yet been verified in a share labeled "Unverified". That way I can easily tell which videos have not been verified, and when I select them to push to one of the TiVos, they are all collected in a single folder named "Unverified". It also calls the script `DateGroup`, which creates links to every video based upon its recording date (not the file create or modify time) in reverse order - newest first. This share allows me to quickly choose from among the videos which have been most recently recorded.


----------



## lrhorer

jcthorne said:


> I would like the info presented to the user on the tivo, not on a pc. Away from the tivo, a simple spreadsheet database is sufficient. dlfl provided a simple utility to do just that:
> 
> metatoexcel


Personally, I would choose a much more portable method than this. It's fairly trivial to implement, even using cmd.exe. 'Just parse the metadata using the cmd.exe "find" command and spit it out to a delimited database file. Excel can read tab or semicolon delimited files.



jcthorne said:


> My Synology box has a built in simple web page server so could to that but its not for the pc, I need it on the tivo.


Short of writing some HME or HMO code, links are the only way I know to handle this. They can be easily implemented directly on the Synology system, even with your TiVo servers running on a Windows PC, or they can be implemented atop SMB on the Windows PC. They don't haveto be symlinks, BTW. If they are on the NAS, then they can be hard links, which might make things easier for you. I chose symlinks because I needed the links to span physical volumes, which hard links cannot do.



jcthorne said:


> Thanks for the scripts. I am studying them for ideas but at the moment don't see how to use them or similar under windows in an effective manner.


The algorythms for the most part will work under any script language, including cmd.exe. The issue is Windows does not provide the vast library of external functions like `find` and `select` that *nix does, nor does cmd.exe provide them internally. It's also vastly less powerful than any of the *nix shells, although it is possibly sufficient to the task at hand, which is not very complex.

It's probably simpler to implement them on the NAS, but certainly it is not impossible in Windows under a Windows based interpreter - even cmd.exe.


----------



## jbernardis

philhu said:


> Ping
> 
> This seems a fundamental error, but I cannot get around it, please, anybody?


I can't say what's wrong here - this is the third executable line in the file. What version of python are you using? I assume it's not 3.x; vidmgr (and I believe pyhme) requires 2.7 or thereabouts - but hasn't been tested with 3.

I noticed that I didn't have an import statement for time - not sure if it's required - but you could try that - add an "import time" statement above the print statement. I can only assume that if it's necessary, then I was getting the definition of time from the "from hme import *" statement, and you and I are running different versions of pyhme (I'm running 0.18 BTW).

As far as the other issue you are having, vidmgr does not do the actual pushing - it makes an HTTP request to PyTivo to do this. Are you certain that you have your PyTivo information correct in your config file? The message you quoted "Exception ..." occurs when the URL Open request fails. This usually indicates a bad IP address or port for PyTivo, an incorrect TSN or an incorrect share name.


----------



## philhu

Ok. Ill check

I know ip is right as hme runs on pytivo
Box. It reads the pytivo shares as it shows the
Folders

The ports match. I dont need to specify tivo
Ip addrs right? Pytivo finds them, correct?


----------



## jbernardis

philhu said:


> Ok. Ill check
> 
> I know ip is right as hme runs on pytivo
> Box. It reads the pytivo shares as it shows the
> Folders
> 
> The ports match. I dont need to specify tivo
> Ip addrs right? Pytivo finds them, correct?


That's no guarantee that the IP addresses are correct. Vidmgr does not use pytivo to browse the files - it just goes to the directories themselves. The only time the ip addresses are used is to make the push request.

NOTE: This is the IP address of pytivo that you need to specify - not the IP address of the tivos themselves.


----------



## jcthorne

I spent some time this weekend getting an education on windows NTFS hardlinks and junction points. Also learning that when they are applied to entries on a NAS server emulating an NTFS file system, things can be a bit different.

I found a useful shell extension for windows file manager that greatly assists with the creation and management of hardlinks. It also shows which files have more than one link by modifying the icon in file manager. Works pretty slick. Moving the links or files does not destroy the links as long as they remain on the one volume.

Using the tools, I was able to move all my movies to an alpha storage system and then create links for a genere storage set. 

The end result is that vidmgr now presents the user both alpha and genre menus. Was not as diffecult as I had thought once I determined to learn how they work.

Thanks to lrhorer and orangeboy for the pointers and info. I still do not have it automated but now that I understand the process, that seems almost possible.


----------



## jbernardis

jcthorne said:


> I found a useful shell extension for windows file manager that greatly assists with the creation and management of hardlinks. It also shows which files have more than one link by modifying the icon in file manager. Works pretty slick.


Do you have a link for us?


----------



## jcthorne

Sure:

http://www.softpedia.com/get/System/OS-Enhancements/HardLink-ShellExtension.shtml

Pretty good documentation at the owners website:

http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html


----------



## philhu

jbernardis said:


> That's no guarantee that the IP addresses are correct. Vidmgr does not use pytivo to browse the files - it just goes to the directories themselves. The only time the ip addresses are used is to make the push request.
> 
> NOTE: This is the IP address of pytivo that you need to specify - not the IP address of the tivos themselves.


Thanks!

I has a typo in my config, 192.168.1.2083 is definitely not valid 
\


----------



## jbernardis

Glad you found the problem. 

Regarding the time issue, I learned when I got home that I definitely need the import statement. Not sure why it was working for me (and others) but not for you, but the next release of the code will have the import statement. I hope to be releasing it in the next day or so - just doing some testing right now.


----------



## philhu

Hey. I got this working to all 3 tivos

Anyone else see a problem where the wrong
Episode of a show transfers? It pushes,
but not the episode I select

Anyone else ever see that?


----------



## jbernardis

philhu said:


> Hey. I got this working to all 3 tivos
> 
> Anyone else see a problem where the wrong
> Episode of a show transfers? It pushes,
> but not the episode I select
> 
> Anyone else ever see that?


I never saw that happen, and nobody has reported it either. Do you have specifics that would help debug?

vidmgr does not know that it is an episode of a show - it's just a video file that exists in a directory with a bunch of others. The behavior of a collection of movies in a directory would be no different, so there is plenty of opportunity for this to have shown up - but nobody else has reported it.


----------



## windracer

philhu said:


> Anyone else see a problem where the wrong
> Episode of a show transfers? It pushes,
> but not the episode I select


Maybe you have a disconnect between the filename of your metadata file and the actual content? Like, the file is named for Episode 2 but the text inside it is for Episode 3? So you see the Episode 3 text in vidmgr but the corresponding video file is actually Episode 2?

(not sure I explained that clearly, but hopefully you get the gist ...)


----------



## jbernardis

windracer said:


> (not sure I explained that clearly, but hopefully you get the gist ...)


Makes sense to me and is a very viable way that this could happen.


----------



## jbernardis

I have posted version 0.7c of the app to git. This release has a few changes that I've been working on with lrhorer over the past couple of weeks. Two major changes:
1) better logic for scanning titles in dvdvideo directories. I used to stop at gaps in the numbering sequence - not anymore - also titles are sorted more intelligently.
2) some changes in the way metadata is merged from multiple files. If this is not an issue to you, the default behavior will have no affect on you. However, there are a couple of new options for the config file that control how this is to be done. More information can be found in the changelog and readme files.

One other minor change - I added an import statement for the time module which apparently I was missing. Not sure how this hasn't surfaced before, but hopefully it's fixed now.


----------



## lrhorer

Don't forget the title numbering in the metafile starts with 0, but the first video on the disk is Title 1. Title 0 is the longest piece of contiguous video on the disk, regardless of the order on the disk. In some case, this content could be the same as #2, or #5, etc. Also, the "cover" video may not come before some other video. For example, I have a Robert Donat DVD whose cover video is The 39 Steps, that being the more famous of the two enclosed videos. There are two movies on the DVD, however, the other being The Ghost Goes West. As it happens, The Ghost Goes West is a few minutes longer than The 39 Steps, and the first videos is just a short clip, so Title 0 is The Ghost Goes West, Title 1 is nothing, Title 2 is The Ghost Goes West, and Title 3 is The 39 Steps. I have pyTivo and vidmgr ignore Titles 0 and 1.

Note also the order the videos are listed on the cover are not necessarily the order on the disk itself. I have several multi-episode DVDs whose Titles do not fall in the same order they are listed on the disk.


----------



## philhu

windracer said:


> Maybe you have a disconnect between the filename of your metadata file and the actual content? Like, the file is named for Episode 2 but the text inside it is for Episode 3? So you see the Episode 3 text in vidmgr but the corresponding video file is actually Episode 2?
> 
> (not sure I explained that clearly, but hopefully you get the gist ...)


i'll retry this problem with a few more, and the one that failed to see if it was intermittent. The txt meta file matches the file that I selected and if I use pytivo to do the transfer, it picked up the correct episode.

I'll post after I attempt it again


----------



## dlfl

thomb said:


> .......
> B) "Cache file does not exist - no thumbnails loaded"
> .........





jbernardis said:


> Don't worry about message B - that is normal on the first startup - there is no cache yet.
> ...........


I just installed vidmgr -- very slick! It seems to be running OK but in addition to the message thomb mentions above, I also get this message:

"error opening thumbnail cache file for write"

Is this also normal, i.e., because there is no cache yet? The thumbnails seem to be working OK although I need to add them for most of my videos.


----------



## jbernardis

No that's not normal. The thumbnail cache is written into the vidmgr subdirectory from the current directory. Normally the current directory is the same directory as the pyhme python code, and it has a subdirectory named vidmgr (there the vidmgr code resides). This means that under normal situations, the cache is written into the same directory as the vidmgr python code. Perhaps you are either working in a different directory structure, or you have the directory write-protected?

If it can't write the cache, it will create a new one every time you restart. Not the end of the world, but you might lose a little response time until the cache is built up again


----------



## dlfl

Thanks, I found the problem immediately -- I once again made the mistake of installing a program in the Program Files folder tree on Win7, where programs generally do not have write access to data files residing there. And where if you try to edit or replace a file (e.g., config.ini), it will most likely put the replacement file in a virtual folder with no clue to the user until the file still behaves like the old file.

I've moved my entire pyhme and vidmgr folder tree under a new folder I created call "programs" and I no longer get the error message and I can see the cache file that has been created in the vidmgr subfolder.

There are solutions such as placing data files in the %APPDATA% folder that avoid these issues but a simple solution is just don't put such programs in the Program Files folders. Maybe it would be good to put a warning about this in the readme (?).


----------



## cweb

I got Video Manager mostly working on my mac. One problem I'm still having is displaying the shows' poster image. An example of my setup is a follows: my main directory is TivoShows, it has a folder named Supernatural, it contains the files Supernatural Ep116 2010-10-26 Shadow.mpg and Supernatural.jpg. Shouldn't the image in Supernatural.jpg show up when I am looking in the Supernatural folder? Am I not understanding it correctly?


----------



## jbernardis

cweb said:


> I got Video Manager mostly working on my mac. One problem I'm still having is displaying the shows' poster image. An example of my setup is a follows: my main directory is TivoShows, it has a folder named Supernatural, it contains the files Supernatural Ep116 2010-10-26 Shadow.mpg and Supernatural.jpg. Shouldn't the image in Supernatural.jpg show up when I am looking in the Supernatural folder? Am I not understanding it correctly?


No - The file either has to be named "folder.jpg" in which case it will be displayed for all videos in the folder that do not have their own image file, or "Supernatural Ep116 2010-10-26 Shadow.mpg.jpg" in which case it will be shown for ONLY this video file. The jpg files can either be in the same directory as the mpg file, or they can be in a subdirectory from THAT directory named ".meta". If you are using windows, you will probably have some difficulty creating a directory named .meta from the GUI - it's a lot easier from a command line.


----------



## cweb

That fixed it. Now I see the images. I just misunderstood what you meant by folder.jpg.


----------



## jbernardis

Several weeks ago someone asked for a feature whereby they could classify their videos by genre, or other
metadata. I said then that although I thought it was a good idea, I didn't have the bandwidth for it and
that perhaps it would be put into version 2.0.

Well I am happy to announce version 2.0 of vidmgr.

First, though, I have to acknowledge the assistance of lrhorer. I have a reasonable setup in my home
for testing this app, but to nowhere near the stress levels that he could put it to. His assistance in 
testing and debugging were more than invaluable - this couldn't have been done without him - or if it
HAD been done without him, it would have been released with some really bad bugs. Of course that's
not to say that there's not a bug or two still lurking in there...

For those of you that don't know, PyTivo video manager (vidmgr) is an HME application that allows you to
request that videos in your library be "Pushed" to your tivo instead of the normal pull. Since it's an
HME app, this request can be made from your easy chair with your tivo remote. Pushing allows videos that
are in a compatible MP4 format to be transferred as is - saving time and space - instead of the transcoding
that a pull will always cause (although a push can also be requested for a video format that requires
transcoding). vidmgr can also be used to delete videos from your library.

Version 2.0 is a complete rewrite of the application with better, more object-oriented code. Among the
improvements that will be visible to users:
1.) The video information is obtained from a cache instead of being read from the disk. The cache
can be built when the program starts up, or ahead of time - at your choice. The advantage of
building the cache ahead of time is that you can get more complex in terms of the way the 
cache is built (you can still build a complex cache at thread start time if you are willing to
tolerate a delay - my ARM based NAS builds the cache for my 400 video library in about 5 seconds.)
The cache supports the ability to create "virtual" shares that are based on metadata, including any
metadata that you may have added yourself. So, for example, you can create a "virtual" share for
John Wayne movies, or you can have a virtual share that breaks the videos down by genre.

2.) You now have the ability to change options on a directory by directory (or virtual share) basis.
You want this directory sorted on episode number and that one sorted on show title - no problem.
Sorting can now be done based on ANY combinations of strings from the metadata. You can also control
the display "name" for a video file based on the directory (or virtual share).

3.) the user interface was cleaned up - there is no longer a menu choice for push/delete. Pushing is
accomplished by pressing the select button - if you have multiple tivos a dialog box will pop-up
over the display so you can choose the proper target. Delete is accomplished by pressing clear. 
Again, a dialog box will pop-up asking for confirmation.

There are many other changes as well, but they are more subtle and/or are not visible to a user.

There is one limitation over the original program - This is for HD only. If the application finds that
your tivo does not support an HD resolution, it simply exits.

vidmgr is a TiVo HME application designed to operate under wmcbrine's hme for python
framework. It is NOT a stand-alone application. Please install the pyhme package (I have tested with version 0.19)
and make sure it is running before you install vidmgr.

Vidmgr is designed to operate in conjunction with the PyTivo transcoding server - If you are not 
using pytivo, then there is no point in installing vidmgr. I have tested vidmgr with the mcbrine
fork of pytivo. I am not familiar with the other forks to know whether or not it will run there.

The link to GIT is in my signature.


----------



## windracer

Hate to be the first post after your announcement with a problem, but I can't get 2.0 to work. As soon as I select it from my TiVo, it crashes with this:



Code:


HME Server for Python 0.19
Mon Sep 19 21:06:58 2011 PyTivo Video Manager version 2.0 starting
Cache file does not exist - no thumbnails loaded
Mon Sep 19 21:06:58 2011 Server Starts
Registering: vidmgr
192.168.1.71:53360 - - [19/Sep/2011 21:07:08] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.71:53360 - - [19/Sep/2011 21:07:08] Starting HME: vidmgr
----------------------------------------
Exception happened during processing of request from ('192.168.1.71', 53360)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "./start.py", line 141, in __init__
    client_address, server)
  File "/usr/lib/python2.7/SocketServer.py", line 639, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 343, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 331, 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/tivo/pyhme/hme.py", line 1134, in mainloop
    self.startup()
  File "/usr/local/tivo/pyhme/vidmgr/__init__.py", line 93, in startup
    self.opts = config.load()
  File "/usr/local/tivo/pyhme/vidmgr/Config.py", line 121, in load
    n = int(value)
ValueError: invalid literal for int() with base 10: ''
----------------------------------------

Looks like something related to loading the infolabelpercent value from the config file?

2.0 sounds great ... can't wait to check it out.


----------



## jbernardis

What's the value you have for infolabelpercent?

I expect an integer - perhaps I should protect that with a try block, but first let's see if it's just a bad value or if it's something else.

EDIT: looks like you just left the blank entry that came in the dist file. Sorry to mislead - that was just meant as a pattern to be followed - you need to specify a value or 
if there is a definite default, just comment out the line


----------



## windracer

jbernardis said:


> EDIT: looks like you just left the blank entry that came in the dist file. Sorry to mislead - that was just meant as a pattern to be followed - you need to specify a value or if there is a definite default, just comment out the line


Ah, ok. Yeah, I have a lot of "blank" settings lines in there because I thought that's what would trigger the default. I'll go through my .ini file and try again.

Update: ok, now I'm getting this:



Code:


ConfigError: Error in ini file.  Section hmeserver needs tags or values option

The only place I can find the [hmeserver] section is in my main pyhme config.ini file, which I thought vidmgr doesn't use anymore? Still stuck ...


----------



## jbernardis

Sorry about that. The decision to move from config.ini to my own config file was made late in the development, and I forgot to go back and test the situation where the cache was built dynamically. If you had pre-built the cache, this would have worked fine. But in any event, you discovered the error - so now it's fixed.

I updated GIT. FYI - only 1 file changed - __init__.py


----------



## txporter

When you say it only works with HD now, do you mean I need to have HD menus enabled to use it?


----------



## lrhorer

txporter said:


> When you say it only works with HD now, do you mean I need to have HD menus enabled to use it?


No. That would be limited to the Premier. It has to be an HD capable TiVo. It works fine with S3 and THD TiVos. It works with the THD in the guest room with an NTSC monitor attached, but it looks horrible. I also have an NTSC capture device attached to my TiVo in the theater, and it looks much better.


----------



## windracer

jbernardis said:


> But in any event, you discovered the error - so now it's fixed.


Yep, thanks! Now to play with the new features ...


----------



## jbernardis

windracer said:


> Yep, thanks! Now to play with the new features ...


Haven't heard back from you. I guess no news is good news??


----------



## windracer

Heh, sorry about that.

Yes, so far so good. Using the virtual tags shows me just how dirty generated metadata can be. For example, if I use the high-level Genre tags I get all sorts of weird groups. I haven't had time to play with the values filters much yet, but it looks like you can do some cool stuff with the virtual shares.


----------



## jcthorne

When I open vidmgr.ini.dist in notepad, I get a very unformated mess of text. Turning on word wrap does not help. Its obvious from the odd characters in the data that some other utility is intended for viewing and editing this file.

What am I supposed to be using as notepad is not workable for the file as is.

EDIT: Opening the .ini file in wordpad seems to work.


----------



## jcthorne

Next question,

I have one video share in pytivo. It contains directories for movies, tv shows and concerts. When creating a virtual share, such as Movies by Genre, I only want items inthe movies directory, not from the tv shows. How do I specify that it only include items from specific directories? Do I have to create multiple video shares in pytivo?


----------



## jcthorne

Launching pythonHME I get the following error:

Skipping: vidmgr2 - No module named win32file


----------



## windracer

jcthorne said:


> When creating a virtual share, such as Movies by Genre, I only want items inthe movies directory, not from the tv shows. How do I specify that it only include items from specific directories?


I was trying something like this too, using a values of isEpisode=false but wasn't having good luck with it.


----------



## Tobashadow

jcthorne said:


> Launching pythonHME I get the following error:
> 
> Skipping: vidmgr2 - No module named win32file


I just went thru that today, this was what i needed to install to fix it.

http://sourceforge.net/projects/pywin32/files/pywin32/Build216/pywin32-216.win32-py2.6.exe/download


----------



## Tobashadow

Is there a easier way to read the vdmgr config file in windows?

In notepad all i get is one huge nonstop paragraph and its making it hard to understand where i make my edits.


----------



## Tobashadow

Tobashadow said:


> Is there a easier way to read the vdmgr config file in windows?
> 
> In notepad all i get is one huge nonstop paragraph and its making it hard to understand where i make my edits.


Nevermind found one.

For future users - http://notepad-plus-plus.org/


----------



## Tobashadow

Ok im lost, i edited the config file and i still get the same error.

vidmgr\Config.py line 66

vidmgr configuration file does not exist


----------



## windracer

Make sure you just named it vidmgr.ini (take off the .dist).


----------



## Tobashadow

windracer said:


> Make sure you just named it vidmgr.ini (take off the .dist).


Well that got past that error now i get a vidmgr instance has no attribute vcChanged error.

Damn this is frustrating there is very little documentation on this.


----------



## Tobashadow

Tried commenting out all settings but the pytivo and tivo settings and still get same error.

Verified Tivo settings and numbers and pytivo settings.


----------



## jbernardis

Tobashadow said:


> Is there a easier way to read the vdmgr config file in windows?
> 
> In notepad all i get is one huge nonstop paragraph and its making it hard to understand where i make my edits.


I use vim, but I guess that's only friendly to those of us who have used vi on Unix. There is absolutely no special formatting being done in the file - so I don't know why notepad has a problem with it. Maybe a programmer's editor would be better - there are lots of freeware editors.

I think the problem might be with the difference between the way Windows handles end-of-line versus how unix does it.


----------



## jbernardis

Tobashadow said:


> Well that got past that error now i get a vidmgr instance has no attribute vcChanged error.
> 
> Damn this is frustrating there is very little documentation on this.


Can you provide the exact error text?

Also, could you let us know what your directory structure looks like - what files are in what directory - and how you invoke the program?


----------



## jbernardis

jcthorne said:


> Launching pythonHME I get the following error:
> 
> Skipping: vidmgr2 - No module named win32file


What version of python are you running? win32file was included in my python distribution and I am at 2.7. It's only imported if you are running on a windows system.


----------



## windracer

jbernardis said:


> I think the problem might be with the difference between the way Windows handles end-of-line versus how unix does it.


That's definitely the case. I run vidmgr on Linux, but I tried opening the vidmgr.ini file in my default editor (Notepad++) and Windows Notepad. Notepad is definitely not interpreting the Unix-style CR/LFs properly. Notepad++ is just fine.


----------



## Tobashadow

here yha go, i get this when i try to go into the program from the Tivo and get nothing but a black screen on the Tivo

No issues with standard Pytivo or pushing from a the web interface for Pytivo.


----------



## jbernardis

Tobashadow said:


> here yha go, i get this when i try to go into the program from the Tivo and get nothing but a black screen on the Tivo
> 
> No issues with standard Pytivo or pushing from a the web interface for Pytivo.


The vcChanged error is not important here - it's a bug that has to be fixed, but it's only coming out because the cleanup routine is being called before I expected it. This routine is called by pyhme when the app is being torn down. The real question is why is it trying to tear the app down.

Is there ANY other output form the program before this point, and what are the contents of your vidmgr.ini file - don't forget to mask out your TSN's before uploading your config file.


----------



## Tobashadow

Edited



Code:


# vidmgr.ini
#
# this is the global options file - it belongs in the vidmgr directory under pyhme
#
# Default values are specified below
#
[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 .  
#      default: exts=.mp4 .mpg .avi .wmv
#
exts=.mp4 .mpg .avi .wmv .mkv

# 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.
#       default: metaignore=isEpisode isEpisodic
#                metafirst=title seriesTitle episodeTitle description
#                metaspacebefore=
#                metaspaceafter=
#
#metaignore=isEpisode isEpisodic
#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
#      default: infolabelpercent=30
# 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.
#      default: inforightmargin=20
#
#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.
#      default: metamergefiles=True
#
# 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.
#      default: metamergelines=False
#
#metamergefiles=True	
#metamergelines=False

# specify the point size of the font used to display the descriptive text of a video on the main screen
#      default: descsize=20
#
#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.
#      default: skin=
#
#skin=

# 
# can the files in this directory be deleted - specify true or false.  
#
#      default: deleteallowed=True
#
deleteallowed=True

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

#
# 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.
#      default: display=title episodeTitle
#
#display=title episodeTitle

# what string should be used to separate the above metadata when constructing the title string
# specify an arbitrary string
#      default: displaysep=:
#
#displaysep=1

#
# 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 '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.
#      default: sort=title episodeTitle
#
#sort=title episodeTitle

#
# which direction should the sort be
# specify up for an ascending sort or down for a descending sort
#      default: dortdirection=up
#
#sortdirection=up

# 
# the next option controls the contents of the fop of the navigation tree.  If 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 ths is set to false, then each share will be on the top screen.
#      default: sharepage=true
#
#sharepage=true

#
# 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=Main Menu




#
# 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=Living Room
tivo1.tsn=649000180xxxx 
tivo2.name=Bedroom
tivo2.tsn=649000180xxxxxx


# 
# 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]
pytivo1.config=C:\Users\Public\Documents\pyTivo\pyTivo.conf
#pytivoX.sep=
pytivo1.ip=192.168.1.125
pytivo1.port=9033
#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 three 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, inclding your own, or titleNumber which is the
# title number for DVD videos.
#
#
# 3. 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 option, 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=seriesTitle

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


----------



## jbernardis

Tobashadow said:


> Edited
> 
> 
> 
> Code:
> 
> 
> # vidmgr.ini
> #
> # this is the global options file - it belongs in the vidmgr directory under pyhme
> #
> # Default values are specified below
> #
> [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 .
> #      default: exts=.mp4 .mpg .avi .wmv
> #
> exts=.mp4 .mpg .avi .wmv .mkv
> 
> # 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.
> #       default: metaignore=isEpisode isEpisodic
> #                metafirst=title seriesTitle episodeTitle description
> #                metaspacebefore=
> #                metaspaceafter=
> #
> #metaignore=isEpisode isEpisodic
> #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
> #      default: infolabelpercent=30
> # 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.
> #      default: inforightmargin=20
> #
> #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.
> #      default: metamergefiles=True
> #
> # 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.
> #      default: metamergelines=False
> #
> #metamergefiles=True
> #metamergelines=False
> 
> # specify the point size of the font used to display the descriptive text of a video on the main screen
> #      default: descsize=20
> #
> #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.
> #      default: skin=
> #
> #skin=
> 
> #
> # can the files in this directory be deleted - specify true or false.
> #
> #      default: deleteallowed=True
> #
> deleteallowed=True
> 
> #
> # specify how you would like the artwork for a video to be justified - specify left, center, or right
> #
> #      default: thumbjustify=left
> #
> #thumbjustify=left
> 
> #
> # 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.
> #      default: display=title episodeTitle
> #
> #display=title episodeTitle
> 
> # what string should be used to separate the above metadata when constructing the title string
> # specify an arbitrary string
> #      default: displaysep=:
> #
> #displaysep=1
> 
> #
> # 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 '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.
> #      default: sort=title episodeTitle
> #
> #sort=title episodeTitle
> 
> #
> # which direction should the sort be
> # specify up for an ascending sort or down for a descending sort
> #      default: dortdirection=up
> #
> #sortdirection=up
> 
> #
> # the next option controls the contents of the fop of the navigation tree.  If 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 ths is set to false, then each share will be on the top screen.
> #      default: sharepage=true
> #
> #sharepage=true
> 
> #
> # 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=Main Menu
> 
> 
> 
> 
> #
> # 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=Living Room
> tivo1.tsn=649000180xxxx
> tivo2.name=Bedroom
> tivo2.tsn=649000180xxxxxx
> 
> 
> #
> # 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]
> pytivo1.config=C:\Users\Public\Documents\pyTivo\pyTivo.conf
> #pytivoX.sep=
> pytivo1.ip=192.168.1.125
> pytivo1.port=9033
> #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 three 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, inclding your own, or titleNumber which is the
> # title number for DVD videos.
> #
> #
> # 3. 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 option, 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=seriesTitle
> 
> #
> # 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.
> #


You didn't answer my question about any other output, but I found a problem in your ini file. The following line:

[virtual share name X]

introduces a virtual share but doesn't have any specifications below it. All virtual shares need either a tags= or a values= line.

Based on the name, I assume you don't want any virtual shares. If this is the case, then you need to comment out that line too


----------



## Tobashadow

I commented the line out and same exact error.

Sorry for being such a bother on this.

I really hope this is what you want as far as "output" goes.

At this point i am starting the hme program










This is when i enter the Music, Photos section with the remote.










When i select the program i get a black screen and this is the final output.


----------



## jbernardis

OK - so there is no information there, but the question still exists why cleanup is being called.

Can you build the cache directly? Go into the vidmgr and type "python BuildCache.py" and see if it builds the cache.

What's really concerning me is that I don't see ANY messages about not finding the cache and attempting to build it. It doesn't look to me like it is getting into the startup logic at all. 

The crash doesn't happen at program startup - it happens when you choose it from the menu. That means that it gets through reading the configuration file OK. The only real reason if could fail at this point is if it couldn't find an HD resolution to work in. You DO have an HD Tivo? right?

I have also included a version of __init__.py with some debugging statements in it. (I had to add a .txt suffix for the forum). Save your original file, and put this file into the vidmgr directory and restart the app and let me know what output you get.

BTW - I fixed the vcChanged error message in this file, so you shouldn't see that anymore.


----------



## Tobashadow

No im not running a HD tivo is that a issue for this program i do not see it stated that a HD tivo is required.


----------



## jbernardis

Tobashadow said:


> No im not running a HD tivo is that a issue for this program i do not see it stated that a HD tivo is required.


Here is a paragraph from the readme file:



Code:


There is one limitation over the original program - This is for HD only.  If the application finds that
your tivo does not support an HD resolution, it simply exits.  One implication of this - if you plan on 
retaining any of your HD files from the previous version of Vidmgr, then the "HD" needs to be removed
from the file name.

This was a tough decision, but when I was maintaining version 1, it got extremely unwieldy because there is such a great deal of difference in terms of what can be displayed that the program really had two distinct personalities. This made debugging and enhancing a real nightmare. When I moved to version 2, I made the decision to limit it to HD.

Sorry about that. If you have SD, you need to stay back on version 1.


----------



## Tobashadow

Ok is there anything special i need to do to get version 1 up and running?


----------



## jbernardis

Tobashadow said:


> Ok is there anything special i need to do to get version 1 up and running?


It's very much the same as what you did for version 2. Follow the version 1 link in my signature below.

The config information is in the pyhme config.ini file. The distribution has examples in a config.merge file. Just read the readme file carefully.

Virtual shares are not a feature of version 1. One recommendation I would make based on user responses is to make sure you are using the blue skin. I think I changed it to be the default, but I can't really remember.


----------



## Tobashadow

Ok i removed all the Version 2 items and got all of version 1 installed and edited the config file in the base hme area to the same settings as above using the examples in the merge config file, nothing more nothing less and now it is getting stuck on registering vidmgr.

It just sits there.


----------



## jbernardis

I'm not sure what ypu mean by it just sits there. registering vidmgr SHOULD be the last thing you see until you start working with the remote control. 

I can't help if you don't give me more information than that.


----------



## Tobashadow

Here i am to cause you a headache tonight it seems.

Current config file










Current output


----------



## Tobashadow

If i take the # off of the apps line to make it load only the vidmgr i get the following










Which at first appears good but if i try to access it from the Tivo the screen pops ip black and says please wait and nothing more and nothing more is shown in the command window i have given it 15 mins should it take longer then that?


----------



## Tobashadow

Got it working, it finally complained about a bad folder on my G drive so i commented out the reference to it in pytivo config file and i got my other two drives to work. 

I will have to look into that further.

The purple and blue background works fine.


----------



## jcthorne

jbernardis said:


> What version of python are you running? win32file was included in my python distribution and I am at 2.7. It's only imported if you are running on a windows system.


I am running python 2.6 as that is what was recommended when I installed pytivo many moons ago. Never saw any reason or recomendation to change it. If 2.7 is required, is it compatible with pytivo including the photo module?


----------



## jcthorne

Ok, installed pywin32 for python 2.6, finished working through the ini file and again attempted to start vidmgr2...

Now gives the following error on launch of pythonHME

Skipping: vidmgr2 - No application class

Returning to running vidmgr version 1 runs fine.


Seems odd but reading through this thread, it appears no one else is trying to get Ver2 going or has tested under windows?


----------



## txporter

jcthorne said:


> Ok, installed pywin32 for python 2.6, finished working through the ini file and again attempted to start vidmgr2...
> 
> Now gives the following error on launch of pythonHME
> 
> Skipping: vidmgr2 - No application class
> 
> Returning to running vidmgr version 1 runs fine.
> 
> Seems odd but reading through this thread, it appears no one else is trying to get Ver2 going or has tested under windows?


Are you still running this on your Syno? I got a similar error when I tried to upgrade from vidmgr v1 to vidmgr v2. Initially, I downloaded v2 into a folder called vidmgr2. HMEforpython didn't like two folder with nearly the same name it seems. I had to move the v1 folder outside of hmeforpython and only run 1 folder for vidmgr. That fixed the error message for me.


----------



## jbernardis

The issue is with python's naming rules. The class name in the __init__.py module has to be the same name as the directory but capitalized. I'm not sure if the capitalization is necessary, but python seems to allow it. If you put your files into a directory named vidmgr2, you need to open up the __init__.py file and change the name of the class to be Vidmgr2. you also need to change your entry in config.ini to be vidmgr2.


----------



## jbernardis

Tobashadow said:


> Got it working, it finally complained about a bad folder on my G drive so i commented out the reference to it in pytivo config file and i got my other two drives to work.
> 
> I will have to look into that further.
> 
> The purple and blue background works fine.


I assume the nonUniquename was coming because you had multiple services with the same name. That message actually comes from pyhme code. If you do not have an apps= line in your config.ini file, pyhme tries to start up EVERY subdirectory as an app. Apparently two of them have the same name or somehow conflict with one another. Isolating it to vidmgr eliminated the conflict.


----------



## jcthorne

Thanks guys. Will give this a try when I get home tonight. I placed the new version in vidmgr2 so I could keep the functional version 1 online while I worked out the bugs. 

I am not running it on the Synology diskstation, I went back to the windows server for pytivo, pythonHME, Harmonium and a few other full time tasks.


----------



## jcthorne

OK, making progress. I got vidmgr2 running and have 2 virtual shares. Movies by Genre and Movies by Actor. Now I need to find a way to filter and combine the results into fewer folders. For example there are 11 different folders shown for dramas, romantic drama, crime drama etc. Similar for action and others. vidmgr came up with 62 genres from my approx 300 films. Its also including tv shows but I suppose I will need to define multiple shares in pytivo to break those out.

Some suggestions on how best to use this?


----------



## jbernardis

jcthorne said:


> ...Some suggestions on how best to use this?


There's nothing you can do that's intrinsic to the software as it is - except manually change the genre in your metadata files.

Maybe I could come up with some grouping method, where within the virtual share, you could create virtual values that map to a set of real values. If the metadata is within the set of real values, then use the virtual value. Let me experiment a bit. No promises.


----------



## jcthorne

Is there something I am supposed to be doing to have vidmgr2 save the cache? When it lauches from the tivo menu, it takes 4 to 5 minutes to start. No problem the first time but comming back some time later and reentering video manager, it takes a long time again to 'Processing video share Video on Meda Server' 

The share has 6580 videos according to vidmgr.

As this is, taking so long to start, its is not useful to other members of the family.


----------



## jbernardis

jcthorne said:


> Is there something I am supposed to be doing to have vidmgr2 save the cache?


There are two strategies to dealing with the cache. All of this is explained in the readme file.

1) You can build the cache ahead of time by just changing to the vidmgr directory and entering "python BuildCache.py". If you do this, it will speed up startup time, but you will be responsible for updating the cache if adding/deleting files, etc. You can rebuild the cache using the above method (I do mine as a cron job) or you can rebuild the cache through the tivo interface by pressing thumbs-down three times in succession. Also, if you prebuild the cache, and then delete a video through the tivo interface or rebuild the cache via the remote control, it will save the cache on exit.

2) You can build the cache dynamically. If vidmgr doe NOT find the cache on startup, this is the method it assumes. In this case, the cache is NEVER saved by the application as it knows it will just rebuild it on the next entry.

It sounds like you want option 1. I'm not sure how to set up the equivalent of a cron job on windows, but you can always force a rebuild with the remote control.

BTW - the current GIT has a bug. If you try to rebuild the cache through the remote control twice, it will fail the second time unless you exit the app first, and then re-enter. I have a fix and will be uploading shortly. I have something else I'm trying to work out first.


----------



## jcthorne

Thanks, I did not get the part where if it built the cache on startup it would not save it. Manually building cache from a command line now.

Do I need to stop vidmgr2 when building the cache each time or will it use the new cache next time it is accessed without a restart?

Building manually from a command line is fine, I can create a shortcut.

Thanks for the help. Looks like I am close to leaving V1 behind and being current revision.

Thinking a bit more about the virtual shares, what I think is needed is some sort of metadata cleanup utility or an extention of MetaGenerator to help. The data is the problem, not vidmgr.


----------



## dlfl

jcthorne said:


> .............Thinking a bit more about the virtual shares, what I think is needed is some sort of metadata cleanup utility or an extention of MetaGenerator to help. The data is the problem, not vidmgr.


If you double-click on the Genre list in MG3 you can edit it, including deleting items. This won't be useful if you're auto-processing all TV shows in a folder of course. Let's discuss your ideas for the desired "extension" either here or in the MG3 thread (link in signature).


----------



## jbernardis

jcthorne said:


> Do I need to stop vidmgr2 when building the cache each time or will it use the new cache next time it is accessed without a restart?


vidmgr is not a process it is a thread that is only active from the time that you choose it on the tivo menu until you exit either back to live TV or back to the tivo menu. The process that controls vidmgr is pyhme.

When you rebuild the cache, you do NOT need to restart pyhme. You DO, however, need to restart the vidmgr thread by exiting the app and re-entering.



jcthorne said:


> Thinking a bit more about the virtual shares, what I think is needed is some sort of metadata cleanup utility or an extention of MetaGenerator to help. The data is the problem, not vidmgr.


I'm glad to hear this. I had an idea in mind and actually started implementing but it quickly became more than I wanted to do. Not the actual algorithm - that was pretty straight-forward - but the amount of parsing I'd have to do to protect myself from the arbitrary text that could be used in the metadata values.

I quickly backed the changes out.


----------



## jcthorne

dlfl said:


> If you double-click on the Genre list in MG3 you can edit it, including deleting items. This won't be useful if you're auto-processing all TV shows in a folder of course. Let's discuss your ideas for the desired "extension" either here or in the MG3 thread (link in signature).


I attemted to stir up a conversation over at your MG3 thread for this. Lets see where it leads with your help. Thanks for taking an intrest in this.


----------



## jcthorne

Thanks to dlfl, I now have a very consice list of 14 genres and they present perfectly in vidmgr as virtual shares. Also created virtual share for movies by actor, by year, by mpaa rating and by star rating.

I also set up a few net shares in pytivo to mesh well with the virtual shares.

And all the funny business with symlinks is gone. YES!

Now we come to a request for jbernardis,

When vidmgr presents the list of pytivo shares and virtual shares, the pytivo shares are listed first, in the order listed in the pytivo.conf file and then the virtual share in the order they are listed in the vidmgr.ini file.

Can you add an option to show this list of share sorted alphabetically so that all my movie shares and television share are displayed together?

Thanks for the great work everyone. This great tivo add on has just become far more useful. Just amazing.


----------



## jbernardis

jcthorne said:


> Can you add an option to show this list of share sorted alphabetically so that all my movie shares and television share are displayed together?


Shouldn't be too tough - let me have a look at the code. I owe everyone an update anyway for the fix I mentioned before - I'll try to get this in there too.


----------



## jbernardis

The version out on GIT has been updated: version 2.0c. there is a new option: sortroot - set to either true or false, false is the default.

If set to true, then the root directory is sorted with virtual shares AND physical shares together.

If set to false, the physical shares appear first - sorted - followed by the virtual shares - which will also be sorted.


ALso at this time, I fixed the bug where you couldn't build the cache a second time with the remote control.


----------



## jcthorne

Have not installed 2.0c just yet but found a pretty big bug in 2.0a.

I have two Tivo Premieres. If I access vidmgr and request a video, vidmgr reports it is cued for transfer to the tivo I am on. It transfers to the other one. I have checked the tivo config in vidmgr.ini watching the pytivo cmd window, its getting and executing a command to send to the wrong tivo. Something is not matching up.


----------



## jbernardis

I have two tivos too - although they are both series 3's. I have pushed successfully to both of them, although admittedly it's been a while since I've done so to the Family Room tivo. I'll look at the code this weekend to see if I can see anything.

Edit: Actually I just looked at the code. You are saying that the message properly identifies the Tivo, but that the push goes to the wrong Tivo. The push does not use the Tivo Name - for that purpose, the tivo is identified by TSN. But both the name and TSN are read in in parallel and I don't see where the logic breaks down. The same index is used to retrieve the name and the TSN in successive statements. I will do some testing, but are you certain that you are using the correct TSN's in your ini file?


----------



## jcthorne

jbernardis said:


> I have two tivos too - although they are both series 3's. I have pushed successfully to both of them, although admittedly it's been a while since I've done so to the Family Room tivo. I'll look at the code this weekend to see if I can see anything.
> 
> Edit: Actually I just looked at the code. You are saying that the message properly identifies the Tivo, but that the push goes to the wrong Tivo. The push does not use the Tivo Name - for that purpose, the tivo is identified by TSN. But both the name and TSN are read in in parallel and I don't see where the logic breaks down. The same index is used to retrieve the name and the TSN in successive statements. I will do some testing, but are you certain that you are using the correct TSN's in your ini file?


I rechecked the tsns in the vidmgr.ini against those in pytivo.conf and my tivo account. I have 2 tivos named Thornolis HT and Thornolis 2. While viewing Thronolis HT and using vidmgr I select a vid and it says it is sending. Watching pytivo and the commands it executes, the vid is sent to Thornolis 2. Have not tried the inverse but something is mixed up. Perhaps I can restart the tivos and pytivo yet again and see if anything changes but they have each been restarted multiple times in the last week for other reasons.

If I use pytivo's web interface to push a vid, it goes to the unit selected.


----------



## jbernardis

I just put some debugging statements into vidmgr and tried pushing to both of my tivos. I even changed the names of my tivos so they sorted in a different order.

Everything worked as expected - the proper videos were pushed to the proper tivo.

I'm not saying there is not a bug, but it is eluding me based on the information I have so far.

Is anybody else experiencing this?


----------



## jcthorne

jbernardis said:


> I just put some debugging statements into vidmgr and tried pushing to both of my tivos. I even changed the names of my tivos so they sorted in a different order.
> 
> Everything worked as expected - the proper videos were pushed to the proper tivo.
> 
> I'm not saying there is not a bug, but it is eluding me based on the information I have so far.
> 
> Is anybody else experiencing this?


It could very well be something odd in my system or network. Any suggestions on how I might find the trouble or where its tripping, I'd be grateful to spend some time looking. Just not sure what else to check.


----------



## MiltonDorkenhoff

In a few posts from 2008, there was a discussion of using pyTivoX on a mac to provide EyeTV mpegs to a TivoHD. From the thread, I thought support was added to pyTivoX, but maybe not.

I've installed the latest EyeTV (3.something), as well as pyTivoX (1.3). From my TivoHD's Now Playing list, I can see the EyeTV recording directory and navigate through it to find recordings, but as was discussed in the old thread, they are named cryptically - like "000123433232".

The NPL name is the same as what's on the Mac, but on the Mac, the cryptically named file is in a directory with the series and episode name (e.g. the directory would be called "House - whatever" and in there would be a cryptically named mpeg, along with an mp4 and a couple of other files).

Is there a config option somewhere to get pytivoX to use the parent directory name for the mpeg?

Thanks


----------



## wmcbrine

I did add support for EyeTV, two years ago tomorrow. But you'd need something newer than pyTivoX 1.3, which is from August 2009.

Anyway, it's off-topic for this thread. You should take it to the pyTivo thread, or the pyTivo forum.


----------



## windracer

jcthorne said:


> I have one video share in pytivo. It contains directories for movies, tv shows and concerts. When creating a virtual share, such as Movies by Genre, I only want items inthe movies directory, not from the tv shows. How do I specify that it only include items from specific directories? Do I have to create multiple video shares in pytivo?





windracer said:


> I was trying something like this too, using a values of isEpisode=false but wasn't having good luck with it.


I finally got back to messing around with this and still can't come up with a good way to create a virtual share for TV shows and one for movies. I've tried:



Code:


values=isEpisode=true,True,TRUE

for TV shows and 


Code:


values=isEpisode=false,False,FALSE

for Movies, but both virtual shares end up exactly the same. My metadata files contain "isEpisode: false" so that should work, right?


----------



## jbernardis

windracer said:


> Code:
> 
> 
> values=isEpisode=true,True,TRUE


and 


windracer said:


> Code:
> 
> 
> values=isEpisode=false,False,FALSE


are incorrect syntax. The second '=' should be a colon ':'. So this should be


Code:


values=isEpisode:true,True,TRUE

etc.

Hopefully this will work - let me know if it doesn't.

Also, I'm not against an enhancement that allows a virtual share to be built based on file location instead of just metadata. If you want that, let's come up with a design and I can see how difficult it would be to add.


----------



## windracer

jbernardis said:


> ... are incorrect syntax. The second '=' should be a colon ':'. So this should be
> 
> 
> Code:
> 
> 
> values=isEpisode:true,True,TRUE
> 
> etc.
> 
> Hopefully this will work - let me know if it doesn't.


That was a typo in my post. In my vidmgr.ini file I _do_ have the correct syntax. Sorry about that.


----------



## jbernardis

I added the following lines to my vidmgr.ini:


Code:


[test episode]
values = isEpisode:True,true,TRUE

[test not episode]
values = isEpisode:false,False,FALSE

and it worked like a charm. I got two virtual shares, one named "test episode" that contained only videos that had isEpisode to true, and a second named "test not episode" where the same metadata item was false. It demonstrated to me that my metadata needs some cleaning up, but the two shares were definitely disjoint.


----------



## windracer

Ok, I found my problem. I didn't understand that a virtual share could only have _one_ of either values or tags. I was trying to do:



Code:


[TV Shows by Genre]
tags=vPrimaryGenre
values=isEpisode:false,False,FALSE

[Movies by Genre]
tags=vPrimaryGenre
values=isEpisode:true,True,TRUE

So I fixed that to just use the values line and it worked as you described. Unfortunately I can't use vPrimaryGenre as the group by because I get an error that the grouping item can't be a list (I guess due to multiple vPrimaryGenre values in the metadata?).

Close enough, though, thanks!


----------



## jbernardis

Windracer

I saw your response last night, but it wasn't until later that it suddenly hit me. I think I have a solution to what you want to do, but it depends on if my assumptions are true.

Assumption number 1: I am unfamiliar with the metatage vPrimaryGenre - I assume this is your invention.

Assumption number 2: I assume based on the name, that you only ever have a single item for this tag - that being the main genre for the video.

If these are both true, then your solution is simple - just remove the 'v' from the tag name (vPrimaryGenre becomes PrimaryGenre) and it will no longer be parsed as a list. Vidmgr uses basically the same metadata parsing algorithm as pytivo (and I believe this is a tivo convention) - all tags that start with a lower case v can occur multiple times and are therefore parsed as a list - EVEN IF THERE IS ONLY 1 OCCURRENCE.

Remove the v, it will no longer be a list, and can be then used as your grouping item.


----------



## windracer

vPrimaryGenre was added by Metagenerator 3 so that vidmgr users wouldn't have these long lists of genres due to crazy data like "20th Century Fox" or "Science-Fiction" vs "Sci-Fi" and such. Unfortunately, it IS a list (a file can have multiple vPrimaryGenre items) but I'll play around and see what happens.

Thanks again!


----------



## jcthorne

I ended up defining two seperate pytivo video shares for television and movies. Now the movies by genre lists are correct, the folder itself presents an overall alphabetical list by title. The television shows I do not sort by genre, only by show, season.


----------



## windracer

Ok, yeah, splitting my physical pyTivo shares might be the way to go, good idea.


----------



## cweb

Been using videomgr .7c on my Mac for a while with good success. Although I read this thread regularly, somewhere I had a mind cramp and missed that there is a version 2. Can I run both versions simultaneously?


----------



## lrhorer

windracer said:


> That's definitely the case. I run vidmgr on Linux, but I tried opening the vidmgr.ini file in my default editor (Notepad++) and Windows Notepad. Notepad is definitely not interpreting the Unix-style CR/LFs properly. Notepad++ is just fine.


Whoever wrote notepad.exe should be strung up by their gonads. For a Windows flat text editor, I heartily recommend Edit Plus, although I prefer Verison 2 to Version 3. It also runs just fine under wine.


----------



## lrhorer

jcthorne said:


> Is there something I am supposed to be doing to have vidmgr2 save the cache? When it lauches from the tivo menu, it takes 4 to 5 minutes to start.


It should not take that long to build the cache.



jcthorne said:


> The share has 6580 videos according to vidmgr.


Not even with that many videos.


----------



## lrhorer

jbernardis said:


> Everything worked as expected - the proper videos were pushed to the proper tivo.
> 
> I'm not saying there is not a bug, but it is eluding me based on the information I have so far.
> 
> Is anybody else experiencing this?


No problems here. I have two S3 TiVos and a THD. Pushes always go to the correct TiVo. Well, they always go to the *SELECTED* TiVo. I don't always select the correct TiVo.


----------



## lrhorer

For those wondering what all the fuss about vidmgr is, as they say, "A picture is worth a thousand words." Here are four screen shots of vidmgr 2.0 using my own background. I like the gray background.


----------



## lrhorer

jcthorne said:


> I ended up defining two seperate pytivo video shares for television and movies. Now the movies by genre lists are correct, the folder itself presents an overall alphabetical list by title. The television shows I do not sort by genre, only by show, season.


Oh, I do, and one of my Genres is "Series". Every TV series metafile has that in it.


----------



## jbernardis

cweb said:


> Been using videomgr .7c on my Mac for a while with good success. Although I read this thread regularly, somewhere I had a mind cramp and missed that there is a version 2. Can I run both versions simultaneously?


You can - but you have to make some changes. What I'd do is name version 2 vidmgrHD, make sure it is in a directory named vidmgrHD, and inside that directory, edit __init__.py and change the name of the main class from Vidmgr to VidmgrHD.

I guess the reason you want to do this is because you have both SD and HD tivos on your network. If this is the case, be aware that BOTH the SD and HD versions of the program will appear on both tivo's menus. You just cannot select the HD version from the SD tivo (well- you can, but it wont work  )


----------



## jbernardis

lrhorer said:


> It should not take that long to build the cache.
> 
> Not even with that many videos.


Actually I've found that there is a significant difference between windows and linux when it comes to building the cache, and the culprit is the mechanism I use to determine if two files are in fact the same file (they are links to the same physical file). On Linux, I simply stat the file and get the inode number - a very inexpensive operation. Although the windows library gives us a stat function, it returns inode number 1 (or was it 0?) for every file, so it couldn't be used. I found some godawful algorithm on the internet that does what I want, but it's quite expensive.

If you are running on Windows and have a video collection of any significance, I recommend that you build the cache ahead of time.


----------



## jbernardis

lrhorer said:


> Oh, I do, and one of my Genres is "Series". Every TV series metafile has that in it.


This is a good point. You are NOT limited by the metadata tags or values that tivo/pytivo/kmttg/metagenerator gives you - you can invent your own and base your virtual shares on that new data. The only caveat that I mentioned above is that a tag beginning with a lower case 'v' is assumed to be a list (an array) and will be parsed as such. Because of this, it cannot be used as a grouping item.


----------



## lrhorer

jbernardis said:


> Actually I've found that there is a significant difference between windows and linux when it comes to building the cache, and the culprit is the mechanism I use to determine if two files are in fact the same file (they are links to the same physical file).


Oh. I've never tried it under Windows. (You have a flair for under-statement. A factor of 60 is definitely "significant".) I've gone through my server and deleted a bunch of junk I no longer want, but still:



Code:


RAID-Server:/usr/share/pyhme# time ./BuildCache 
Processing video share RAID Server
1466 Videos found
Processing video share Videos by Genre
5067 Videos found
Processing DVD share DVD
83 DVD Videos found
Processing video share Unverified
0 Videos found
Browse Series count: 411 videos in 9 groups
Browse by Actor count: 1466 videos
Browse by Channel count: 1461 videos
Browse by Director count: 1449 videos
Browse by Genre count: 1050 videos
Browse by Producer count: 195 videos
Videos Sorted by Alpha count: 1053 videos
Videos Sorted by Date count: 1549 videos

real    0m5.686s
user    0m5.424s
sys     0m0.264s

That's on an older 2.4 GHz dual core AMD system.



jbernardis said:


> If you are running on Windows and have a video collection of any significance, I recommend that you build the cache ahead of time.


Yeah, I would say so, for certain. I even recommend it for Linux or Mac systems. Six seconds isn't really that much, but people can be impatient.


----------



## lrhorer

jbernardis said:


> This is a good point. You are NOT limited by the metadata tags or values that tivo/pytivo/kmttg/metagenerator gives you - you can invent your own and base your virtual shares on that new data. The only caveat that I mentioned above is that a tag beginning with a lower case 'v' is assumed to be a list (an array) and will be parsed as such. Because of this, it cannot be used as a grouping item.


Right. To handle that limitation, I also have isEpisodic set to true in every series video. Thus, the "Browse by Genre" share has a group named "Series" in it with all the series sorted by name and (if it exists) episode number, while the "Browse by Series" share only has series in it, grouped by series name.


----------



## lrhorer

windracer said:


> Ok, yeah, splitting my physical pyTivo shares might be the way to go, good idea.


I take a little different approach. I simply create a separate directory under the main share for each series, and the file naming rules are different in the series directories. In the main share, I simply have

(Recorded <Day> <Date>, <Channel>).mp[4g]

In the series directories I use either

<Series Name> - <Episode Name> (Recorded <Day> <Date>, <Channel>).mp[4g]

if the series is not chronological (i.e. - the original Star Trek TV series). or else

<Series Name> - Sxx Eyy - <Episode Name> (Recorded <Day> <Date>, <Channel>).mp[4g]

if it was a serial where order was important.


----------



## cweb

jbernardis said:


> I guess the reason you want to do this is because you have both SD and HD tivos on your network. If this is the case, be aware that BOTH the SD and HD versions of the program will appear on both tivo's menus. You just cannot select the HD version from the SD tivo (well- you can, but it wont work  )


I apologize, I am confused by what we are talking about regarding HD. I have all TiVo HDs and premieres. However, I have recode non HD content such as the BBC when it was only available as a non Hd channel. Should I be able to push these SD shows with ver 2.0?


----------



## lrhorer

cweb said:


> I apologize, I am confused by what we are talking about regarding HD. I have all TiVo HDs and premieres. However, I have recode non HD content such as the BBC when it was only available as a non Hd channel. Should I be able to push these SD shows with ver 2.0?


Vidmgr does not do any of the transferring. It is merely a front end for pyTivo that is available on the TiVo. Other than the file extension and the information in the metafile, vidmgr neither knows nor cares anything at all of the video itself. Vidmgr will simply notify pyTivo it needs to induce the Tivo to transfer the file in question. If it is a valid video file as recognized by ffmpeg, then pyTivo will tell the mind server to have the TiVo request the video. It doesn't make any difference in this context whether the video is SD or HD.


----------



## reneg

I've been running v1 of Video Manager on a Windows Home Server for a while and just I installed v2 of Video Manager and ran across the following issues. I think most of these have already been covered:

1) v2 dependancy on windows extensions for Python. I'm running python 2.6 and and v2 errorred out on the import of win32file. Fixed by installing win32 extensions for python.

2) Config file defaults not excepted. Had to enter values in the config file for various options. For example, had to changed
descsize= to descsize=20
infolabelpercent= to infolabelpercent=30
inforightmargin= to inforightmargin=20
thumbjustify= to thumbjustify=left

3) Caching performance on startup. Caching took a long time and once the Tivo dropped back to live TV before caching was finished so when I went back in the app had exited so I had to re-cache again. I need to spend more time playing here to find the right balance for my system.

Edit: After spending more time, dynamic caching performance on start-up is unusuable in my configuration. Had to switch to static caching and a scheduled task to run buildcache.py on a daily basis.


----------



## cweb

Can I get some clarification on what is the difference between vidmgr virtual shares and the shares you can create through pytivo (which then are reflected in vidmgr)?


----------



## Squirl1899

Is there a way to build the Thumbnail cache without having to click on each individual movie? My thumbnails are created with Thumbgen and are about 1MB a piece so it takes a long time to load each one nd I have over 1,500 movies with thumbnails. 

I have tried the "BuildCache.py" but that doesn't seem to build the thumbnails, just the shares I have in my pyTivo.conf. I also tried "ThumbCache.py" but that didn't seem to do anything. any help would be greatly appreciated.


----------



## reneg

cweb said:


> Can I get some clarification on what is the difference between vidmgr virtual shares and the shares you can create through pytivo (which then are reflected in vidmgr)?


Virtual shares allow you to create different views into your archived media. You can create additional logical groupings on values in the metadata. For instance you could create a virtual share on the genre science-fiction, or on the director Alfred Hitchcock. Lots of flexibility to access your archived media in different ways if you choose.


----------



## lrhorer

Squirl1899 said:


> Is there a way to build the Thumbnail cache without having to click on each individual movie? My thumbnails are created with Thumbgen and are about 1MB a piece so it takes a long time to load each one nd I have over 1,500 movies with thumbnails.
> 
> I have tried the "BuildCache.py" but that doesn't seem to build the thumbnails, just the shares I have in my pyTivo.conf. I also tried "ThumbCache.py" but that didn't seem to do anything. any help would be greatly appreciated.


I suggest you take a batch photo editor such as ReaConverter Lite and use it to convert all those thumbnails to .jpg files of under 100K each. You can also re-size them, while you're at it.


----------



## lrhorer

reneg said:


> Virtual shares allow you to create different views into your archived media. You can create additional logical groupings on values in the metadata. For instance you could create a virtual share on the genre science-fiction, or on the director Alfred Hitchcock. Lots of flexibility to access your archived media in different ways if you choose.


To expand on that a bit, vidmgr takes all the metafiles for all the videos in all the real video and DVD shares specified in the pyTivo configuration file and combines them into a single database. From that database, then, one can create individual objects that sort and / or filter the database in unique ways, based mostly upon the contents of the metafiles. One can sort / group based on pre-defined meta-tags, or one can create one's own. For example, I insert into every metafile a tag that is equal to the first character in the file name after excluding leading articles. Thus, the metavalue for that tag for the film The 39 Steps is simply the number "3". I then collect all numeric tags into a group named "[0-9]", while all the remaining videos are sorted into groups labeled, "A", "B", "C", etc., representing the first letter of the file name. IOW, I have one group for movies starting with a number, another for those starting with "A", another for those starting with "B", etc.


----------



## lrhorer

reneg said:


> 2) Config file defaults not excepted. Had to enter values in the config file for various options. For example, had to changed
> descsize= to descsize=20
> infolabelpercent= to infolabelpercent=30
> inforightmargin= to inforightmargin=20
> thumbjustify= to thumbjustify=left


Yeah, I ran into that one, too. It's easily fixed.



reneg said:


> 3) Caching performance on startup. Caching took a long time and once the Tivo dropped back to live TV before caching was finished so when I went back in the app had exited so I had to re-cache again. I need to spend more time playing here to find the right balance for my system.
> 
> Edit: After spending more time, dynamic caching performance on start-up is unusuable in my configuration. Had to switch to static caching and a scheduled task to run buildcache.py on a daily basis.


It's probably unusable on just about any Windows system with any significant number of videos. The routine jbernardis had to use to identify multiple symlinks to the same source file on a Windows system as not being unique takes a lot of CPU resources. Linux and Mac systems take a small fraction of the time - about 5 seconds for nearly 2000 videos, here. Even so, I still run a Cron job every hour or so that re-builds the cache.


----------



## reneg

lrhorer said:


> Yeah, I ran into that one, too. It's easily fixed.
> 
> It's probably unusable on just about any Windows system with any significant number of videos. The routine jbernardis had to use to identify multiple symlinks to the same source file on a Windows system as not being unique takes a lot of CPU resources. Linux and Mac systems take a small fraction of the time - about 5 seconds for nearly 2000 videos, here. Even so, I still run a Cron job every hour or so that re-builds the cache.


It seems like the default path is the uncommon configuration case on Windows. In my opinion, most Windows users have no idea how to create a symlink. Perhaps a config option whether your windows systems contains symlinks or not would increase usability.

Also, first timers would benefit by either having the distribution config file have the default values prepopulated or having better error recovery in the program.


----------



## lrhorer

reneg said:


> It seems like the default path is the uncommon configuration case on Windows. In my opinion, most Windows users have no idea how to create a symlink.


It's hard to imagine one that doesn't. Right click on the source, drag it to the new location, and select <Create Shortcut>. If anyone doesn't know, it's certainly not hard to learn.



reneg said:


> Perhaps a config option whether your windows systems contains symlinks or not would increase usability.


Ummm. I have no idea how he coded the routine. I've only taken the very briefest peek at the code. The notion leaves a bit of a sour taste in my mouth. OTOH, I'm not running Windows, so it ultimately doesn't impact me in any case.



reneg said:


> Also, first timers would benefit by either having the distribution config file have the default values prepopulated or having better error recovery in the program.


For that, you'll need to talk to jbernardis.


----------



## reneg

lrhorer said:


> It's hard to imagine one that doesn't. Right click on the source, drag it to the new location, and select <Create Shortcut>. If anyone doesn't know, it's certainly not hard to learn.


Shortcuts are not the same as symlinks, but that's a different discussion for another thread.


----------



## lrhorer

reneg said:


> Shortcuts are not the same as symlinks, but that's a different discussion for another thread.


Well, OK, that's true. Windows Vista introduced an attempt at an analog to a *nix symlink, but I'm not sure whether in this context the distinction matters, or not. Whether it is a true symlink or a "shortcut", I suspect the system has to go through the same or similar gyrations in order to determine whether the link is unique, or not. I could be mistaken, of course. Perhaps jbernardis will chime in.


----------



## jbernardis

reneg said:


> It seems like the default path is the uncommon configuration case on Windows. In my opinion, most Windows users have no idea how to create a symlink. Perhaps a config option whether your windows systems contains symlinks or not would increase usability.


Let me look at the code to see what I can do here. If it's simple to simply turn off the logic if you do not have any links, then I will ad an option for doing so.



reneg said:


> Also, first timers would benefit by either having the distribution config file have the default values prepopulated or having better error recovery in the program.


My intent with the distribution file was to show you where you need to enter values, not to provide a syntax that results in the default values. I sorry that mislead everyone. You do NOT have to enter the default values - simply remove or comment out the line in the file and the default value will be used. Next distribution will have these lines commented out.


----------



## jbernardis

OK - version 2.0d is up on git. I'm kind of eager for someone to let me know if there is an improvement under windows. Basically I added a new vidmgr.ini option - usefileid - the default value is true. 

If you set it to false, it bypasses the logic used to determine the file's unique ID. This means that if you DO have links (hard or soft) vidmgr will treat them as two different files and they will show up twice (or more times) in the virtual shares.
If you set it to true, the logic of today is used, and the unique ID for each file is determined so that the duplication does not happen.

BTW the simplest way to do this was to leave the existing routines in place and instead of returning the actual file ID, I return a sequential number - that way, each file is given a unique number and there will never be a match.

I also editted the two dist files to comment out the lines that everyone thought was bringing in the default values.


----------



## jbernardis

Squirl1899 said:


> Is there a way to build the Thumbnail cache without having to click on each individual movie? My thumbnails are created with Thumbgen and are about 1MB a piece so it takes a long time to load each one nd I have over 1,500 movies with thumbnails.


The thumbnail cache is built automatically, but it is statically sized at 100 entries. You CAN increase this by playing with the value of thumbcachesize in Config.py, but I would tend to agree with lrhorer. 1MB is a VERY large thumbnail. I have about 600 videos, and for the most part my thumbnails are images of the DVD case. They range in size from 30K to 70K and they look fine. They also load very fast even if they are not in the cache.


----------



## reneg

jbernardis said:


> OK - version 2.0d is up on git. I'm kind of eager for someone to let me know if there is an improvement under windows. Basically I added a new vidmgr.ini option - usefileid - the default value is true.
> 
> If you set it to false, it bypasses the logic used to determine the file's unique ID. This means that if you DO have links (hard or soft) vidmgr will treat them as two different files and they will show up twice (or more times) in the virtual shares.
> If you set it to true, the logic of today is used, and the unique ID for each file is determined so that the duplication does not happen.
> 
> BTW the simplest way to do this was to leave the existing routines in place and instead of returning the actual file ID, I return a sequential number - that way, each file is given a unique number and there will never be a match.
> 
> I also editted the two dist files to comment out the lines that everyone thought was bringing in the default values.


It took about 2 minutes to load with dynamic cache the first time on my system with about 10,000 media files. Subsequent loads took about 45 seconds. That's better than before where it would drop back to live video before completing but it is still slow for regular usage.

With a static cache, vidmgr loads in 5 seconds on my system.

One potential problem that could happen by setting usefileid=false would be if someone had nested shares. Not quite the same as symlinks, but could cause multiple entries per file in virtual shares.

Thanks for putting this in so quickly, however I think I'm going to revert back to static cache with a daily run of buildcache.py.

Love your program, thanks for making it available to us.


----------



## Squirl1899

Squirl1899 said:


> Is there a way to build the Thumbnail cache without having to click on each individual movie? My thumbnails are created with Thumbgen and are about 1MB a piece so it takes a long time to load each one nd I have over 1,500 movies with thumbnails.
> 
> I have tried the "BuildCache.py" but that doesn't seem to build the thumbnails, just the shares I have in my pyTivo.conf. I also tried "ThumbCache.py" but that didn't seem to do anything. any help would be greatly appreciated.


Well, I was so frustrated (with TiVo, not Video Manager) that I went through and opend up EVERY port that TiVo had on their website. I have 2 routers (Netgear WNDR3700 for N capabilities connected to my Verizion FIOS MI424WR) and opened up all the ports on BOTH routers, including the pyTiVo and Video Manager ports and did the same on my Windows firewall. After about an hour of entering ports EVERYTHING is BLAZING fast, even with my 1MB thumbnails! I can't believe it but there is ZERO lag when I start Video Manager and when i go from one video to another the thumbnail pops up instantaneously.

Even though my TiVo always said that the port configuration passed I always had issues with the HD menus, the top banner going blank in TiVo Central and when i would run pyTiVo, Stream Baby or Video Manager, the whole TiVo tended to freeze up and get the green circle of death. I have no idea which port on which router or windows firewall did the trick but something fixed it. I guess time will tell if it fixed my actual TiVo HD issues that everyone has been havning but at least I can now browse my WONDERFUL and GORGEOUS Video Manager Thumbnails with ease.


----------



## jbernardis

Squirl1899 said:


> ...but at least I can now browse my WONDERFUL and GORGEOUS Video Manager Thumbnails with ease.


Great looking thumbnails - just as long as everyone realizes that is NOT what vidmgr looks like 

I'd be interested to see a total screen shot that shows your image in the lower right.


----------



## jbernardis

One thing I've learned in 30+ years of software development - software is never finished.

With that in mind, I have just posted version 2.0e on GIT. There was a nasty bug when parsing virtual share options - once it found one option, it stopped looking for any others. So if you tried to alter more than one option, only one of them would have been used. I'm actually surprised nobody reported this before.

I couldn't be satisfied with just a bug fix. There are two new features as well:

I added the shares= option to the vidmgi.ini to limit virtual shares to a list of pytivo shares, and
I added a new virtual share type - alpha=tagname - that produces a folder for every letter (or digit) that the named metadata item begins with

SO for example, the following lines in the ini file:


Code:


[alphabetical movies]
alpha=title
shares=My Movies

will produce a virtual share of movies (from the "My Movies" share) that are arranged into seperate folders based on the starting letter of the title. So there will be an "A" folder, a "B" folder, etc. Digits are also used, and then a catchall <other> folder. If there are no titles for a given letter, that folder does not appear.


----------



## bwall23

Have latest version 2, just downloaded yesterday and installed today.

OK, this sounds promising and since I'm already running Python 2.6.5(64bit) on Windows7-64 along with the latest pyTiVo, I thought i'd give it a try.

After spending most of the day figuring out what pyHME was, installing it, figuring out where to put vidmgr, getting and installing WIN-64 PIL(64bit) I'm now stuck.

Here's what I get launcing pyHME from a WIN7 commandline



Code:


C:\pyHME>C:\Python26\python.exe "C:\PyHME\start.py"
HME Server for Python 0.19
[COLOR="Red"]Skipping: vidmgr - No module named win32file <<==??[/COLOR]
Sat Nov 05 17:16:21 2011 Server Starts
Registering: animate
Registering: clock
Registering: effects
Registering: fontinfo
Registering: hello
Registering: picture
Registering: test
Registering: tictactoe
Registering: transition

Anyone else using it on WIN64 w/64 bit Python and 64bit PIL?
If so, what's the magic bullet?


----------



## jbernardis

bwall23 said:


> Code:
> 
> 
> [COLOR="Red"]Skipping: vidmgr - No module named win32file <<==??[/COLOR]


Apparently this win32file thing has been an issue for some. I didn't anticipate this since I didn't explicitly install this module on my PC - it came with python 2.7.

It's available as a separate download - just google it. The question I have is whether it is compatible with 64 bit python - I am using 32 bit. If someone could chime is as to whether this module works in this environment, I'd appreciate it.


----------



## bwall23

jbernardis said:


> Apparently this win32file thing has been an issue for some. I didn't anticipate this since I didn't explicitly install this module on my PC - it came with python 2.7.
> 
> It's available as a separate download - just google it. The question I have is whether it is compatible with 64 bit python - I am using 32 bit. If someone could chime is as to whether this module works in this environment, I'd appreciate it.


I just uninstalled PIL 1.1.7 64 bit for Python 2.6 and Python 2.6.5 64 bit for Windows. I then installed Python 2.7.2 32 bit and PIL 1.1.7 32 bit for Python 2.7.

Getting same error.

What is available as a separate download?


----------



## jbernardis

bwall23 said:


> What is available as a separate download?


win32file.

I'm not sure where it is because like I said it came with my 2.7 install (I have activestate python), but others in this thread have mentioned downloading it. Perhaps if they see this, they can post a download link.


----------



## bwall23

jbernardis said:


> win32file.
> 
> I'm not sure where it is because like I said it came with my 2.7 install (I have *activestate python*, but others in this thread have mentioned downloading it. Perhaps if they see this, they can post a download link.


What is "*activestate python*"? and where would I get it?


----------



## jbernardis

bwall23 said:


> What is "*activestate python*"? and where would I get it?


Active State is a company that packages python and other languages for business use. They charge for their normal products, but also provide free versions for personal use. I originally started using their products when I was more into perl, and have been happy with them.

here is the link to their site to obtain python.


----------



## bwall23

jbernardis said:


> win32file.
> 
> I'm not sure where it is because like I said it came with my 2.7 install (I have activestate python), but others in this thread have mentioned downloading it. Perhaps if they see this, they can post a download link.


Found the Win32 extensions and have it working with all 32 bit software. Since I have Win7-64 bit I'm going to try duplicating my success with all 64 bit versions of Python 2.6.5, PIL 1.1.7 and pywin32 build 216. Thanks for the quick responses


----------



## bwall23

bwall23 said:


> Found the Win32 extensions and have it working with all 32 bit software. Since I have Win7-64 bit I'm going to try duplicating my success with all 64 bit versions of Python 2.6.5, PIL 1.1.7 and pywin32 build 216. Thanks for the quick responses


Working! Uninstalled, then reinstalled all 64 bit - Python 2.7.2, PIL 1.1.7 and pywin32 build 216.

How can I get the filename to display in the info screen (when I press the remote info button). It appears I have recordings of shows where the metadata says they're an episode Title that they aren't and I need a way to identify what files they are. Would be nice to get filename.ext displayed. I tried editing the vidmgr.ini to include the following, but it didn't display the filename


Code:


# 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.
#       default: metaignore=isEpisode isEpisodic
#                metafirst=title seriesTitle episodeTitle description
#                metaspacebefore=
#                metaspaceafter=
#
# metaignore=
metafirst=[B][COLOR="Red"]file[/COLOR][/B] title seriesTitle episodeTitle description
# metaspacebefore=
# metaspaceafter=

Also want to add that it appears it isn't parsing the pytivo.conf file correctly.
It errors out stating there is no port= line in my pytivo.conf, but there is.


Code:


port = 9032

I had to add this line in vidmgr.ini to stop the error


Code:


pytivo1.port=9032


----------



## dlfl

bwall23 said:


> Working! Uninstalled, then reinstalled all 64 bit - Python 2.7.2, PIL 1.1.7 and pywin32 build 216.
> .......


What significant advantage do you see (or expect) from running 64 bit vs. 32 bit ?


----------



## bwall23

dlfl said:


> What significant advantage do you see (or expect) from running 64 bit vs. 32 bit ?


None. Other than it's easier to remember always run 64 bit unless it's not available or causes incompatability issues. I already had 64 bit Python 2.6.5 and had been using it with pyTivo. In order to run vidmgr I had to get PIL and the win32 extensions. They all have to be matched (all 32 bit or all 64 bit). I decided since I have a 64 bit processor and a 64 bit OS, I'd stick with 64 bit Python and extensions since they're available.


----------



## dlfl

bwall23 said:


> None. Other than it's easier to remember always run 64 bit unless it's not available or causes incompatability issues. I already had 64 bit Python 2.6.5 and had been using it with pyTivo. In order to run vidmgr I had to get PIL and the win32 extensions. They all have to be matched (all 32 bit or all 64 bit). I decided since I have a 64 bit processor and a 64 bit OS, I'd stick with 64 bit Python and extensions since they're available.


That's reasonable. I follow the opposite policy (always install 32-bit versions). It's simpler and I've yet to see an application that had significant performance advantages using an (available) 64-bit version. Transcoding seems like it would benefit since it is compute-intensive, but I don't think the 64-bit versions of the transcoding software I use are available in general.


----------



## txporter

dlfl said:


> That's reasonable. I follow the opposite policy (always install 32-bit versions). It's simpler and I've yet to see an application that had significant performance advantages using an (available) 64-bit version. Transcoding seems like it would benefit since it is compute-intensive, but I don't think the 64-bit versions of the transcoding software I use are available in general.


You can get 64-bit versions of x264.exe and ffmpeg.exe. Not sure what you use to transcode (besides VRD, if anything). I have done very little straight transcoding (always process with avisynth), but with 64-bit avisynth and 64-bit x264, I could see ~10% higher conversion speeds. 64-bit avisynth wasn't particularly stable though, so I reverted back to 32-bit.


----------



## cweb

2.0c works fine on my Mac, but not ver 2.0e. With 2.0e, vidmgr acts like everything is good and successfully done, but on the tivo I either get nothing or in the todo list it indicates that it will start the transfer after others are completed (there is nothing to complete and the transfer never starts). Restarting the Tivos doesn't help.

What might I need to do in v2.0e vs. 2.0c?


----------



## bwall23

bwall23 said:


> Working! Uninstalled, then reinstalled all 64 bit - Python 2.7.2, PIL 1.1.7 and pywin32 build 216.
> 
> How can I get the filename to display in the info screen (when I press the remote info button). It appears I have recordings of shows where the metadata says they're an episode Title that they aren't and I need a way to identify what files they are. Would be nice to get filename.ext displayed. I tried editing the vidmgr.ini to include the following, but it didn't display the filename
> 
> 
> Code:
> 
> 
> # 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.
> #       default: metaignore=isEpisode isEpisodic
> #                metafirst=title seriesTitle episodeTitle description
> #                metaspacebefore=
> #                metaspaceafter=
> #
> # metaignore=
> metafirst=[B][COLOR="Red"]file[/COLOR][/B] title seriesTitle episodeTitle description
> # metaspacebefore=
> # metaspaceafter=
> 
> Also want to add that it appears it isn't parsing the pytivo.conf file correctly.
> It errors out stating there is no port= line in my pytivo.conf, but there is.
> 
> 
> Code:
> 
> 
> port = 9032
> 
> I had to add this line in vidmgr.ini to stop the error
> 
> 
> Code:
> 
> 
> pytivo1.port=9032


pyTiVo pushes to both my TiVos, but vidmgr does not. The eye candy is extremely nice, I really like the HD I/F and power of group/sort using metadata (what I thought WIN7 libraries could do for me, but don't), but it fails the basics trying to push to both my tivos. Needs some work. Not sure if it's in the documentation department or the coding department, but it doesn't work as advertised for me.


----------



## dlfl

bwall23 said:


> ........ Needs some work. Not sure if it's in the documentation department or the coding department, but it doesn't work as advertised for me.


"As Advertised" ?? This is freeware. Don't recall seeing any advertisements.


----------



## bwall23

dlfl said:


> "As Advertised" ?? This is freeware. Don't recall seeing any advertisements.


OK jbernardis/dlfl. I thought this was the OP's (jbernardis) thread. RU He or just answering for he?


----------



## lrhorer

bwall23 said:


> How can I get the filename to display in the info screen (when I press the remote info button).


The easiest way would be to add a metafield for the filename. A simple script could go through and add the filename to every metafile. Something like this:



Code:


#! /bin/bash
while read fileName
do
   [[ -a "$fileName.txt" ]] && ! grep -q "$fileName" "fileName.txt" && ( echo "fileName : $fileName" >> "$fileName.txt" )
done < <(find /RAID/Recordings -name "*.mp[4g]")

Something similar can be written for cmd.exe, if one doesn't have bash.


----------



## lrhorer

bwall23 said:


> pyTiVo pushes to both my TiVos, but vidmgr does not. The eye candy is extremely nice, I really like the HD I/F and power of group/sort using metadata (what I thought WIN7 libraries could do for me, but don't), but it fails the basics trying to push to both my tivos. Needs some work. Not sure if it's in the documentation department or the coding department, but it doesn't work as advertised for me.


You haven't posted any of the relevant lines from vidmgr.ini. Please do so. In the mean time, here are the relevant lines from my vidmgr.ini:



Code:


[tivos]
tivo1.name=LivingRoom
tivo1.tsn=648-xxxx-yyyy-zzzz
tivo2.name=Theater
tivo2.tsn=648-xxxx-yyyy-zzzz
tivo3.name=TiVoHD
tivo3.tsn=652-xxxx-yyyy-zzzz

[pytivos]
pytivo1.config=/usr/share/pyTivo/pyTivo.conf
pytivo1.ip=192.168.1.50
pytivo1.port=9032

You must have at least 1 tivo with its name and TSN definied and at least 1 pyTivo server defined with its config file, IP address, and TCP/IP port.


----------



## bwall23

lrhorer said:


> You haven't posted any of the relevant lines from vidmgr.ini. Please do so. In the mean time, here are the relevant lines from my vidmgr.ini:
> 
> 
> 
> Code:
> 
> 
> [tivos]
> tivo1.name=LivingRoom
> tivo1.tsn=648-xxxx-yyyy-zzzz
> tivo2.name=Theater
> tivo2.tsn=648-xxxx-yyyy-zzzz
> tivo3.name=TiVoHD
> tivo3.tsn=652-xxxx-yyyy-zzzz
> 
> [pytivos]
> pytivo1.config=/usr/share/pyTivo/pyTivo.conf
> pytivo1.ip=192.168.1.50
> pytivo1.port=9032
> 
> You must have at least 1 tivo with its name and TSN definied and at least 1 pyTivo server defined with its config file, IP address, and TCP/IP port.


Thanks lrhorer, I got it working now. The problem occurred because I followed the instructions in the vidmgr.ini file for configuration. The instructions state you have to provide the ip address of the pc running pytivo, well I put that in there but when I tested it had received a different ip via dhcp. Since both pytivo and vidmgr are running on the same pc, I simply commented out the line # pytivo1.ip=192.168.1.101

working vidmgr.ini


Code:


[vidmgr]
exts=.avi .flv .mp4 .mpg .tivo .wmv
metafirst=episodeTitle file description
deleteallowed=False
display=episodeTitle file
sharepage=False
usefileid=False

[tivos]
tivo1.name=TiVo1
tivo1.tsn=746-xxxx-yyyy-zzzz
tivo2.name=TiVo2
tivo2.tsn=652-xxxx-yyyy-zzzz

[pytivos]
pytivo1.config=C:\PyTiVo\pytivo.conf
# pytivo1.ip=192.168.1.101
pytivo1.port=9032


----------



## lrhorer

bwall23 said:


> Thanks lrhorer, I got it working now.


Glad to hear it.



bwall23 said:


> The instructions state you have to provide the ip address of the pc running pytivo, well I put that in there but when I tested it had received a different ip via dhcp. Since both pytivo and vidmgr are running on the same pc, I simply commented out the line # pytivo1.ip=192.168.1.101


Automatically setting any IP via DHCP (or whatever) on a server is a really bad idea. Servers of any sort should have a static IP (except for an X-server).


----------



## bwall23

lrhorer said:


> Automatically setting any IP via DHCP (or whatever) on a server is a really bad idea. Servers of any sort should have a static IP (except for an X-server).


I'm aware of that. I don't run any dedicated server, it's my pc I'm using for pytivo and vidmgr. I only use them occasionaly when I want to access the vids on my external drives from one of my tivos. The point I was trying to make is that the instructions are misleading. If you have both pytivo and vidmgr running on the same pc you don't need to specifiy the ip in the vidmgr.ini file.


----------



## lrhorer

bwall23 said:


> I'm aware of that. I don't run any dedicated server, it's my pc I'm using for pytivo and vidmgr. I only use them occasionaly when I want to access the vids on my external drives from one of my tivos.


It doesn't matter if it is dedicated, or not. Of course you are free to do whatever you like. It's your PC. It's just that problems just like the one you encountered are highly likely if one does not have a static IP for any server, dedicated or otherwise.



bwall23 said:


> The point I was trying to make is that the instructions are misleading. If you have both pytivo and vidmgr running on the same pc you don't need to specifiy the ip in the vidmgr.ini file.


That's not future proof. It could easily quit working with a new release. A better work-around would be to set the IP address to "localhost". I'll leave it to jbernardis to address the issue of the documentation.


----------



## bwall23

lrhorer said:


> It doesn't matter if it is dedicated, or not. Of course you are free to do whatever you like. It's your PC. It's just that problems just like the one you encountered are highly likely if one does not have a static IP for any server, dedicated or otherwise.


Appreciate your concern and help, but I was instrumental implementing a couple RFC's, so know about DHCP and servers.


----------



## bwall23

lrhorer said:


> The easiest way would be to add a metafield for the filename. A simple script could go through and add the filename to every metafile. Something like this:
> 
> 
> 
> Code:
> 
> 
> #! /bin/bash
> while read fileName
> do
> [[ -a "$fileName.txt" ]] && ! grep -q "$fileName" "fileName.txt" && ( echo "fileName : $fileName" >> "$fileName.txt" )
> done < <(find /RAID/Recordings -name "*.mp[4g]")
> 
> Something similar can be written for cmd.exe, if one doesn't have bash.


Thanks, could do that, but it's not gonna happen. I'm not about to mod a couple thousand meta files when an app could do what I want. If not this app, then another.


----------



## lrhorer

bwall23 said:


> Thanks, could do that, but it's not gonna happen. I'm not about to mod a couple thousand meta files when an app could do what I want. If not this app, then another.


That makes no sense whatsoever:

1. It's not like running such a script is difficult or time consuming, or requires anything whatsoever of the user. The user doesn't even have to run the script. It can be run under a cron job (or under the Windows scheduler, if it is a Windows machine).

2. It's not like modifying the metafiles has any detrimental effect on the files or any application that uses them.

3. "You" wouldn't be modifying the files. The script would.

4. It has to be this app, which means getting jbernardis to code your request. It's not a terribly difficult thing to code, but that's up to him. It can't be some other app that displays the file name when you press <Info> in the vidmgr menu.

5. Adding a metafield to the metafiles is a much simpler, cleaner, more portable, and more readily controlled method than modifying an app for the purpose. The result can be tailored specifically to suit the user's taste.


----------



## tastyratz

Is there any kind of actual start to finish guide on setting this up for new users? I feel like I need to be a seasoned progammer to get this to work. I want this application badly and spent probably the better part of 3 hours trying to figure it out last night. I am hardly incapable or computarded, but the documentation revolving around it all I feel is severely lacking with gaping holes. Everything assumes you already setup python apps all the time!

I certainly am not one to demand spoonfeeding, but why is it I feel the whole thing could easily be "setup" from someone repackaging the python directory into a zip file, with only a config file to edit and point to media locations? 
Hell it took me half of that time to even figure out why pyhme was! 

Am I missing something? why no step by step?


----------



## windracer

vidmgr is an add-on for pyTivo, so you'll need that running first.

http://pytivo.sourceforge.net/wiki/index.php/PyTivo

After you have pyTivo working, check out the README file in the vidmgr download for the steps to set it up.


----------



## jcthorne

tastyraz has a point though. A wiki page with step by step set up instructions specific to windows like we have for pytivo would be helpful to new users. Perhaps even an example ini file. Just thinking out loud, I really don't have time to tackle it right now but perhaps one of these days.


----------



## tastyratz

oh it DOES require pytivo ok, I couldn't really tell from what I was reading I gathered it as a replacement. I will work on getting pytivo setup then.

I would definitely love an example ini file, I was surprised to even not find one banked or commented out. I am sure there are many things that can be added or configured that aren't even mentioned.

so to recap:
I have to get python installed as well as ffmpeg
then install and configure wmcbrine pytivo
then wmcbrine pyhme
then vidmgr

Some have 32 and some 64 bit installs. I currently run windows 7 64 bit. Should I be pointing to 64 bit ffmpeg? Are there any other gotchas I could run into?

I'm setting up the folder structure as follows or do they requires a different subdirectory/nested layout:
pytivo C:\Python27\wmcbrine\
ffmpeg exe's C:\Python27\wmcbrine\bin\32\ (or 64?)
pyhme C:\Python27\pyhme
vidmgr C:\Python27\pyhme\vidmgr

To get this to work I will need to edit the appropriate pytivo.conf, the config.ini.
Then I will have to... launch pytivo.py as well as start.py for pyhme which auto kicks off vidmgr?

I am trying to do this remotely so I can use it on my tv when I get home.
I setup my pyhme config as follows (with desktop being the computer name):


> [hmeserver]
> apps=vidmgr
> 
> [tivos]
> tivo1.name=TivoS3
> tivo1.tsn=TivoS3
> 
> [pytivos]
> pytivo1.config=C:\Python27\wmcbrine\pyTivo.conf
> pytivo1.ip=desktop
> pytivo1.port=9033
> pytivo1.sep=\


when I launch start.py I am getting an error that says it is skipping vidmgr no module named image.


----------



## dlfl

tastyratz said:


> .......Some have 32 and some 64 bit installs. I currently run windows 7 64 bit. Should I be pointing to 64 bit ffmpeg? Are there any other gotchas I could run into?


Recommend either ALL 32 bit or ALL 64 bit to avoid incompatibilities. My preference is all 32-bit because those versions are more commonly available and I suspect they get more development and testing effort. Theoretically 64-bit ffmpeg encoding should go a little faster but I'm not sure what actually is achieved.


----------



## jcthorne

txporter said:


> You can get 64-bit versions of x264.exe and ffmpeg.exe. Not sure what you use to transcode (besides VRD, if anything). I have done very little straight transcoding (always process with avisynth), but with 64-bit avisynth and 64-bit x264, I could see ~10% higher conversion speeds. 64-bit avisynth wasn't particularly stable though, so I reverted back to 32-bit.


I saw about the same. Also without a 64bit version of dgindexNV my difference with the 64bit x264 was less than a 5% improvement. And FAR less stablity. One recode after failur an hour into a recode nixes a LOT of slightly faster code.

I too went back to 32bit for everything on the encoding. Besides, my corporate laptop is still stuck running XP so this way everything runs the same kit.


----------



## bwall23

tastyratz said:


> when I launch start.py I am getting an error that says it is skipping vidmgr no module named image.


You need P.I.L. I've got it working after installing Python 2.7.2, PIL 1.1.7 and pywin32 build 216 on Win7-64


----------



## tastyratz

oh ok I thought I didn't need that unless I wanted pictures (didn't care for em)
I just tried to install it an it just tells me it cant find python in the registry then wont let me continue.
I also see pywin32 for 32 or for 64. Since the name is python 32 I am assuming its 32 bit extensions, so does that mean 64 is the right choice here or 32 since I will just stick to 32?
bwall; which did you install


----------



## bwall23

tastyratz said:


> oh ok I thought I didn't need that unless I wanted pictures (didn't care for em)
> I just tried to install it an it just tells me it cant find python in the registry then wont let me continue.
> I also see pywin32 for 32 or for 64. Since the name is python 32 I am assuming its 32 bit extensions, so does that mean 64 is the right choice here or 32 since I will just stick to 32?
> bwall; which did you install


Both, go back a page and start reading at post#469. You have to modify your registry if you want to install the 32 bit PIL. I have no problems installing and using all 64 bit.
Don't let the name pywin32 fool you. It's basically win32 file extensions but is available compiled for either 32 or 64 bit.
The key is you have to have all three packages I mentioned matching. All three 32 bit or all three 64 bit.


----------



## jbernardis

bwall23 said:


> How can I get the filename to display in the info screen (when I press the remote info button).


The info screen only displays what is in the metadata file. If there is not a tag "file : name" in your file, then adding "file" to the list of metatags will have no affect.

You COULD say display=file in your vidmgr.ini and the filename will be used on the navigation lists where you normally see the titles. This would give you what you want long enough to debug and then you could switch it back.

Alternatively, I could put the filename into the meta data if people want that. The only thing it would affect would be the info screen, and I could make the default action be to ignore it.



> Also want to add that it appears it isn't parsing the pytivo.conf file correctly.
> It errors out stating there is no port= line in my pytivo.conf...


Here is the line of code that parses the port out of your pytivo config file:


Code:


if pyconfig.has_option('Server', 'port') : port = pyconfig.get('Server', 'port')

the port MUST be inside the Server section of the config file.


----------



## jcthorne

jbernardis,

Have you given any thought to expanding vidmgr to handle audio files? Would be very nice if it could display albums etc and sort by artist, album etc just like it does for videos. Then play the requested track, album or playlist. Essentially replacing what harmonium does with a python ap and menu system consistant with vidmgr which I might add does a VERY nice job with video.

Doing this would make it possible to move the music functions over to a NAS box running python rather than needing a pc.

Just a hope that you might be interested in a project that needs your touch.

Thanks,

jcthorne


----------



## jbernardis

jcthorne said:


> Have you given any thought to expanding vidmgr to handle audio files? ...


I HAVE thought about it, and have even toyed around with it, but it would be a very different beast. Vidmgr does not actually play and video - it relies on pytivo to do the pushing. What you are asking for is a streamer. It's possible to do - yes, but it is not just a "simple" extension to vidmgr.

BTW - apparently I feel the same way as you do. I love (and use) Harmonium, but I run pytivo and vidmgr on my NAS and I'd like to run Harmonium there too. But I don't have a JRE there and I am reluctant to find and install one. It would be so much simpler if it was in python.

Also - thanks for the kind words!!


----------



## jcthorne

I knew it was not a simple task. Glad to know you are considering it. Thats more than I can do.


----------



## bwall23

jbernardis said:


> The info screen only displays what is in the metadata file. If there is not a tag "file : name" in your file, then adding "file" to the list of metatags will have no affect.
> 
> You COULD say display=file in your vidmgr.ini and the filename will be used on the navigation lists where you normally see the titles. This would give you what you want long enough to debug and then you could switch it back.
> 
> Alternatively, I could put the filename into the meta data if people want that. The only thing it would affect would be the info screen, and I could make the default action be to ignore it.


No big deal, I'm not going to modify thousands of medadata text files. kmttg creates them when I pull them from my TiVos. Just thought if it was an easy mod...



jbernardis said:


> Here is the line of code that parses the port out of your pytivo config file:
> 
> 
> Code:
> 
> 
> if pyconfig.has_option('Server', 'port') : port = pyconfig.get('Server', 'port')
> 
> the port MUST be inside the Server section of the config file.


Here's my complete pytivo.conf (edited [#] for privacy);


Code:


[MyVideos]
force_alpha = True
type = video
path = V:\Videos

[_tivo_SD]

[_tivo_HD]

[Server]
beacon = 192.168.1.255
ffmpeg = C:\kmttg\ffmpeg\ffmpeg.exe
ffmpeg_pram = -threads 4
port = 9032
tdcat = C:\kmttg\tivodecode\tdcat.exe
tivo_mak = ##########
tivo_password = ##########
tivo_username = ##########
tivodecode = C:\kmttg\tivodecode\tivodecode.exe
togo_path = MyVideos

And vidmgr.ini;


Code:


#
# vidmgr.ini is the global options file - it belongs in the vidmgr directory under pyhme
#
[vidmgr]
exts=.avi .flv .mp4 .mpg .tivo .wmv
metafirst=title episodeTitle fileName description
metamergefiles=True
deleteallowed=False
display=episodeTitle file
sharepage=False
usefileid=False
[tivos]
tivo1.name=TiVo1
tivo1.tsn=746############
tivo2.name=TiVo2
tivo2.tsn=652############
[pytivos]
pytivo1.config=C:\PyTiVo\pytivo.conf
pytivo1.port=9032

P.S. THANKS for the Great app, LOVE IT!


----------



## jcthorne

Any way for a web browser to see what vidmgr presents on tivo? Or could this be added?


----------



## jbernardis

jcthorne said:


> Any way for a web browser to see what vidmgr presents on tivo? Or could this be added?


This would be a totally different app - different life cycle, different method of invocation. It could be done, but it would be a completely new program.


----------



## jbernardis

bwall23 said:


> Here's my complete pytivo.conf (edited [#] for privacy);
> 
> And vidmgr.ini;


Thanks bwall23 for persisting with this. There most definitely was a problem. When I was restructuring some code earlier I forgot to move where I tested for the port number. Should be fixed now.

Version 2.0f is up on github (see my signature)


----------



## jcthorne

jbernardis said:


> This would be a totally different app - different life cycle, different method of invocation. It could be done, but it would be a completely new program.


Thanks for the clairification. Please don't think another thing of it. Was just thinking out loud.


----------



## jbernardis

I just updated github with version 2.0g. This release includes the following:

- added __fileName and __filePath as automatic metadata items. These are also in the default ignore list so they don't show up in the info view. If you want to see them, you need to redefine metaignore (in vidmgr.ini) to NOT include these names

- Fixed the sorting logic that caused titles like "Alien" to sort AFTER "Alien 3"

- added new vidmgr.ini option - ignorearticle - that will ignore an article (the, a, or an) at the beginning of a title. Thus, "The Abyss" will sort with the A's instead of the T's. The default value of this is True so this new behavior will occur unless you change it to False. This also affects alpha virtual shares: The Abyss will be included with the A's and not with the T's


----------



## jbernardis

jcthorne said:


> Thanks for the clairification. Please don't think another thing of it. Was just thinking out loud.


No problem at all.

If people never made suggestions, vidmgr would still be a very simple text-based SD application. Suggestions made here have shaped it into what it has become.


----------



## bwall23

jbernardis said:


> I just updated github with version 2.0g. This release includes the following:
> 
> - added __fileName and __filePath as automatic metadata items. These are also in the default ignore list so they don't show up in the info view. If you want to see them, you need to redefine metaignore (in vidmgr.ini) to NOT include these names
> 
> - Fixed the sorting logic that caused titles like "Alien" to sort AFTER "Alien 3"
> 
> - added new vidmgr.ini option - ignorearticle - that will ignore an article (the, a, or an) at the beginning of a title. Thus, "The Abyss" will sort with the A's instead of the T's. The default value of this is True so this new behavior will occur unless you change it to False. This also affects alpha virtual shares: The Abyss will be included with the A's and not with the T's


Thanks for the fixes jbernardis, both the port and filename fixes are working! I was able to find a few recorded shows where the TiVo metadata was incorrect and converted them to MP4 w/metadata to correct them.

Question about the filename.
I have the following in my vidmgr.ini and both display the filename in the info screen.


Code:


metafirst=title episodeTitle [COLOR="Red"]__fileName[/COLOR] description [COLOR="red"]fileName[/COLOR]

Which is the correct one to use, going forward?

On the INFO screen;
First one '__fileName' displays as File Name
Second one 'fileName' displays as fileName

Thanks Again for the great app

P.S. forget about the comment on 'fileName'.
I forgot I tried this on two of my files as a test;
http://www.tivocommunity.com/tivo-vb/showthread.php?p=8798355#post8798355
I like your fix a lot better since I don't have to mod thousands of meta text files gen'd from kmttg to accomplish this.


----------



## jbernardis

bwall23 said:


> Which is the correct one to use, going forward?
> 
> On the INFO screen;
> First one '__fileName' displays as File Name
> Second one 'fileName' displays as fileName
> 
> Thanks Again for the great app
> 
> P.S. forget about the comment on 'fileName'.


Just a FYI - I had originally supported a tag named 'file' that could be used in the 'display' vidmgr.ini statement; this inserted the filename into the navigation display. This was not actually a metadata item and was supported by logic when the display string was being built. This is no longer necessary - __fileName supplants it. However, 'file' in this context is still supported for backward compatibility.


----------



## lrhorer

jbernardis said:


> No problem at all.
> 
> If people never made suggestions, vidmgr would still be a very simple text-based SD application. Suggestions made here have shaped it into what it has become.


Which is a very fine product, indeed.


----------



## lrhorer

I just downloaded the most recent git, and I am getting the following error:



Code:


Traceback (most recent call last):
  File "/usr/share/pyhme/vidmgr/BuildCache.py", line 17, in <module>
    c.build()
  File "/usr/share/pyhme/vidmgr/VideoCache.py", line 281, in build
    h = KeyValHarvester(section, lopts, vdict)
  File "/usr/share/pyhme/vidmgr/Meta.py", line 172, in __init__
    Harvester.__init__(name, opts)
TypeError: unbound method __init__() must be called with Harvester instance as first argument (got str instance instead)

I haven't done any merging from the ini.dist file.


----------



## jbernardis

lrhorer said:


> I just downloaded the most recent git, and I am getting the following error:
> 
> 
> 
> Code:
> 
> 
> Traceback (most recent call last):
> File "/usr/share/pyhme/vidmgr/BuildCache.py", line 17, in <module>
> c.build()
> File "/usr/share/pyhme/vidmgr/VideoCache.py", line 281, in build
> h = KeyValHarvester(section, lopts, vdict)
> File "/usr/share/pyhme/vidmgr/Meta.py", line 172, in __init__
> Harvester.__init__(name, opts)
> TypeError: unbound method __init__() must be called with Harvester instance as first argument (got str instance instead)
> 
> I haven't done any merging from the ini.dist file.


This error has been corrected by the most recent git - Version 2.0h posted today.

Thanks LRhorer for finding it.


----------



## lrhorer

If something can be broken, count on me to do it.


----------



## Squirl1899

I am using ThumbGen to create Movie Sheets and are automatically naming them movei.mkv.jpg. This works great with VidMgr if I don't have them in separate folders but just in one big folder and all the files are in that one folder. The problem with that, Windows Media Center does not see any of the thumbnails. On the other hand if I keep all the files in separate folders, i.e. Movie\Movie.mkv, folder.jpg, moviename.mkv.jpg I can get Windows Media center to work just fine with the folder.jpg files but VidMgr only shows the folder.jpg thumbnail and NOT the movie sheet unless I actually click on the folder, then the movie sheet is there. I want the movie sheet to be there in the folder view AND when I click on the actual folder. If I rename the movie sheet to folder.jpg Windows Media center will pull it up but it doesn't work because it is a movie sheet and not a thumbnail and is not readable.

The question is, can I have VidMgr use the movie.mkv.jpg for the folder view instead of it using the folder.jpg as the default folder view? That way, it would work with both Media Center and VidMgr.


----------



## lrhorer

Squirl1899 said:


> I am using ThumbGen to create Movie Sheets and are automatically naming them movei.mkv.jpg. This works great with VidMgr if I don't have them in separate folders but just in one big folder and all the files are in that one folder. The problem with that, Windows Media Center does not see any of the thumbnails. On the other hand if I keep all the files in separate folders, i.e. Movie\Movie.mkv, folder.jpg, moviename.mkv.jpg I can get Windows Media center to work just fine with the folder.jpg files but VidMgr only shows the folder.jpg thumbnail and NOT the movie sheet unless I actually click on the folder, then the movie sheet is there. I want the movie sheet to be there in the folder view AND when I click on the actual folder.


Why not just create the main file wherever is best under whatever name is best, and then create a link with the other name in whatever location is required? The process is a bit clumsy under Windows, but not difficult.



Squirl1899 said:


> If I rename the movie sheet to folder.jpg Windows Media center will pull it up but it doesn't work because it is a movie sheet and not a thumbnail and is not readable.


If it pulls it up, how can it be that it doesn't work or isn't readable? By definition, if the app pulls up a file, it has read it.


----------



## Squirl1899

lrhorer said:


> Why not just create the main file wherever is best under whatever name is best, and then create a link with the other name in whatever location is required? The process is a bit clumsy under Windows, but not difficult.


I don't quite understand since both files need to be named folder.jpg. Even if I create a link, it will still be a folder.jpg link so there will be 2 files in the same folder named folder.jpg one will just be a link. How will VidMgr and Windows Media Center know the correct one to use? Windows Media Center needs to use the 200x300 and VidMgr needs to use the 1280x720 one. I attached samples to my original post so you can see the difference between the two.



lrhorer said:


> If it pulls it up, how can it be that it doesn't work or isn't readable? By definition, if the app pulls up a file, it has read it.


Not that the app hasn't read it, it isn't readable by me because the movie sheet is in a 1280x720 format not a 200x300 like regular cover art. So even though WMC pulls up the movie sheet if it is named folder.jpg it is too scrunched up to read.

The way VidMgr works now when I have the movies in their own seperate folders is:

* When I highlight the folder VidMgr displays the 200x300 thumbnail that is named folder.jpg and when I click on the actual folder VidMgr displays the 1280x720 movie sheet that is labeled moviename.mkv.jpg. If I change the movie sheet to folder.jpg then VidMgr will display the movie sheet when I highlight the folder AND when I click on the folder.

* In WMC it will ONLY use the folder.jpg file so if I change the movie sheet to folder.jpg the image isn't formatted correctly so it is not a viable workaround.

What I am looking for is a way to have VidMgr use the moviename.mkv.jpg when I highlight the folder and when I click on the folder. Right now it only uses the moviename.mkv.jpg when I click on the actual folder.

I hope that helps to clarify the issue and thanks for the reply.


----------



## jbernardis

Squirl1899 said:


> What I am looking for is a way to have VidMgr use the moviename.mkv.jpg when I highlight the folder and when I click on the folder. Right now it only uses the moviename.mkv.jpg when I click on the actual folder.


The logic to search for the image file is centralized in DetailDisplayManager.py. Here is the code:


Code:


	def getThumb(self, dir, name, isDVD):
		thumb = None
		names = []
		names.append(os.path.join(dir, name + '.jpg'))
		names.append(os.path.join(dir, '.meta', name + '.jpg'))
		names.append(os.path.join(dir, 'folder.jpg'))
		names.append(os.path.join(dir, '.meta', 'folder.jpg'))
		if isDVD: 
			names.append(os.path.join(dir, 'default.jpg'))
			names.append(os.path.join(dir, '.meta', 'default.jpg'))
			
...
	
	def getDirThumb(self, dir, isDVD):
		thumb = None
		names = []
		names.append(os.path.join(dir, 'folder.jpg'))
		names.append(os.path.join(dir, '.meta', 'folder.jpg'))
		if isDVD: 
			names.append(os.path.join(dir, 'default.jpg'))
			names.append(os.path.join(dir, '.meta', 'default.jpg'))

...

The first routine is for finding the thumbnail for a video file, and the second routine is for a directory. In the case of the directory, there is no file name to use. The directory can potentially have many files - how would I know which one to choose to use as the basis for the image file name?

How about this - what if I allow you to specify via the ini file an alternate file name to use. The default would be folder.jpg, so people not wanting this feature would be unaffected. This way you'd have to make a copy of (or a link to) the movie.mkv.jpg file to the name you specify, and I would look for that file instead of folder.jpg. WMC could then use folder.jpg.


----------



## lrhorer

Squirl1899 said:


> I don't quite understand since both files need to be named folder.jpg. Even if I create a link, it will still be a folder.jpg link so there will be 2 files in the same folder named folder.jpg one will just be a link.


No, they cannot have the same name. I think maybe I had it backwards. You don't want the same content under two different names, but rather want vidmgr to pick up one file and WMC the other, but both applications are looking for a file named folder.jpg. Is that right?



Squirl1899 said:


> How will VidMgr and Windows Media Center know the correct one to use? Windows Media Center needs to use the 200x300 and VidMgr needs to use the 1280x720 one. I attached samples to my original post so you can see the difference between the two.


Again, two files cannot have the same name (in a single directory), so one is going to have to be named something other than folder.jpg.



Squirl1899 said:


> What I am looking for is a way to have VidMgr use the moviename.mkv.jpg when I highlight the folder and when I click on the folder. Right now it only uses the moviename.mkv.jpg when I click on the actual folder.
> 
> I hope that helps to clarify the issue and thanks for the reply.


Yes.


----------



## jbernardis

lrhorer said:


> No, they cannot have the same name. I think maybe I had it backwards. You don't want the same content under two different names, but rather want vidmgr to pick up one file and WMC the other, but both applications are looking for a file named folder.jpg. Is that right?


Yeah - this was my assumption too, which is why I suggested that I could, through an ini file entry, use a name alternate to folder.jpg. I have actually made this change already, but I haven't yet packaged it for git because I haven't heard a response to my suggestion.


----------



## Squirl1899

jbernardis said:


> The logic to search for the image file is centralized in DetailDisplayManager.py. Here is the code:
> 
> 
> Code:
> 
> 
> def getThumb(self, dir, name, isDVD):
> thumb = None
> names = []
> names.append(os.path.join(dir, name + '.jpg'))
> names.append(os.path.join(dir, '.meta', name + '.jpg'))
> names.append(os.path.join(dir, 'folder.jpg'))
> names.append(os.path.join(dir, '.meta', 'folder.jpg'))
> if isDVD:
> names.append(os.path.join(dir, 'default.jpg'))
> names.append(os.path.join(dir, '.meta', 'default.jpg'))
> 
> ...
> 
> def getDirThumb(self, dir, isDVD):
> thumb = None
> names = []
> names.append(os.path.join(dir, 'folder.jpg'))
> names.append(os.path.join(dir, '.meta', 'folder.jpg'))
> if isDVD:
> names.append(os.path.join(dir, 'default.jpg'))
> names.append(os.path.join(dir, '.meta', 'default.jpg'))
> 
> ...
> 
> The first routine is for finding the thumbnail for a video file, and the second routine is for a directory. In the case of the directory, there is no file name to use. The directory can potentially have many files - how would I know which one to choose to use as the basis for the image file name?
> 
> How about this - what if I allow you to specify via the ini file an alternate file name to use. The default would be folder.jpg, so people not wanting this feature would be unaffected. This way you'd have to make a copy of (or a link to) the movie.mkv.jpg file to the name you specify, and I would look for that file instead of folder.jpg. WMC could then use folder.jpg.


Sorry for the delay, have been busy with the holidays. That sounds like a perfect solution. If I can have VidMgr to look for moviename.mkv.jpg then that would work perfectly. I know that is what it looks for when I actually click on the corresponding folder. Thanks for the quick reply and an amazing product.


----------



## jbernardis

Squirl1899 said:


> ... If I can have VidMgr to look for moviename.mkv.jpg then that would work perfectly. ...


Let's be clear here. I am proposing having vidmgr look for a *fixed* file name that is different than folder.jpg. Every directory would need to have the same named file, but it would be different than folder.jpg.

I am not proposing that the new file name be a function of the video file name, nor do I want to make that change. I think a fixed file name will work for you; you will just have to create a link to each "moviename.mkv.jpg" file in each directory.

I think inherent to the problem here is that you seem to have one video file per directory. Most people using this app have multiple. With multiple files, it is impossible to tell which jpg file should stand for the entire directory. I am willing to give you a fixed alternative to the folder.jpg name.


----------



## Squirl1899

jbernardis said:


> Let's be clear here. I am proposing having vidmgr look for a *fixed* file name that is different than folder.jpg. Every directory would need to have the same named file, but it would be different than folder.jpg.
> 
> I am not proposing that the new file name be a function of the video file name, nor do I want to make that change. I think a fixed file name will work for you; you will just have to create a link to each "moviename.mkv.jpg" file in each directory.


That is fine with me, I can have Thumbnail Generator name the files whatever I want, I forgot which program I was using that needed it moviename.mkv.jpg but it worked with VidMgr when I had all the files in a single directory so I just stuck with it.



jbernardis said:


> I think inherent to the problem here is that you seem to have one video file per directory. Most people using this app have multiple. With multiple files, it is impossible to tell which jpg file should stand for the entire directory. I am willing to give you a fixed alternative to the folder.jpg name.


That is how I currently have the majority of my 8TB of movies stored, under a single directory on each hard drive. The issue came up when I my 18 month old pulled the portable dvd player off the counter and I decided to make an old laptop a media center and just stream the movies via Windows Media Center. I couldn't get the cover art to work and after a lot of searching I found out that WMC REQUIRES individual folders and will only read the folder.jpg file for the cover art. I figured it would be easier to ask you to do your magic than trying to get Microsoft to rewrite their WMC code...LOL!!

So the bottom line is, just let me know what alternate name it needs to be and I will begin the arduous task of combining all of my movies into individual folders to satisfy the sadist at MS..LOL. GREAT PROGRAM btw, it has been a lot easier than switching to my PS3 each time and using PS3 Media Server. This way, my non technical wife can even do it. ;-) Thanks for the hard work and is there a way to donate to the cause?


----------



## jbernardis

Squirl1899 said:


> ... So the bottom line is, just let me know what alternate name it needs to be and I will begin the arduous task of combining all of my movies into individual folders to satisfy the sadist at MS...


No specific name is needed - you can decide for yourself. You will just have to specify it in the ini file. I will post it this evening and include instructions at that time.



> Thanks for the hard work and is there a way to donate to the cause?


Thanks for the kind words - no donation necessary.


----------



## Squirl1899

jbernardis said:


> No specific name is needed - you can decide for yourself. You will just have to specify it in the ini file. I will post it this evening and include instructions at that time.


Great, can't wait to try it out.


----------



## Squirl1899

JBernardis, is there a site for customized skins? I think it would be pretty cool to see what others have done to customize their VidMgr. Just a thought.


----------



## Squirl1899

For those of you interested I use ThumbGen for my movie sheets, you can download it from http://thumbgen.org/


----------



## lrhorer

Squirl1899 said:


> JBernardis, is there a site for customized skins? I think it would be pretty cool to see what others have done to customize their VidMgr. Just a thought.


'Not a bad idea.


----------



## jbernardis

Version 2.0i is not available at github (see my signature). This version adds a new vidmgr.ini parameter:

thumbfolderfn=filename

If this is not specified, the value "folder.jpg" is assumed so that there will be no difference in operation for those who do not use this feature.

This is described in the vidmgr.ini.dist


And to my knowledge, there is no site for other skins.


----------



## Squirl1899

jbernardis said:


> Version 2.0i is not available at github (see my signature). This version adds a new vidmgr.ini parameter:
> 
> thumbfolderfn=filename
> 
> If this is not specified, the value "folder.jpg" is assumed so that there will be no difference in operation for those who do not use this feature.
> 
> This is described in the vidmgr.ini.dist
> 
> And to my knowledge, there is no site for other skins.


Works perfectly, I am now in the process of moving everything into their own individual folders and then letting ThumbGen run overnight to create a movie.jpg file in each folder. GREAT WORK and thanks a TON!!!


----------



## cweb

Been having recent problems running vidmgr from my Mac.

Approximately 1/3 of the time it runs perfectly. 1/3 of the time I am getting an issue where the shares are being shown correctly, but when selected there are no shows available (the counts for each share also show 0). Pytivo runs just fine.

The other third of the time I get an "http connection error 0x50005" error when selecting vidmgr.

Restarting vidmgr or the tivos may of may not temporarily resolve the problem.

Any ideas as to what may be causing the two issues.

Thanks in advance.


----------



## jbernardis

Not off hand. 

It sounds like some kind of networking issue. Are you sure you don't have pyhme running twice, or perhaps something else competing for the same port number? The error message you mention does not come from my code.


----------



## lrhorer

jbernardis said:


> And to my knowledge, there is no site for other skins.


I suppose I could host one. I have a couple of websites. How many people would be interested in me putting up a skins page on one of my sites? Users could send me PMs with skins in them, and I could put them up.


----------



## cweb

jbernardis said:


> Not off hand.
> 
> It sounds like some kind of networking issue. Are you sure you don't have pyhme running twice, or perhaps something else competing for the same port number? The error message you mention does not come from my code.


I guess the "http" could be a networking error as I do have two NICs in my machine. I've changed the ip in the vidmgr.ini and see if the http error goes away.

However, changing the IP doesn't have any impact on why vidmgr would show the pytivo share and the vidmgr shares but not the files inside them. The files continue to show up fine in pytivo.

Additional thoughts would be appreciated.


----------



## jbernardis

vidmgr does not actually read the disk in real time - everything it needs, it gets form the cache. Are you building your cache dynamically, or ahead of time? If ahead of time, are you building it on the same machine as where pyTivo is running? Does the cache building report how many files it found? Can you look at the cache to see if it makes sense? It's a large file, and it is encoded, but it's all in ascii so you can see filenames, etc in it. Do the filenames look correct or are they even there?

Did you check to see if there are any error messages in the pyhme log file? Sone have reported that standard output sometimes does not show up there - one suggestion is that it's a buffering issue. Try running pyhme in the foreground while you navigate on the tivo. See if you get any messages out there.

Hopefully this will give us some clues as to what's going on.


----------



## Squirl1899

I have 5 2TB drives attached via various connections (USB 2, USB 3, eSATA, Ethernet) and have different movies on all the different drives. I know that you can set vidmgr to pull by genre, actor, etc but I want to have it use multiple drives for a single share.

Example:
Movies
1) H:\WD 2TB ProBox\Movies
2) K:\Seagate 2TB ProBox\Movies
3) J:\WD 2TB USB\Movies

Animation
1) F:\Hitachi 2TB ProBox\Animation
2) K:\Iomega 2TB USB\Animation

I can't find a way to do it in pyTiVo or vidmgr, any help would be greatly appreciated.



Code:


[Server]
port = 9032
ffmpeg = C:\pyTiVo\bin\ffmpeg.exe
tivo_mak = xxxxxxxxxx
tdcat = C:\pyTiVo\bin\tdcat.exe
ffmpeg_wait = 10
tivo_password = xxxxxxxx
tivo_username = xxxxxxxxxxx
togo_path = K:\TiVo Recordings
tivodecode = C:\pyTiVo\bin\tivodecode.exe
temp_share = C:\pyTiVo\temp
togo_mpegts = True

[_tivo_SD]

[_tivo_HD]
bufsize = 4096k
optres = True

[Movies]
type = video
path = G:\Movies Seagate 2TB USB 3
force_alpha = True

[Animation]
type = video
path = F:\Animation
force_alpha = True

[TV Shows]
type = video
path = F:\TV Shows
force_alpha = True

[Animation - Low Res]
type = video
force_alpha = True
path = J:\Movies That Need Higher Resolution

[Childrens Shows]
type = video
path = H:\Childrens
force_alpha = True

[Movies WD 2TB USB]
path = J:\Movies WD 2TB USB
force_alpha = True
type = video

[Mini Series]
type = video
force_alpha = true
path = F:\Mini Series

[Cartoons]
path = H:\Cartoons
force_alpha = true
type = video

[National Geographic]
path = H:\National Geographic
type = video
force_alpha = True

[Movies NexStar]
path = L:\Movies Need Cover Art 11-26-11
force_alpha = True
type = video

[All Movies]
force_alpha = True
path = C:\Users\Michael\AppData\Roaming\Microsoft\Windows\Libraries\All Movies
type = video

[All Movies Libary-ms]
force_alpha = True
path = C:\Users\Michael\AppData\Roaming\Microsoft\Windows\Libraries\All Movies.library-ms
type = video

The last 2 entries were an atempt to add the folders to my windows library and just have pyTivo pull that but it didn't work either. Is this something that can be even be done in vidmgr or pyTiVo?


----------



## wmcbrine

I have only a dim understanding of Windows Libraries, but I believe they only work through Windows-specific APIs (typical crappy half-assed Windows way of doing things), rather than presenting their contents as part of the filesystem (the Right Way, also known as the Unix Way). pyTivo only uses standard filesystem calls, so it won't see the Windows Libraries. Sorry. Tell Microsoft to fix their ****.

There is currently no support in pyTivo for combining multiple directories into a single share. But it's a feature others have requested. It might not be out of the question in the future. Meanwhile, I think the best you could do would be to create filesystem-level links (but not "shortcuts" -- they're another proprietary Windows thing) under a common directory.


----------



## Squirl1899

wmcbrine said:


> I have only a dim understanding of Windows Libraries, but I believe they only work through Windows-specific APIs (typical crappy half-assed Windows way of doing things), rather than presenting their contents as part of the filesystem (the Right Way, also known as the Unix Way). pyTivo only uses standard filesystem calls, so it won't see the Windows Libraries. Sorry. Tell Microsoft to fix their ****.


I agree, pyTiVo can see the share but says there is nothing inside (thanks MS!) I was just trying to find a work around. I also tried symbolic links, hard links, junctions, shortcuts, etc but cannot get pyTiVo to see what is in the actual folders. I basically want this:

[Movies]
type = video
path = G:\Movies Seagate 2TB USB 3, J:\Movies WD 2TB USB, L:\Movies Need Cover Art 11-26-11, J:\Movies Need Cover Art
force_alpha = True

This way, all of the different drive contents would show up under a single folder instead of having to remember which movies I have on each drive. I know I can do it alphabetically but that becomes a pain if I run out of room and have to move movies from one drive to another. Not to mention when you start trying to find a movie that may or may not have "The" in the title. "The Polar Express" vs "Polar Express", etc.

Any suggestions?

But pyTiVo doesn't recognize (or it is a user error on my part) multiple path's for the same title [Movie].


----------



## jcthorne

Look into a utility called junction link magic. Then create a single directory called MOVIES and put links under that folder for each of the drives. I did this for a while before moving on to a NAS. Which is really what you need to do. At 5 external drives, you really need to start thinking of an expandable NAS system and move all the drives into it.


----------



## Squirl1899

jcthorne said:


> Look into a utility called junction link magic. Then create a single directory called MOVIES and put links under that folder for each of the drives. I did this for a while before moving on to a NAS. Which is really what you need to do. At 5 external drives, you really need to start thinking of an expandable NAS system and move all the drives into it.


TOO FUNNY! I actually just tried Junction Link Magic but it has the same drawback, I can only link a SINGLE folder/directory to another SINGLE folder/directory.

I had built my own NAS (FreeNAS) but had such a hassle with transfer rates, even though I had a gigabit card in the NAS and a WNDR3700 gigabit router. I also had issues with the SATA controller (tried 3 different types) and spent about 9 months working and tweaking it but it just became too frustrating. When I bought my new laptop with USB 3.0 I figured I would just start using that and bought a 4 bay ProBox USB 3.0 enclosure. I have three 2TB drives in their now but still have the issue of movies on diffferent drives.

If you have any other suggestions on building a NAS I am wide open.


----------



## wmcbrine

Let me ask you... if pyTivo _were_ to have a feature that combined multiple directories into one share, would you want it to work like this (as seen from the TiVo):



Code:


[share]
 |
 +-[dir1]
 |    |
 | [file in dir1]
 |
 +-[dir2]
      |
   [file in dir2]

or like this:



Code:


[share]
 |
 +-[file in dir1]
 |
 +-[file in dir2]

?


----------



## Squirl1899

wmcbrine said:


> Let me ask you... if pyTivo _were_ to have a feature that combined multiple directories into one share, would you want it to work like this (as seen from the TiVo):


The second one:



Code:


[share]
 |
 +-[file in dir1]
 |
 +-[file in dir2]

Basically



Code:


[Movies]
 - All movies in folder J:\WD 2TB USB\Movies
 - All movies in folder H:\Iomega 2TB USB\Movies
 - All movies in Folder K:\WD 2TB ProBox NAS\Movies

[Animation]
 - All movies in folder F:\Seagate 2TB ProBox NAS\Animation
 - All movies in folder G:\NexStar 1.5TB\Animation

Preferably all in alphabetical order even though they are in seperate folders. This way all movies or whatever will be listed in a single share, in alphabetical order. Right now I have about 11 shares that could be cut down to about 5. And I wouldn't have to remember which share had which movies in it. This would be the icing on the cake for pyTiVo, IMHO.

Hope I explained it well enough, if not, please let me know.


----------



## wmcbrine

Yeah, I figured you'd say that. It's the more difficult way to implement it.


----------



## jcthorne

Squirl1899 said:


> TOO FUNNY! I actually just tried Junction Link Magic but it has the same drawback, I can only link a SINGLE folder/directory to another SINGLE folder/directory.
> 
> I had built my own NAS (FreeNAS) but had such a hassle with transfer rates, even though I had a gigabit card in the NAS and a WNDR3700 gigabit router. I also had issues with the SATA controller (tried 3 different types) and spent about 9 months working and tweaking it but it just became too frustrating. When I bought my new laptop with USB 3.0 I figured I would just start using that and bought a 4 bay ProBox USB 3.0 enclosure. I have three 2TB drives in their now but still have the issue of movies on diffferent drives.
> 
> If you have any other suggestions on building a NAS I am wide open.


First on the junction links. Create a directory called MOVIES. Then create subdirectoies MOVIES\D1
MOVIES\D2 etc. in each sub, place a link to the root of one of the drives. Then map pytivo video share to MOVIES. Pytivo and vidmgr will see all the files for all subdirectories. Vidmgr can present them as a single list sorted by the way of your choosing.

On the NAS, I went to an expert and paid a small premium for thier expertise. Bought a Synology 1511 expandable NAS. Has terriffic network speed, a robust hybrid raid that allows mixing of drive sizes and online upgrades, rebuilds and expansions. Cost was not that much more than all the hardware to build one myself of similar caliber and the end result is well supported, works very well and is VERY power efficient as in actual drive power plus 26 watts and the drives spin down when not being used. Well thought out hardware platform, linux based and easily upgraded with user apps.


----------



## lrhorer

jcthorne said:


> First on the junction links.


He needs a RAID solution.



jcthorne said:


> On the NAS, I went to an expert and paid a small premium for thier expertise. Bought a Synology 1511 expandable NAS. Has terriffic network speed


Actually, it's more like "fair" network speeds. More than plenty for a handful of videos, though.



jcthorne said:


> Cost was not that much more than all the hardware to build one myself of similar caliber


Actually, it's a bit pricey per spindle. The big thing, however, is it only has 5 drive slots and can only expand to 15. Of course, this may very well be enough for Squirl1899, and if so it will cost less than a larger chassis, which (if the Synology will suit him) he does not need. The power consumption is quite good. As mentioned in the other, similar thread, this may be a good fit for him. As with that thread, however, I caution the user that this system may not be sufficient for his ultimate needs. I'm not saying this is the case, but he should consider carefully what his long term needs are likely to be.


----------



## jcthorne

lrhorer said:


> Actually, it's more like "fair" network speeds. More than plenty for a handful of videos, though.


With its dual Gigabit ports and a proper router, I have no trouble with 4 high capacity connections (2 in going and 2 outgoing) on 4 computers each reaching over 80 MB/sec. Thats about as fast as the technology will allow. And I am not really sure if its the limits of the server or of the computers connected to it as each is no faster when the other is not moving data. IE the limits seem to be on the bandwidth at the users, not the NAS. The 1511with 4 drives or more consistantly tests as one of the fastest ready to run NAS solutions on the market under $10k.



> Actually, it's a bit pricey per spindle.


I looked at the hardware to build a 5 spindle, expandable, hot swappable array myself. It was pertty near $1000 with dual GB networking and high efficiency power supplies, mother board, memory, ultra quiet temp controlled fans etc. Best I can figure, the Synology box ran me about a $200 premium at 10 spindles and $300 when I upgrade to 15.

There are larger Synology solutions, up to 30 spindles per server even with dual redundant power, but I looked at the likelyhood of my needed more than 40TB before 4TB drives were mainstream. Was not likely in my case. Also its a pretty rare application where more than 40TB in a SINGLE array is good idea anyway. Likely well beyond what a NAS like the 1511 is intended to support. IE large home or small office environment.

As you suggest, the OP will need to determine his long term needs before investing in ANY solution. Be it ready built or home built. Both are correct answers depending on the need.

I recognize the fact that I paid a premium for the technology but though I got good value for the money in research, design, support and the Synology Hybrid Raid tech that is not available in DIY solutions. Made sense for ME. Does not make sense for you. No wrong answer, just different. The OP needs to figure out what HE needs.

OH, and a MERRY CHRISTMAS EVERYONE!


----------



## lrhorer

jcthorne said:


> With its dual Gigabit ports and a proper router, I have no trouble with 4 high capacity connections (2 in going and 2 outgoing) on 4 computers each reaching over 80 MB/sec.


A lot of the folks over on the mdadm mailing list would call that "extremely poor". Of course, a lot of them are admins of enterprise systems with multiple 10Gbps Ethernet connections to the units. Even my little $150 motherboard and dual core processor can handle 400 MB/sec, though. Of course the speed of a RAID array goes up more or less proportionally to the number of drives.



jcthorne said:


> Thats about as fast as the technology will allow.


No, not at all. That said, the published spec for the Synology is just under 200 MB/sec, which is pretty decent for a pair of 1G connections. To go very much faster, one would need a faster network. One could go with additional Gig-E ports or a 10G Ethernet port, or a technology other than Ethernet, such as Fiberchannel, for example. None of these solutions are available on the Synology, but OTOH, most home users are not going to consider such delivery systems. The Synology's reported performance is decent, and quite more than adequate for deployment in a home environment.



jcthorne said:


> And I am not really sure if its the limits of the server or of the computers connected to it as each is no faster when the other is not moving data. IE the limits seem to be on the bandwidth at the users, not the NAS.


Yes, with an absolute limit imposed by the network connections. The host capabilities also make a big difference, of course. Using TTG or GoBack, an S3 TiVo is limited to about 2MB/sec or so. While transcoding, most of my workstations running Windows / VideoRedo can't manage more than about 10 MB/sec average. OTOH, my backup server runs flat out at over 110 MB/sec on large files when it does its rsync at 04:00 every morning.



jcthorne said:


> The 1511with 4 drives or more consistantly tests as one of the fastest ready to run NAS solutions on the market under $10k.


That may well be true.



jcthorne said:


> I looked at the hardware to build a 5 spindle, expandable, hot swappable array myself. It was pertty near $1000 with dual GB networking and high efficiency power supplies, mother board, memory, ultra quiet temp controlled fans etc.


It's certainly possible to spend that and much more. Knock off the premium features, though, and the cost drops. One can go with a single Gig port on the motherboard and forget about the ultra-quiet fans, etc. 
My systems do a fair imitation of a B-17 taking off. The motherboard, CPU, case, and 4 port eSATA controller for my backup system all put together cost less than $375 new. Had I shopped for used, I could have shaved some off that. The case itself holds 8 drives, although only 5 of those could be hot-swappable (accessible from the front). For a time I ran this system without the eSATA controller and had all the drives sitting in the system. As soon as I could afford it, I did buy a 20 drive RAID chassis for $1300, and moved the drives to the external chassis. The chassis (along with a 12 drive chassis purchased earlier) supports both the primary and backup systems.



jcthorne said:


> Best I can figure, the Synology box ran me about a $200 premium at 10 spindles and $300 when I upgrade to 15.


You lost me, there. The cost per spindle should go down with increasing numbers of spindles.



jcthorne said:


> There are larger Synology solutions, up to 30 spindles per server even with dual redundant power, but I looked at the likelyhood of my needed more than 40TB before 4TB drives were mainstream. Was not likely in my case.


Again, the user needs to make that assessment. The answer determines what will best suit the application.



jcthorne said:


> Also its a pretty rare application where more than 40TB in a SINGLE array is good idea anyway.


Oh, not even. Beyond 6 drives (8 at the most), something more than RAID5 is definitely indicated. RAID6 is very good up to perhaps 16 drives, or 24 with triple parity. At 24 drives or more RAID10 definitely starts looking more appropriate, although it can be appropriate with much smaller drive numbers. RAID60 gets to be a reasonable option, or RAID1 + 5 in those areas, as well. At some point, an iSCSI solution under RAID10 or 2 x RAID1 should be a consideration. For ordinary availability, one parity drive for every 5 - 7 data drives is generally sufficient. For high availability, 1 mirror for each data drive is usually sufficient. For virtual invulnerability, 2 or more geographically diverse mirrors for each data drive are required.



jcthorne said:


> As you suggest, the OP will need to determine his long term needs before investing in ANY solution. Be it ready built or home built. Both are correct answers depending on the need.


Exactly. The time required to configure should not be a consideration of any great significance. First of all, it's going to take more or less the same amount of time no matter what the solution, and the configuration time is not relevant over the long term. Maintenance and expandability options are the biggest concern.



jcthorne said:


> Made sense for ME. Does not make sense for you. No wrong answer, just different.


Even that may be an overstatement. Any decent solution makes sense. It's more a question of what is best for one's needs in the long run. No reasonable solution will be a mistake, per se. It's a matter of which one fits his budget yet won't leave him high and dry two years down the line. I started out with a server whose maximum capability was four 160G drives in a RAID0 + 1 configuration. I thought going with the less expensive solution would save me some money. It did not.



jcthorne said:


> The OP needs to figure out what HE needs.


Why does that sound familiar? 



jcthorne said:


> OH, and a MERRY CHRISTMAS EVERYONE!


Merry Christmas, all.


----------



## cweb

jbernardis said:


> Also, if you prebuild the cache, and then delete a video through the tivo interface or rebuild the cache via the remote control, it will save the cache on exit.


I have a question about the delete behavior. When you say the cache is saved on exit, is that when I exit vidmgr by doing a ctrl-c from the terminal or when I exit vidmgr from the tivo (e.g. to watch the show that I am now transferring)?

I am running 2.0i on my mac and am pre building the cache prior to starting hmepye & vidmgr on my computer. At that point when I enter vidmgr I can delete a show as expected. However, if I send a show to my tivo, leave vidmgr on my tivo to watch the show, then re-enter vidmgr to delete the show...the delete no longer works (get the boing) unless I rebuild the cache again (three thumbs down). Since nothing has changed on my computer (I only sent a show) shouldn't the cache still be valid and I should be able to delete the show?

Also, as previous mentioned, rebuilding the cache via three thumbs down get delete working again. However, rebuilding the cache via BuildCache.py while hem-pye and vidmgr are still running does not re-enable one to delete a file from the tivo. Is this expected behavior?

Thanks in advance.


----------



## jbernardis

The cache is only read in when the app first loads - that is when you choose it from the menu with the remote control. So, yes, the scenario you describe in the last paragraph is normal.

The other situation, though, sounds like it could be a bug, although it hasn't been reported before. If I understand you, you push a video, and then exit the app to watch it without first deleting it. When you go back into the app to delete it, you get the error sound? That's what I read from your description, but I just tried this exact scenario and it worked fine for me. But maybe i'm misunderstanding what you are doing.


----------



## cweb

jbernardis said:


> The cache is only read in when the app first loads - that is when you choose it from the menu with the remote control. So, yes, the scenario you describe in the last paragraph is normal.


I just triple-checked my observations and everything is as I described.

Vidmgr does NOT appear to be reading the cache when you choose it from the menu via remote control. If I enter the app (via remote) get the "clear boing", exit the app (via tivo remote, still running on computer), then run BuildCache.py (cache should now be up-to-date, right?) and re-enter the app (via tivo remote) I will continue to get the "clear boing". The only way to actually get the delete to work is to a) do a three thumbs down update or b) totally exit Vidmgr and Hme-Pye (via ctrl-c on my computer) run BuildCache.py and the restart Vidmgr and Hme-Pye.



jbernardis said:


> The other situation, though, sounds like it could be a bug, although it hasn't been reported before. If I understand you, you push a video, and then exit the app to watch it without first deleting it. When you go back into the app to delete it, you get the error sound? That's what I read from your description, but I just tried this exact scenario and it worked fine for me. But maybe i'm misunderstanding what you are doing.


Your understanding of my ramblings is correct and more concise.

My guess this has to do with the above situation. Perhaps the cache somehow become invalid (or Vidmgr thinks it is) when one exits the app (via tivo remote).


----------



## jbernardis

Can you capture the output from pyhme from when you enter vidmgr? It should tell you if it has any difficulty loading the cache. The easiest way might be to run pyhme in the foreground while you are trying this out.

BTW - loading the cache when the app activates is unconditional. Nothing is retained from one execution to the next. If it didn't load the cache, it would have nothing to present. The other thing is that if it has trouble loading the cache, it rebuilds it which should actually result in correct behavior. So there is something else here that I don't understand yet.

BTW - according to the logic, the only things that should cause a boing sound when you press clear is if 1) this is a DVD Video, 2) you have multiple references to the same physical file, or 3) you have deleteallowed turned off in your options. If it passed all of these tests, it deletes the file(s) and it doesn't even care if the delete is successful or not.


----------



## cweb

jbernardis said:


> Can you capture the output from pyhme from when you enter vidmgr? It should tell you if it has any difficulty loading the cache. The easiest way might be to run pyhme in the foreground while you are trying this out.


I have attached a log file. I hope this is the info you were seeking.

This is what the log should have captured:
1) Started hme-pye & Vidmgr on computer.
2) Entered Vidmgr on Tivo (via remote).
3) Tried to delete show via clear and got boing
4) Rebuilt cache via three thumbs down.
5) Tried to delete show, this time got delete confirmation. 
6) Cancelled delete as I wanted to download show.
7) Sent show via Vidmgr.
8) Exited Vidmgr app on tivo (via remote) and waited for show download to complete.
9) Re-entered Vidmgr (via remote)
10) tried to delete show (via remote), got boing error.
11) Rebuilt cache via three thumbs down.
12) Tried to delete show, this time got delete confirmation. 
13) Confirmed with thumbs up, show deleted.
14) Exited Vidmgr app on tivo (via remote).

Hope I was concise without to much extra info.


----------



## jbernardis

The log file showed nothing out of the ordinary. The delete failed messages at the end mean nothing - you can ignore them. I have no explanation for the behavior you are seeing. The software works just fine for me, and I have had no similar reports from anyone else.

That's not to say there isn't a bug - there might still be. We just haven't isolated the exact conditions that bring it to surface.


----------



## cweb

Anything else I can run that might give you more insight?


----------



## jbernardis

What is your setting for delete allowed? This is an option in vidmgr.ini but it can also be set locally in each directory.

The ONLY thing I can think of right now is that this is set to false, but dynamically building the cache (thumbs up three times) has a bug and the flag gets reset to true. I'm not saying this is the case; right now it's just a guess.


----------



## jbernardis

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.


----------



## jbernardis

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.


----------



## cweb

Thumbs up! v2.1 seems to have fixed the issue.


----------



## Ubipa

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.


----------



## jbernardis

Ubipa said:


> 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:


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.


----------



## jeepguy_1980

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


----------



## jbernardis

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.


----------



## jeepguy_1980

jbernardis said:


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


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


----------



## jbernardis

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.


----------



## jbernardis

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.


----------



## Ubipa

jbernardis said:


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


That did the trick. I was doing the latter. Thanks for the help.


----------



## jeepguy_1980

jbernardis said:


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


Thanks, that is exactly what I was looking for.


----------



## lew

jbernardis said:


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


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.


----------



## johnh123

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?


----------



## jbernardis

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.


----------



## johnh123

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


----------



## windracer

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.


----------



## johnh123

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?


----------



## jbernardis

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.


----------



## johnh123

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'


----------



## jbernardis

Values=all is not a valid statement in the configuration file. Please read vidmgr.ini.dist file for instructions on how to configure.


----------



## johnh123

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.


----------



## jbernardis

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.


----------



## jbernardis

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?


----------



## johnh123

# 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=


----------



## jbernardis

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.


----------



## johnh123

Yes, thank you, that did the trick.


----------



## larrs

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?


----------



## jbernardis

I'll look into it tonight - thanks for finding the bug.


----------



## jbernardis

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.


----------



## larrs

jbernardis said:


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


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.


----------



## lrhorer

That looks a lot like the issue john123 was having. Please post your config file.


----------



## larrs

lrhorer said:


> That looks a lot like the issue john123 was having. Please post your config file.


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!


----------



## jbernardis

For those interested, I just did a quick check of vidmgr with the new HME for Python 0.20 and encountered no problems.


----------



## lrhorer

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.


----------



## wmcbrine

fgrep -L -i genre *.txt


----------



## lrhorer

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.


----------



## wmcbrine

find `grep ^path pyTivo.conf | cut -f 3 -d " "` -name \*.txt -print0 | xargs -0 fgrep -L -i genre


----------



## jbernardis

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.


----------



## lrhorer

Aw, shucks. Here William and I were just warming up to a "who can create the longest bash command" competition.


----------



## lrhorer

Oh, ho! 'Most illuminating. There are a number of metafiles that have, for example, a vProgramGenre tag, but it is blank! These passed the grep test, but your code caught the error.

Thanks, Jeff.


----------



## lrhorer

Hey, Jeff, I have another request. For various reasons, I could make use of a parameter in the metafile of each video that details when vidmgr last pushed the video in question to a TiVo. If you decide to implement it, the feature should probably be optional, since many people may not want vidmgr to monkey with their metafiles, but when enabled, it could simply update the metafield with a timestamp that could later be readily sorted in a virtual share in vidmgr.


----------



## jbernardis

lrhorer said:


> Hey, Jeff, I have another request. For various reasons, I could make use of a parameter in the metafile of each video that details when vidmgr last pushed the video in question to a TiVo...


Let me think about this. Up until this point I never write out any metafiles. I'm away from home right now with no access to a PC. I'm not even sure if the metadata code I "borrowed" from Bill McBrine has logic to write out a file. If it does, it might not be too bad. The thing I need to guard against is that I already add items to the metadata in memory, and I'm not sure I want to write them out to disk. I'd need a method to prevent this. I'll let you know in a few days after I get back.


----------



## lrhorer

Surely. As always, I'm available for alpha testing, if you decide to move ahead with the idea.


----------



## jbernardis

Leslie - I have it working, but I wanted to confer with you on some of the details.

1) There are multiple possibilities for the location of the meta file, including default.txt, and possibly a .meta subdirectory. Here is what I decided on. I NEVER overwrite a default.txt file. If a file named <path>/.meta/.txt exists then I over-write it otherwise if <path>/.txt exists, then I overwrite THAT. If neither exists, then I create a new file - if the .meta directory exists, I create it there, otherwise I create it in the same directory as the video file itself.

2) The format of the timestamp in the meta file. Initially I just had epochtime, but I decided on using the format that other timestamps are using: 2012-08-23T23:42:00Z. Right now I am using GM time (hence the Z) but I could easily use local time.

There is also a new config option - savepushdate - that defaults to false. It needs to be set to true for this logic to be activated.

Let me know what you think. I can finalize it and get it out in a few days.


----------



## lrhorer

jbernardis said:


> Leslie - I have it working, but I wanted to confer with you on some of the details.


What a guy! :up::up:



jbernardis said:


> 1) There are multiple possibilities for the location of the meta file, including default.txt, and possibly a .meta subdirectory. Here is what I decided on. I NEVER overwrite a default.txt file. If a file named <path>/.meta/.txt exists then I over-write it otherwise if <path>/.txt exists, then I overwrite THAT.


'Sounds 100% to me.



jbernardis said:


> If neither exists, then I create a new file


Well, that works great for me, but will it create an issue for anyone who has a default.txt file and no specific metafiles? Will you then copy the default.txt file to the new file and add the new field? Thinking about it briefly, it seems that would work. Personally, I'm OK with it no matter what, since all my videos have metafiles, but maybe someone else has objections I don't.



jbernardis said:


> - if the .meta directory exists, I create it there, otherwise I create it in the same directory as the video file itself.


Once again, it sounds perfect, to me.



jbernardis said:


> 2) The format of the timestamp in the meta file. Initially I just had epochtime,


That's what I figured you might do.



jbernardis said:


> but I decided on using the format that other timestamps are using: 2012-08-23T23:42:00Z.


Yeah, that works, too. As long as sorting by the field produes uniform results, which this does, it's fine. I suppose it doesn't hurt that it is human readable, either.



jbernardis said:


> Right now I am using GM time (hence the Z) but I could easily use local time.


To my mind, it doesn't really matter.



jbernardis said:


> There is also a new config option - savepushdate - that defaults to false. It needs to be set to true for this logic to be activated.


Of course. What will be the name of the tag?



jbernardis said:


> Let me know what you think. I can finalize it and get it out in a few days.


I think it's super.


----------



## jbernardis

lrhorer said:


> ..., but will it create an issue for anyone who has a default.txt file and no specific metafiles? Will you then copy the default.txt file to the new file and add the new field?


This is exactly what I do - the contents of the default.txt file will be written to the new file along, of course, with the new pushDate tag. The original default.txt file will be unaffected and will remain in force for the other files in that directory.

The problem is that the meta data dictionary that I build is actually a concatenation of default.txt, .meta/default.txt, .txt and .meta/.txt, and I have no representation for which data item came from which file. This creates an issue for this request of yours. With my "solution", the "New" meta file will actually overlay the data that was previously read in from the default file. It produces what you want and I don't think it's much of a compromise


lrhorer said:


> Of course. What will be the name of the tag?


 As mentioned above, the tag name is pushDate.

I am going to email you a zip containing the new files. If you could load it up and see if it works for you before I put it up on git, I'd appreciate it.


----------



## lrhorer

jbernardis said:


> I am going to email you a zip containing the new files. If you could load it up and see if it works for you before I put it up on git, I'd appreciate it.


I'm sure it bounced. I have a new email address. You should have received a message from me on the new account.


----------



## lrhorer

jbernardis said:


> The problem is that the meta data dictionary that I build is actually a concatenation of default.txt, .meta/default.txt, .txt and .meta/.txt, and I have no representation for which data item came from which file. This creates an issue for this request of yours. With my "solution", the "New" meta file will actually overlay the data that was previously read in from the default file. It produces what you want and I don't think it's much of a compromise


Um, well, hold on. Perhaps I am mis-understanding. Vidmgr does not display the contents of a specific metafile along with the default.txt file when the video is selected, so why would the output be a concatenation? I think I understand what you mean by saying the dictionary does not know the file name whence the data came, but I don't see why the output (or input for that matter) would be a concatenation of default.txt and the other files, if they exist. Creating a new file with whatever text was available from an unspecified source (probably default.txt) is just fine, but outputting the union of default.txt and .<codec>.txt back to .<codec>.txt would cause real issues. Surely I misunderstand?


----------



## jbernardis

It IS a concatenation of sorts. If two or more files have the same tags, then the tags from the latter files will totally replace the tags from the earlier files. If, however, the first file has a unique tag, then that will survive the merge from the successive files. If I then write out a video specific meta file, then that unique tag will show up in the result because I don't record its ultimate source.


----------



## lrhorer

Jeff or William,

Is there a way for an external process on the server to determine if any HME app is in use at the present time? Over in the Linux thread on the Home Media forum I demonstrated a method to implement logrotate for pyTivo. It is fairly easy to check for an active pyTivo transfer, since such a transfer opens a file for reading or writing. Most of the pyHME apps don't seem to keep any particular file open when active, however, and it doesn't look like HME for Python spawns any easily recognizable threads when one of its apps is active. Of course, one can merely restart HME for python without worrying about whether one of its apps is active or not, but that would rather rudely dump the user out of whatever application he is running without warning.


----------



## jbernardis

I can't think of anything I'm doing in either of my apps that you could see from the outside. Perhaps from pyhme itself?


----------



## cweb

I have two shares (Tivo Share & Tivo Share2) on two different hard disks. Everthing shows up the way you'd think in pytivo and vidmgr.

I want to create a virtual share that combines the two shares. I've created a virtual share using the parameters:
[All Shows]
values=all
groupby=seriesTitle
display=file
sort=file

It almost does what I want, but not quite. I like to see empty folders displayed, the real shares show the folder and a zero count. I'd like to see the jpeg images for the folders in the list. Lastly, I would like my mpgs with no metadata.txt file to be grouped in the actual folders they reside in.

I get why I get the behavior I do. What I would like to achieve is a virtual share that displays everything the way the real shares do, but with the list of folders combined. Is that possible?

Thanks in advance.


----------



## jbernardis

That's a tough one. When I am building the virtual shares, I am working from a list of existing videos. The directory they're in just goes along for the ride - it doesn't drive the process. Even if I organized them by their directory (which I probably could relatively easily) there'd be nothing to point me to empty directories.

I'm not saying no - I just need to think about how it could be done. I'll let you know.


----------



## cweb

Thanks for thinking about. I was hoping there was something already implemented that I was missing or not understanding.


----------



## lrhorer

Why do you have shares on two different drives? The answer to that may provide the best means of handling your situation.

In the mean time, there are a number of possibilities, depending to some extent on the OS. For example, one solution might be to create a parent directory, share that directory, and then mount both hard drives in the parent directory.


----------



## cweb

I have maxed out the first raid. So I added another. The OS is OSX.

Thanks.


----------



## lrhorer

cweb said:


> I have maxed out the first raid.


How can you "max out" a RAID system? What level of RAID?



cweb said:


> So I added another. The OS is OSX.


Hmm, yeah. I don't know anything about RAID under OSX, but I did just a bit of reading, and it sounds like OSX is a rather poor choice for a RAID based server. I did see mention of an OSX version of ZFS, though. That might be a long term solution for you. In the mean time, mounting both drives under a single share, as I mentioned before, might work for you.


----------



## cweb

lrhorer said:


> How can you "max out" a RAID system? What level of RAID?


I misspoke. I actually have two Drobos (kind of raid-ish).



lrhorer said:


> Hmm, yeah. I don't know anything about RAID under OSX, but I did just a bit of reading, and it sounds like OSX is a rather poor choice for a RAID based server. I did see mention of an OSX version of ZFS, though. That might be a long term solution for you. In the mean time, mounting both drives under a single share, as I mentioned before, might work for you.


I'm not sure the single share will work for me. I'll investigate.

I don't need all of the items on my Vidmgr share list (e.g., empty folders showing up). If any were possible, it would be just that much better.


----------



## cweb

When pushing a show to my Tivo using vidmgr, that I previously downloaded via kmttg, it appears on the Tivo as if it was copyrighted (can only be streamed, not transfer again).

Is this due to vidmgr (or pytivo, kmttg, something else)? Thanks.


----------



## wmcbrine

cweb said:


> When pushing a show to my Tivo using vidmgr, that I previously downloaded via kmttg, it appears on the Tivo as if it was copyrighted (can only be streamed, not transfer again).
> 
> Is this due to vidmgr (or pytivo, kmttg, something else)? Thanks.


It's due to the push process. TiVo Inc. flags everything transferred this way. It doesn't happen if you pull.


----------



## lrhorer

Hey Jeff,

How difficult would it be to allow the user to specify cover art for virtual shares? It would be rather nice if the following had cover art:


----------



## jbernardis

Let me look at it. It should be doable.


----------



## jbernardis

cweb said:


> Thanks for thinking about. I was hoping there was something already implemented that I was missing or not understanding.


Cweb - sorry it took so long to get back with an answer to this, but I don't think this will be too easy to do - I think I'm going to have to decline.

The problem is that for physical shares, the root directory is an integral part of the data structure, and for virtual shares, they know nothing about the physical structure of the disk - they're passed one video at a time for consideration for inclusion or exclusion. I just don't see how your request could be incorporated without some major design changes.


----------



## jbernardis

lrhorer said:


> Hey Jeff,
> 
> How difficult would it be to allow the user to specify cover art for virtual shares? It would be rather nice if the following had cover art:


Leslie,

Adding the logic to display the images is not a great task. However, the difficulty arises when trying to decide WHERE the images need to be located. I don't think it's practical for you to specify a full path name in the ini file - that would be OK for the share itself but a potential nightmare if you needed to add an entry for all the different genre or actors. So I am thinking of the following:

Let's create a directory beneath the vidmgr directory -call it "artwork" or something like that. In there there'd be a jpg file whose basename is the exact name of the share (for example "Browse by Genre.jpg"). If there is no filename, no artwork is displayed. Potentially in there is also a directory named "Browse by Genre", and inside THAT directory would (potentially) be a file named "Action.jpg" or "Comedy.jpg". And a similar thing for the other virtual share types. A structure like this would be at most 3 layers deep with the current virtual share model I have.

The ONLY concern I have with this is that I can't always guarantee that the value of the meta data will form a legal file name. I guess I could add some logic to strip offending characters, but I'm not sure there's an easy OS independent way of doing that. Also, it would have to be a very well defined algorithm so that users would be able to predict what they need to name their files.

I'm still working on it.


----------



## lrhorer

jbernardis said:


> Leslie,
> 
> Adding the logic to display the images is not a great task. However, the difficulty arises when trying to decide WHERE the images need to be located. I don't think it's practical for you to specify a full path name in the ini file - that would be OK for the share itself but a potential nightmare if you needed to add an entry for all the different genre or actors.


Yeah, that's clear.



jbernardis said:


> So I am thinking of the following:
> 
> Let's create a directory beneath the vidmgr directory -call it "artwork" or something like that. In there there'd be a jpg file whose basename is the exact name of the share (for example "Browse by Genre.jpg"). If there is no filename, no artwork is displayed.


'Works for me.



jbernardis said:


> Potentially in there is also a directory named "Browse by Genre", and inside THAT directory would (potentially) be a file named "Action.jpg" or "Comedy.jpg". And a similar thing for the other virtual share types. A structure like this would be at most 3 layers deep with the current virtual share model I have.


You lost me, there. I'm certainly not complaining, but why would there be, in effect, "sub-types"?



jbernardis said:


> The ONLY concern I have with this is that I can't always guarantee that the value of the meta data will form a legal file name. I guess I could add some logic to strip offending characters, but I'm not sure there's an easy OS independent way of doing that.


It seems to me the user should be responsible for not creating illegal file names.



jbernardis said:


> Also, it would have to be a very well defined algorithm so that users would be able to predict what they need to name their files.


I'm inclined to say you should just put the requirement in the docs and let the users worry about it. It's entirely up to you, of course.



jbernardis said:


> I'm still working on it.


Many, many thanks!


----------



## jbernardis

lrhorer said:


> You lost me, there. I'm certainly not complaining, but why would there be, in effect, "sub-types"?


Ok - here's the idea. Suppose you had a "Browse by Genre" virtual share and you had genre of "Comedy" and "Action". In the main directory you'd have "Browse by Genre.jpg" which would be the artwork for that virtual share. You'd also have a "Browse by Genre" directory, and it would/could contain "Comedy.jpg" and "Action.jpg" and these would be the artwork for those genre. Because some of the virtual shares ALSO allow for a grouping metadata item, this essentially creates another layer of directories. I wasn't complaining about this - I was pointing out that because of this small limit, the job wouldn't be too daunting.



lrhorer said:


> It seems to me the user should be responsible for not creating illegal file names.


But the issue is that the filenames are NOT created by the user - at least not directly - they are created from the metadata values. For genre, I don't see an issue, but, for example, Actor names could have special characters - umlaut's tildes, etc - that might result in illegal (or at least difficult to deal with) file names.

Maybe you're right - I could just put it on the user. If they have garbage metadata, they might end up with a screwy filename.

I'll proceed on that assumption. I don't think I'm too far away from having something. I've just been distracted lately trying to dig out from the hurricane. No major damage, but we have a house on Long Beach Island - yeah THAT Long Beach Island - that needs some attention. Compared to other people, we were very very lucky, and I'm grateful for that, but it still diverts my focus.


----------



## lrhorer

jbernardis said:


> Ok - here's the idea. Suppose you had a "Browse by Genre" virtual share and you had genre of "Comedy" and "Action". In the main directory you'd have "Browse by Genre.jpg" which would be the artwork for that virtual share. You'd also have a "Browse by Genre" directory, and it would/could contain "Comedy.jpg" and "Action.jpg" and these would be the artwork for those genre. Because some of the virtual shares ALSO allow for a grouping metadata item, this essentially creates another layer of directories.


Ah, I see. 'Very thorough of you.



jbernardis said:


> I wasn't complaining about this - I was pointing out that because of this small limit, the job wouldn't be too daunting.


Oh, I absolutely knew you weren't. I just wanted everyone to know I wasn't, either.



jbernardis said:


> But the issue is that the filenames are NOT created by the user - at least not directly - they are created from the metadata values.


Oh, I see what you mean, and sometimes those values are created by automated processes, such as Metagenerator or the feed from Tribune Media.



jbernardis said:


> For genre, I don't see an issue, but, for example, Actor names could have special characters - umlaut's tildes, etc - that might result in illegal (or at least difficult to deal with) file names.


Yeah, I see. perhaps it would be good to have Buildcache complain if it comes across something your code does not handle well, and so skips. Like many people, I am sure, I don't run Buildcache manually on a regular basis, but I certainly would run it if artwork on one of my shares was not showing up, or indeed right after adding any artwork.



jbernardis said:


> Maybe you're right - I could just put it on the user. If they have garbage metadata, they might end up with a screwy filename.


Such is life. Yours is not devoted to making sure we don't ever make a mistake.



jbernardis said:


> I'll proceed on that assumption. I don't think I'm too far away from having something. I've just been distracted lately trying to dig out from the hurricane. No major damage, but we have a house on Long Beach Island - yeah THAT Long Beach Island - that needs some attention. Compared to other people, we were very very lucky, and I'm grateful for that, but it still diverts my focus.


Dude, take care of your needs. You're doing this for fun. Anyone who doesn't like it can take a long walk on what's left of a short pier near that house.


----------



## jbernardis

Thanks for the support, but believe me that when dealing with these kinds of issues, having a nice distraction like working on this software is therapeutic. It takes my mind off of things.


----------



## lrhorer

Oh, well, there's that, I'm sure. If it keeps your bubble at the top of the glass in the level AND gets us great software, then I'm all for it!


----------



## jcthorne

Now that pytivo supports pulling TS files to Series 4 units remuxed from mp4 on the fly containing h.264 video...

Any way vidmgr could now initiate a pull of the video rather than request a push via the mind server? If possible the transfer would begin almost instantly. mind server working or not....


----------



## jbernardis

Somebody else can chime in here, but I don't believe there is a way to initiate a pull from HME.


----------



## lpwcomp

I don't use it, but I do not understand the reason for wanting vidmgr to initiate a pull. Do you really prefer the vidmgr interface that much?


----------



## lrhorer

Absolutely! The NPL really sucks, especially on the Premiere, but badly so even on the S3. Vidmgr has some annoying limitations (imposed by the TiVo, not Jeff's coding), but it far exceeds the abilities of the NPL. It's not just the interface, either. It's the vast number of features in vidmgr. Grouping by genre, series, actor, director, producer, push date, record date, etc., is just not practical at all with the NPL. It can be done, of course, using symlinks, but it tends to be a highly manual process, and it's definitely not scalable. It's trivial with vidmgr. The amount of information presented to the viewer using vidmgr is several times that of the NPL user, and much of what is needed requires no extra button presses at all with vidmgr, or perhaps only 1, versus several button presses in the NPL.

I mean, come on. This:










vs. this:










and this:










vs. this:




























Oh, please. What's just as important as the efficiency and the greater amount of information kept at the user's fingertips is the fact vidmgr is highly and easily configurable, while configuring the NPL presents a considerable challenge, one that is quite time consuming.

That, and I just skimmed through the "RAID Server" share in the NPL at top speed without reading any of the titles or drilling into any of the subdirectories. It took 2 minutes, 21 seconds. It took 32 seconds using vidmgr.

Suppose I wanted to transfer the video The Jewel of the Nile. Finding that video and initiating the transfer in vidmgr took just under 2 seconds. Doing the same in the NPL took 56 seconds, and I have a fairly highly optimized share.

One or two minutes may not sound like much, but repeat the process hundreds of times, and it adds up to many hours of time wasted using the NPL.


----------



## lrhorer

jbernardis said:


> Somebody else can chime in here, but I don't believe there is a way to initiate a pull from HME.


It surely would be nice if there were. (Actually, I think there is for the Premiere using RPC, but I can't say for the S2 or S3 platforms.)


----------



## lpwcomp

lrhorer said:


> It surely would be nice if there were. (Actually, I think there is for the Premiere using RPC, but I can't say for the S2 or S3 platforms.)


Yes, it would be possible. Practical? No. There just isn't enough information available to the PC to properly navigate the TiVo.

As far as the vidmgr interface being preferable, I wasn't asking _*you*_. We all know what you think.


----------



## cweb

The vidmgr interface is great. Much prefer it to anything else. 


Have a new issue. It may involve cache corruption. I recently added a new drive and created a new vidmgr volume. The new drive and volume presently has just on directory which contains 126 supernatural episodes. When I list the shows in the new volume, 7 of the 126 show up as bones episodes. I've checked the metadata on the affected files and there is no Bones info contained. 

There are bones episodes on the first volume and drive, but none one the second. The bones on drive 1 show up correctly. Also of note is that bones and supernatural are my only 100+ collections. I'm wondering if there is some type of error in the caching process. I have deleted and rebuilt the cache file with the same results. I don't believe there was an issue with the supernatural files before they were moved to the new drive / volume. 

Any thoughts would be appreciated.


----------



## wmcbrine

jcthorne said:


> Any way vidmgr could now initiate a pull of the video rather than request a push via the mind server?


Again, no.


----------



## jbernardis

cweb said:


> The vidmgr interface is great. Much prefer it to anything else.
> 
> Have a new issue. It may involve cache corruption. I recently added a new drive and created a new vidmgr volume. The new drive and volume presently has just on directory which contains 126 supernatural episodes. When I list the shows in the new volume, 7 of the 126 show up as bones episodes. I've checked the metadata on the affected files and there is no Bones info contained.
> 
> There are bones episodes on the first volume and drive, but none one the second. The bones on drive 1 show up correctly. Also of note is that bones and supernatural are my only 100+ collections. I'm wondering if there is some type of error in the caching process. I have deleted and rebuilt the cache file with the same results. I don't believe there was an issue with the supernatural files before they were moved to the new drive / volume.
> 
> Any thoughts would be appreciated.


I'm wondering if its an issue with file ids. What is your setting for usefileid in your INI file, and what is your host operating system? There should be no issues at all with Linux, but I was never happy with the file identification algorithm I found for windows. In either case, if you are not creating multiple links to your video files, you can defeat this logic by turning this option off. It might be interesting to see if there is a difference.

Incidentally, there are no designed limits to the video cache. The artwork cache is limited to 100 images managed in a "least frequently used" fashion.


----------



## lew

You could probably do something using the remote control protocol. KTTMG "autotune" sends the necessary commands so your tivo changes the channel on both tuners to a channel you don't receive.

Use the command to hit the select key to clear any pending message.
Use the command to go to your NPL. Use the command to go the bottom of your NPL. Select. You're now browsing videos located on your PC. Navigate based on where the show is located. Just hit the down command however many times it takes to go the show you want to pull.

I suspect the lag time, and reliability, will be worse then using the mind server and "pushing" the file.

edited to add:

lrhorer--I don't know the answer...would it make more sense to just use a DNLA server on your PC and a blu ray player connected to your TV set?


----------



## wmcbrine

Fortunately, an HME app terminates if you navigate out of it, so I don't even have to go into all the other problems with that idea.


----------



## lew

wmcbrine said:


> Fortunately, an HME app terminates if you navigate out of it, so I don't even have to go into all the other problems with that idea.


To be clear I wasn't asking for that feature. I don't think I'd use it if it was offered. I have a TivoHD and use PyTivo Manager because I want to initiate a push from the tivo interface.

Does it matter if the HME app terminates? You select a show to pull. A custom routine in an external program, maybe part of a modified pyTivo runs the necessary remote commands to initiate a "pull".

I don't want the feature. I wouldn't use it if it was offered. I don't even think it would work reliably. I think the "issues" would be far greater then current issues with the mind server.

I just wonder if such an approach is theoretically possible. May lrhorer could experiment with the coding, test it and get back to us.


----------



## lrhorer

lew said:


> lrhorer--I don't know the answer...would it make more sense to just use a DNLA server on your PC and a blu ray player connected to your TV set?


A DNLA server would be no big deal to implement, of course. I really don't want to buy 4 new BRD players, though, and I especially do not really want to have to deal with additional remote controls, additional TV inputs, and additional UIs. This is especialy true since the whole idea of getting vidmgr to do a pull is to allow us to have one one UI for both pushing and pulling.

It's really not that bad dealing with the occasional frailty of the mind server, but it would be nice to pull using vidmgr when needed.


----------



## lrhorer

lew said:


> I just wonder if such an approach is theoretically possible. May lrhorer could experiment with the coding, test it and get back to us.


I'm not at all familiar with the HME protocol, and since Wiliam says it's at the very least not practical, I don't see a point in trying to familiarize myself with the protocol in order to attempt it.


----------



## cweb

jbernardis said:


> I'm wondering if its an issue with file ids. What is your setting for usefileid in your INI file, and what is your host operating system? There should be no issues at all with Linux, but I was never happy with the file identification algorithm I found for windows. In either case, if you are not creating multiple links to your video files, you can defeat this logic by turning this option off. It might be interesting to see if there is a difference.


I am using OSX (Mac). When referring to the "usefileid" in my .ini file, are you referring to my vidmgr.ini file. In the file the is no "usefileid".

In vidmgr.dist I see your mention of "usefileid". I am not aware of my using any links. Should I set this variable to false?


----------



## jbernardis

Not necessary. False is the default. I can't think of what it could be. Keep an eye on it to see if you can discern any clue that would be helpful. In the meantime, I can look at what I can do at cache building time to output some useful debugging information.


----------



## cweb

jbernardis said:


> Not necessary. False is the default. I can't think of what it could be. Keep an eye on it to see if you can discern any clue that would be helpful. In the meantime, I can look at what I can do at cache building time to output some useful debugging information.


The vidmgr.dist says the default is true. Is that not so?


----------



## jbernardis

cweb said:


> The vidmgr.dist says the default is true. Is that not so?


You're right - it is true. You can give it a shot. If you don't have your video files appear in multiple directories through links, then turning this off will not hurt you.

I know nothing about mac OS, but my understanding is that it is unix-like under the covers. If the OS is NOT WIN, then vidmgr uses the os.stat call to determine the true file identity (inode number) so that it can decide if two files are actually the same file. I'm not sure the behavior of this under Mac OS.

See what happens if you turn it off.


----------



## wmcbrine

OS X is built on Unix, but there are some oddities. For instance, it uses a case-preserving filesystem rather than a case-sensitive one. Mostly, apps won't need to worry about these things. AFAIK it's fully POSIX.


----------



## cweb

jbernardis said:


> You're right - it is true. You can give it a shot. If you don't have your video files appear in multiple directories through links, then turning this off will not hurt you.
> 
> I know nothing about mac OS, but my understanding is that it is unix-like under the covers. If the OS is NOT WIN, then vidmgr uses the os.stat call to determine the true file identity (inode number) so that it can decide if two files are actually the same file. I'm not sure the behavior of this under Mac OS.
> 
> See what happens if you turn it off.


I turned it off, and it seems to have solved the problem. I'll have to work with it a while to see if some other issue rears its head as a result of the value being turned off. However, for now, so far so good.

As a side result, it was never bad, but the menus seem to be responding even faster now. Is this possible or just wishful thinking on my part.


----------



## jbernardis

It shouldn't be any faster. All of the processing we are talking about here takes place when building the cache.

There also should be no I'll effects from turning the option off. Vidmgr gets the file ID number to determine if it's proceed the file already. When you turn this option off, all this routine does is return the next sequential number. The implication of this is that every file you look at is considered unique - which is the situation if you do not use any links.

The real question is what is happening in Mac OS to make this not work, and what needs to be done to fix it.

Watch it for a few weeks, and if it looks to be solved, I'll at least put a caveat in the readme file that the option should be set to false for Macs. I'll also try to research how os.stat works under Mac OS.


----------



## cweb

Fabulous. I'll report back if I find any issues.


----------



## curt1s

Hello all,

I am trying to set up and run pytivo video manager for Windows, but I am running into a problem, and maybe someone can help me. I installed hmeforpython and read the README and set it up like it suggested. I then read the README for your application, and did the same. I run the server as so:

C:\Users\ch1\Downloads\hmeforpython-master>start.py
HME Server for Python 0.20
Sat Dec 29 17:56:23 2012 PyTivo Video Manager version 2.1b module initializing
Cache file does not exist - no thumbnails loaded
Sat Dec 29 17:56:23 2012 Server Starts
Registering: clock
Registering: tictactoe
Registering: vidmgr


When I go to my tivo, I see the apps there, but when I click on any of them I just get a "Please wait..." message, which is on the screen for a really long time then I get this error:

"An error occured while running the application. HTTP failure (Http connection error: 0x50005)"

Any idea what I might be doing wrong?

NOTE: I updated the vidmgr install, but still no luck running any of the hme apps.

I am running a Tivo Series3.


Thanks,


----------



## jbernardis

First of all, unless you are working with SD tv's and/or tivos, I recommend that you move to vidmgr 2.0. I haven't done any maintence on the original program (which is what version 0.7c is) for over a year and a half. 2.0 has many more features and is more likely where I'd make enhancements. Of course - it is HD only.

Now to your problem. Does this happen with ALL of the apps? or just with vidmgr? Is there ANY other information printed on computer screen. You give the first bit of the output there where the apps register, but does anything appear after that? I need more information.

What is your environment? Are you running this on a windows system or linux (or Mac OS)? How exactly are you running it? Are you starting it in the foreground of a terminal session? or are you running it in the background?

Do you have pytivo configured and running? Vidmgr relies on pytivo for the actual heavy lifting.


----------



## curt1s

Yeah I upgraded to 2.0, like you suggested.

I think I have it all fixed now. I had to change the beacon method in hmeforpython.


----------



## curt1s

Nevermind, got all my errors figured out! Thanks!


----------



## curt1s

By the way, do we have to manually create metadata for mpgs and avi files? If so, what tool do you recommend? I tried used MetaGeneratorV2.0.6.1 but no matter what movie I typed in, it did not work.


----------



## lrhorer

curt1s said:


> By the way, do we have to manually create metadata for mpgs and avi files?


That depends on from where they come. If the .mpg files came from a TiVo originally, then using kmttg will allow the user to have the metafiles created automatically. Other sources may offer other options, or not, as the case may be.



curt1s said:


> If so, what tool do you recommend? I tried used MetaGeneratorV2.0.6.1 but no matter what movie I typed in, it did not work.


As I mentioned, for transfers from the TiVo, use kmtttg. If you wish to use Metagenerator, you need to upgrade to the newest version. The web sites have changed their formats ove time, and in order to use them, you need Metagenerator version 3.


----------



## cweb

On my Mac, when I delete a show using Vid Manager using the clear-thumbs up combo, it works mostly as expected. The file is removed from the list and from my hard drive. However, when I look at my Terminal log, it states that the delete has failed. 

This is mostly an FYI, since the program is doing what it is suppose to. It just the error reporting that is incorrect.


----------



## jbernardis

When you delete a video, vidmgr attempts to delete not only the video file itself, but also the metadata file and the artwork. For the latter two, it looks both in the main directory and in the .meta subdirectory. One by one, it attempts to delete the file (without checking for its existance first) using python's os.delete method. If this method reports failure, you will get the message you mentioned. This is most likely the case since I doubt that you have all five of these files.

This is working as designed. I felt it sort of redundant to check for a file's presence first if I was only going to delete it. I guess I could have been more aware of the nature of the failure, but I finally decided it wasn't really necessary.


----------



## cweb

Got it. It works just fine. I just didn't know what it was failing at. 

Thanks.


----------



## jbernardis

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.


----------



## jbernardis

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.


----------



## jbernardis

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


----------



## jeepguy_1980

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?


----------



## jbernardis

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.


----------



## jeepguy_1980

jbernardis said:


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


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


----------



## jbernardis

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.


----------



## jeepguy_1980

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


----------



## lrhorer

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?


----------



## telemark

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


----------



## lpwcomp

telemark said:


> 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


Definite possible source of the problem. Maybe he should try it with no space between Title and the number, i.e. Title1, Title2, etc.


----------



## lrhorer

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.


----------



## lrhorer

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.


----------



## jbernardis

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


----------



## jbernardis

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.


----------



## lrhorer

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.


----------



## jeepguy_1980

Does VIDMGR handle .nfo files? I know pyTivo incorporated this, but it seems that VIDMGR isn't reading my .nfo files.


----------



## jbernardis

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.


----------



## jeepguy_1980

jbernardis said:


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


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


----------



## wmcbrine

I dunno what you're doing for metadata, but feel free to just import metadata.py from pyTivo.

("Hybrid XML" is a sick concept. But anyway, we've already dealt with it in metadata.py.)


----------



## jbernardis

Thanks Bill. I was already planning on doing that. I used your code previously, although I altered it for what I needed. I've already isolated the portions of metadata.py that deal with nfo files and was simply planning on merging that into my existing code.

I don't anticipate any issues, but I'm not going to be able to get to it for a few days. The soonest would be after the weekend.


----------



## jeepguy_1980

jbernardis said:


> Thanks Bill. I was already planning on doing that. I used your code previously, although I altered it for what I needed. I've already isolated the portions of metadata.py that deal with nfo files and was simply planning on merging that into my existing code.
> 
> I don't anticipate any issues, but I'm not going to be able to get to it for a few days. The soonest would be after the weekend.


Were you able to get to it this weekend?

Sent from my HTC6525LVW using Tapatalk


----------



## cweb

I had a working setup that was doing great for the longest time on my Mac running 10.9.4. I just recently noticed that it stopped working and I can't figure out why. I'm sure I must have changed something, but don't know what. The terminal output is as follows:

cd '/Applications/hme-python/' && '/usr/local/bin/pythonw' -S '/Applications/hme-python/start.py' && echo Exit status: $? && exit 1
HME Server for Python 0.20
Not using Zeroconf: No module named zeroconf
Skipping: vidmgr - No module named Image
Sun Sep 7 10:21:26 2014 Server Starts

Any help would be appreciated.


----------



## lpwcomp

cweb said:


> I had a working setup that was doing great for the longest time on my Mac running 10.9.4. I just recently noticed that it stopped working and I can't figure out why. I'm sure I must have changed something, but don't know what. The terminal output is as follows:
> 
> cd '/Applications/hme-python/' && '/usr/local/bin/pythonw' -S '/Applications/hme-python/start.py' && echo Exit status: $? && exit 1
> HME Server for Python 0.20
> Not using Zeroconf: No module named zeroconf
> Skipping: vidmgr - No module named Image
> Sun Sep 7 10:21:26 2014 Server Starts
> 
> Any help would be appreciated.


First thing to do is make sure you are running the latest versions of vidmgr and pyTivo.


----------



## wmcbrine

cweb said:


> Skipping: vidmgr - No module named Image


This says that you don't have the Python Imaging Library installed.


----------



## cweb

wmcbrine said:


> This says that you don't have the Python Imaging Library installed.


What is PIL installed as part of? Hme-python? Vidmgr? OS? something else?

It use to work. What may have broken it? This may not be relayed, but pytivo and strambaby still work.

Thanks.


----------



## Allanon

cweb said:


> What is PIL installed as part of? Hme-python? Vidmgr? OS? something else?
> 
> It use to work. What may have broken it? This may not be relayed, but pytivo and strambaby still work.
> 
> Thanks.


PIL is an image processing module for Python. Might try re-installing it.


----------



## wmcbrine

cweb said:


> What is PIL installed as part of? Hme-python? Vidmgr? OS? something else?


It's not part of anything. It's a separate package.



> _It use to work. What may have broken it?_


I'm guessing (based on that "/usr/local/bin") that it broke when you installed a new version of Python.

Nowadays you probably want to use Pillow.


----------



## cweb

I just installed Pillow and the log seems to look better and it appears that vidmgr now gets loaded. However I am still not seeing vidmgr on the Tivos. Also, I still am getting the Zeroconf error.

log:
~ cliff$ cd '/Applications/hme-python/' && 'python' '/Applications/hme-python/start.py' && echo Exit status: $? && exit 1
HME Server for Python 0.20
Not using Zeroconf: No module named zeroconf
Sat Sep 13 18:30:57 2014 PyTivo Video Manager version 2.2f module initializing
Loading thumbnail cache
100 thumbnails loaded from cache
Sat Sep 13 18:30:58 2014 Server Starts

Any additional thoughts? Thanks in advance.


----------



## wmcbrine

Well, it's not finding zeroconf.py. It should be there right next to start.py.


----------



## cweb

wmcbrine said:


> Well, it's not finding zeroconf.py. It should be there right next to start.py.


Well I am getting closer. The zeroconf.py was there, but something, somewhere must have gone bad. I reinstalled hem-python and the vidmgr files and deleted the .pyc files. I see from the output (see below) the the vidmgr server is registered and I see VidMgr in the Tivo Apps and can go into it from the tiro. However, after pressing a few keystrokes Vidmgr just hangs and I have to exit to regain control of the tiro. The terminal output shows there is an exception, but I am not sure how to interpret it.

On another note, which may or may not be related. If I run the buildcache.py or the rebuild (three thumbs down) from within the app, they appear to run and process fine with no errors. However, the thumbs.cache doesn't actually get updated. I don't know if it is write it somewhere else.

As usual, all help is appreciated.

The vidmgr output is:
cd '/Applications/hme-python/' && '/usr/local/bin/pythonw' '/Applications/hme-python/start.py' && echo Exit status: $? && exit 1
Mac-Desktop-Quad-Core:~ cliff$ cd '/Applications/hme-python/' && '/usr/local/bin/pythonw' '/Applications/hme-python/start.py' && echo Exit status: $? && exit 1
HME Server for Python 0.20
Sun Sep 14 23:02:54 2014 PyTivo Video Manager version 2.2f module initializing
Loading thumbnail cache
100 thumbnails loaded from cache
Sun Sep 14 23:02:56 2014 Server Starts
Registering: vidmgr
192.168.1.118 - - [14/Sep/2014 23:03:22] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.118 - - [14/Sep/2014 23:03:22] Starting HME: vidmgr
Vidmgr thread entering startup
Vidmgr Entering Handle Resolution
Checking resolution 1280, 720
Found an HD resolution
Vidmgr thread activating
Vidmgr Entering Handle Resolution
Checking resolution 1280, 720
Found an HD resolution
Processing video share Tivo Share
2169 Videos found
Processing video share Tivo Share2
294 Videos found
Processing video share Brothers and Sisters
30 Videos found
All Shows (grouped by Series Title) count: 2493 videos in 135 groups
Alphabetical Groups count: 2493 videos
192.168.1.118 - - [14/Sep/2014 23:04:18] Ending HME: vidmgr
192.168.1.114 - - [14/Sep/2014 23:44:06] "GET /vidmgr/ HTTP/1.1" 200 -
192.168.1.114 - - [14/Sep/2014 23:44:06] Starting HME: vidmgr
Vidmgr thread entering startup
Vidmgr Entering Handle Resolution
Checking resolution 1280, 720
Found an HD resolution
Vidmgr thread activating
Vidmgr Entering Handle Resolution
Checking resolution 1280, 720
Found an HD resolution
Processing video share Tivo Share
2169 Videos found
Processing video share Tivo Share2
294 Videos found
Processing video share Brothers and Sisters
30 Videos found
All Shows (grouped by Series Title) count: 2493 videos in 135 groups
Alphabetical Groups count: 2493 videos
----------------------------------------
Exception happened during processing of request from ('192.168.1.114', 41583)
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 595, in process_request_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Applications/hme-python/start.py", line 141, in __init__
client_address, server)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 651, in __init__
self.handle()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/Applications/hme-python/start.py", line 232, in do_GET
self._page(True)
File "/Applications/hme-python/start.py", line 186, in _page
appinst.mainloop()
File "/Applications/hme-python/hme.py", line 1139, in mainloop
while self.active and self.get_event():
File "/Applications/hme-python/hme.py", line 1192, in get_event
handle(keynum, rawcode)
File "/Applications/hme-python/vidmgr/__init__.py", line 246, in handle_key_press
self.ddm.show(self.currentItem)
File "/Applications/hme-python/vidmgr/DetailDisplayManager.py", line 66, in show
thumb = self.getDirThumb(mapkey, otype == TYPE_DVDDIR)
File "/Applications/hme-python/vidmgr/DetailDisplayManager.py", line 134, in getDirThumb
data = self.tc.getImageData(tfn)
File "/Applications/hme-python/vidmgr/ThumbCache.py", line 139, in getImageData
pdata = resizePic(filename, self.width, self.height)
File "/Applications/hme-python/vidmgr/ThumbCache.py", line 36, in resizePic
pic = pic.resize((nwidth, nheight), img.ANTIALIAS)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 1290, in resize
self.load()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageFile.py", line 164, in load
self.load_prepare()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/ImageFile.py", line 231, in load_prepare
self.im = Image.core.new(self.mode, self.size)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/Image.py", line 37, in __getattr__
raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed
----------------------------------------


----------



## wmcbrine

You're back to the Python Imaging Library not working there.


----------



## lrhorer

I'm having the same problem. Doing some searching, I think it is because it is expecting the files to be in /usr/lib, but at least some of them are in /usr/lib/86_64-linux-gnu. I tried creating the following symlinks, but it didn't help.

ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/libz.so
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so.62 /usr/lib/
ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so.6 /usr/lib/


----------



## lrhorer

With Jeff's help, I got mine running, again. The first effective fix was to put 

import sys
sys.path.append('/usr/lib/python2.7/dist-packages/PIL')

at the top of ThumbCache.py. This worked to get vidmgr up and running, but it is a bit of a kludge, because it is a spot band-aid that only gets PIL working for that one script. The thing that was leading me astray was PIL was reporting properly installed by Debian's package manager, and in a sense it was loaded correctly. Unfortunately in this situation having the app loaded is not the end of the story. We were able to pinpoint the location of PIL and point to it with the path addendum above, but Python in general remained ignorant of the location of PIL. What worked for me was issuing the command:

apt-get install python-imaging

Python-imaging is reportedly a temporary compatibility package that creates a PIL.pth file which allows one to continue to use the `import image` directive in Python scripts.

Anyone else suffering this issue is likely to need to load this package or an analogous one for your distribution.


----------



## wmcbrine

lrhorer said:


> Python-imaging is reportedly a temporary compatibility package that creates a PIL.pth file which allows one to continue to use the `import image` directive in Python scripts.


So, instead of adding this package, would it be sufficient to change "import Image" to "from PIL import Image"?


----------



## lew

Minor issue:
The
[virtual share name X]

section in the ini dis file should have # .

You don't need to use virtual share but you need to complete the section if you don't either delete [virtual share name X] or change it to
#[virtual share name X] to comment out the section.


----------



## NJ Webel

Anyone have any idea why vidmgr will load a temp file into my library of the file I'm trying to push, but the transfer never starts or completes?

I am using a Base Roamio, connected via Ethernet to a HP Mediasmart EX485 running WHSv1.

vidmgr is the version 2 installation.


----------



## spaldingclan

how the hell do you install this in Windows 7? is this a linux only app?


----------



## windracer

It's not Linux only. It's Python based so you'll need to install Python for Windows, wmcbrine's HME for Python framework, and have a working setup of pyTivo as well.

This old thread may help, but there's a lot of Linux stuff in there.


----------



## spaldingclan

ah, I've got Pytivo setup already (works well)...just wasn't sure how to setup HME


----------



## spaldingclan

doesn't look like there are any instructions on using this with Windows.


----------



## gonzotek

For HME for python, see the readme:
https://github.com/wmcbrine/hmeforpython/#readme

The startup directions are sparse, but basically, you begin by downloading the zip file of the code:
https://github.com/wmcbrine/hmeforpython/archive/master.zip

Extract that to a directory you'll want to run it from, then open a command line and navigate to that directory, then run


Code:


python start.py

 to start the HME for python server. That should run the included examples and you should be able to see them as apps on the TiVo.

Once you have that working, you can move on to installing PyTiVo Video Manager, using the zip found here:
https://github.com/jbernardis/pytivo-video-manager/archive/master.zip
and directions here:
https://github.com/jbernardis/pytivo-video-manager/#readme

Ask for help in this thread when/if you get stuck, and we'll try to help work it out. From there, we can improve the directions


----------



## lrhorer

wmcbrine said:


> So, instead of adding this package, would it be sufficient to change "import Image" to "from PIL import Image"?


That is also the recommendation of the package maintainer for Debian "Jessie". I spoke with Jeff about it, and he concurs. I edited the calls in vidmgr and in jukebox, removed the python-imaging package, and everything is working fine.


----------



## spaldingclan

never mind...those directions are horrendous. Never could get it working


----------



## jcthorne

spaldingclan said:


> never mind...those directions are horrendous. Never could get it working


Sorry you feel that way. Perhaps you should take a look at Streambaby. Does not do everything vidmgr does but it is much easier to set up.


----------



## windracer

spaldingclan said:


> never mind...those directions are horrendous. Never could get it working


Did you get HME for Python working first?


----------



## gonzotek

spaldingclan said:


> never mind...those directions are horrendous. Never could get it working


Just curious, at what point did you get tripped up?


----------



## spaldingclan

I got pytivo up last year but the hme directions are even worse. Where do I actaully put the unzipped folder? I tried running it from a command line but windows said it doesn't know what the Python command is.


----------



## spaldingclan

And I do appreciate you trying to help


----------



## lrhorer

spaldingclan said:


> I got pytivo up last year but the hme directions are even worse. Where do I actaully put the unzipped folder?


Where do you want to put it? It's your machine. You decide where it goes.



spaldingclan said:


> I tried running it from a command line but windows said it doesn't know what the Python command is.


You need to be more specific. What, exactly, is the error? What command, exactly, did you try running from the CL?


----------



## spaldingclan

I ran python start.py from the CL in the folder I unzipped


----------



## windracer

If the python executable isn't in your path, you'll need to specify that (i.e., C:\Program Files (x86)\Python\python.exe start.py).


----------



## lpwcomp

spaldingclan said:


> I ran python start.py from the CL in the folder I unzipped


It appears to me that python isn't properly installed.


----------



## gonzotek

How do you start pytivo now? pytivo also depends on python, so you seem to have python at least partially installed on your machine. Try windracer's recommendation.

I don't want to mess up your pytivo install, but if it turns out you need a new copy of python, you'd want to use a version from the 2.X branch, not the 3.0 branch (latest as of today is 2.7.8, available at https://www.python.org/downloads/release/python-278/). That would be compatible with pytivo and 'HME for python' (and, by extension, pyTivo Video Manager).

Please keep in mind all of these piece of software were developed by community members for their own enjoyment, and shared with the community without any expectation of compensation. If the directions are incomplete or in error, it's because no one has had a chance to improve them yet.


----------



## spaldingclan

I run Pytivo from it's own folder called "pytivo" do I need to put HME in that folder where python is and run from there? I know theres no compensatin but why bother making a software for the community if only the nerdiest of the nerds can use it?


----------



## lpwcomp

spaldingclan said:


> I run Pytivo from it's own folder called "pytivo" do I need to put HME in that folder where python is and run from there? I know theres no compensatin but why bother making a software for the community if only the nerdiest of the nerds can use it?


*sigh*. Saying that pyTivo is in its own folder doesn't answer the question. _*How*_ do you start it?


----------



## wmcbrine

gonzotek said:


> If the directions are incomplete or in error


They aren't, actually.

HME for Python is a package for programmers, only. I'd prefer that jbernardis took start.py and hme.py and included them in his distribution, rather than having the end user install HME for Python as a dependency. Then again, I'm not sure how much it would help, in this case.

spaldingclan: *Plonk*


----------



## lrhorer

spaldingclan said:


> I run Pytivo from it's own folder called "pytivo" do I need to put HME in that folder where python is and run from there?


You seem to have an obsession for considerations of where things go.



spaldingclan said:


> I know theres no compensatin but why bother making a software for the community if only the nerdiest of the nerds can use it?


Well, I can't speak for the other members of the forum, but there goes my impulse to render assistance to you. For the record:

1. There is nothing wrong with being a nerd.

2. I am not now nor have I ever been a nerd, yet I did not find the installation of HME for Python to be particularly difficult.

3. Just because someone is not utterly stupid does not mean they are a nerd.


----------



## spaldingclan

you're taking this awful personal,

all I was saying is that if I can install pytivo, i ought to be able to install this...but the instructions are horrifically written

of course I tried to run it from the CL...


----------



## windracer

You still haven't answered questions from all of us trying to help.

HME can be installed in any folder, wherever you want. Personally I have a folder under C:\Program Files (x86) called TiVo and I put everything under there.

It sounds like the python executable isn't in your path. Did you try explictly using it on the command-line (like I suggested above) to start HME?


----------



## spaldingclan

I did, and finally put it into the python folder. I got the CL window to run finally but the directions after that are really hard tom understand. I gae up on it (which is too bad since it looked really cool)


----------



## jbernardis

For those of you that might be interested, I have posted on GITHUB - see my signature - a CGI script that provides you a browser-based interface to your vidmgr database.
A lot of information about how to configure it is provided there, but a lot of it is going to depend on how you want it to mesh into your existing web infrastructure.

I've actually been using this on my own network for some time, but lrhorer finally convinced me to publish it after he and I finally got it working in his environment. I can answer questions about the functionality of the software, but web server configuration is not my forte. So give it a try, and ask your questions. I might not have an answer, but hopefully the community will rise to the occasion.


----------



## email68

Can vidmgr link and push vob files like pity's dvdvideo plugin?


----------



## jbernardis

email68 said:


> Can vidmgr link and push vob files like pity's dvdvideo plugin?


The logic is in there to handle it. But frankly I don't use it. I'm pretty sure lrhorer uses it extensively so he has more practical experience with it.


----------



## jsbain

Just curious if anyone has gotten vidmgr to work with the playon pytivo plugin? I installed vidmgr version 2, and can see My Videos from pytivo, but not any of the Internet TV shares which come from playon.


----------



## jbernardis

vidmgr only works with files that are physically on your network. I have no idea what the playon plugin is or does, but if the video file is not found on your local system/network, then vidmgr doesn't know of its existence


----------



## jsbain

jbernardis said:


> vidmgr only works with files that are physically on your network. I have no idea what the playon plugin is or does, but if the video file is not found on your local system/network, then vidmgr doesn't know of its existence


Thanks,
The playon plugin for pytivo allows interaction with the playon server, which is basically a dlna media server that allows streaming of video from various online sources (basically by running a browser and screen capturing). The plugin lets one browse the heirarchical list of sources/videos.

how does vidmgr discover files? Does it directly interact with pytivo? Or does it just read the pytivo.conf and then os.walk through the file system on its own?

If I were to extend vidmgr to handle other pytivo plugins, I gather I need to implement something that has an interface like DVDShare or VideoShare, then add the appropriate cases in VideoCache?


----------



## lrhorer

jbernardis said:


> I've actually been using this on my own network for some time, but lrhorer finally convinced me to publish it after he and I finally got it working in his environment.


See? There are some advantages to being persistently annoying. 



jbernardis said:


> I can answer questions about the functionality of the software, but web server configuration is not my forte. So give it a try, and ask your questions. I might not have an answer, but hopefully the community will rise to the occasion.


Well, it's not my forte, either, but I am willing to lend a hand if anyone wants to use this utility and runs into a roadblock. Note I may not be much help with a Windows installation, and perhaps not much more with a Mac, but I will see what I can do. Anyone who would like to take a look at the interface can look here. I have security enabled, so you won't be able to push or delete any videos, but you can browse through the vidmgr features. Functionality is extremely similar to the TiVo based utility, sans the bulk of the artwork functionality. One can. however, see the artwork in the individual videos.

Hmm. Well, one *should* be able to see the artwork. Something's busted. I'll need to figure out what. Meanwhile, the main utility is working.


----------



## lrhorer

jbernardis said:


> The logic is in there to handle it. But frankly I don't use it. I'm pretty sure lrhorer uses it extensively so he has more practical experience with it.


It works just fine. There was a recent audio issue with the system not being able to map the correct audio, but it turned out to be a hangover from an incomplete upgrade on my part. Otherwise, I just rip the DVD to a VIDEO_TS folder with no conversions of any sort. If multiple titles are on the DVD, they are available on the TiVo, including extra features and the like, sans the menus. The menus are retained in the file structure, however, and if one employs a media player such as VLC, then the menus still appear.


----------



## lrhorer

jsbain said:


> how does vidmgr discover files? Does it directly interact with pytivo? Or does it just read the pytivo.conf and then os.walk through the file system on its own?


Vidmgr uses the buildcache.py module to create its database, walking through the directory structure established in pytivo.conf. On startup of the main routine, if the database exists, vidmgr uses it. If not, it runs buildcache.py on the fly.


----------



## lrhorer

lrhorer said:


> Hmm. Well, one *should* be able to see the artwork. Something's busted. I'll need to figure out what. Meanwhile, the main utility is working.


OK, we figured out what the issue was and how to resolve it. One work-around was to modify the web server configuration, but I was not happy with the security implications, especially for someone here who might use the web app but not understand the proper means of maintaining a secure system. Jeff came up with a better way of doing things, and he has updated the code. I'll be testing it this weekend, if I get the chance.


----------



## rlarson

I've searched for this answer but couldn't find a way, but I thought I'd ask... Is there anyway to adjust the size and location of the cover art display? I've gone through the config file and can't seem to find out.


----------



## lrhorer

rlarson said:


> I've searched for this answer but couldn't find a way, but I thought I'd ask... Is there anyway to adjust the size and location of the cover art display? I've gone through the config file and can't seem to find out.


The location, yes, at least somewhat. The metavariable thumbjustify=left|center|right will set the justification of the artwork within the artwork window. I believe re-sizing the window would require fiddling with the screen layout parameters in the scripts themselves.

On a somewhat related note, my brother and sister-in-law are now using vidmgr, but their TV is a little small, and they sit rather a long way from it. For myself, I want the maximum number of titles on the screen as possible, but for them it would be nice to increase the font a bit and show perhaps 10 titles on the screen as opposed to 14.


----------



## lew

I haven't used this in a while. Some issues. Before I go crazy troubleshooting.. Is .20 the current version of pyhme? Any issues running this with the current software on Roamio? TivoHD?


----------

