pyTivo Discussion Forum Forum Index pyTivo Discussion Forum
Answers and the development of pyTivo a TiVo transcoding server
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

programId metadata
Goto page 1, 2  Next
 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo
 View previous topic :: View next topic  
Author Message
bwall23



Joined: 03 Sep 2012
Posts: 7

PostPosted: Sat Sep 08, 2012 4:34 am    Post subject: programId metadata Reply with quote

Having a problem trying to get the programId from a .tivo file added to metadata to be displayed by pyTiVo. I'm able to get it to display programId on a TVBusQuery after modifying TvBus.tmpl and metadata.py, but the parsing being done by metadata.py is picking up the seriedId value for the programId. Not quite sure how the xml dom parsing is being done.

i.e. seriesId and programId are both displaying the seriesId value on the TVBusQuery.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2009
Location: Maryland

PostPosted: Sat Sep 08, 2012 8:07 am    Post subject: Reply with quote

Modifying how? Where is the code?
_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
lpwcomp



Joined: 09 Sep 2011
Posts: 70

PostPosted: Sat Sep 08, 2012 3:17 pm    Post subject: Reply with quote

wmcbrine wrote:
Modifying how? Where is the code?
He's tallking about the mods I made on my own to get programId sent to and gotten from a TiVo. They do work as intended. He is simply ... confused as to what they do and how to test them. I did not give him a patch file, I simply told him what the mods needed to be (over in the TCF). In retrospect, I shouldn't have done it that way. Below is a patch generated by Eclipse. As you can see, it amounts to adding 2 lines to metadata.py and 3 lines to TvBus.tmpl.

Code:
Index: metadata.py
===================================================================
--- metadata.py   (revision 1357)
+++ metadata.py   (working copy)
@@ -337,6 +337,7 @@
 
     keys = {'title': 'Title', 'episodeTitle': 'EpisodeTitle',
             'description': 'Description', 'seriesId': 'SeriesId',
+            'programId': 'ProgramId',
             'episodeNumber': 'EpisodeNumber', 'tvRating': 'TvRating',
             'displayMajorNumber': 'SourceChannel', 'callsign': 'SourceStation',
             'showingBits': 'ShowingBits', 'mpaaRating': 'MpaaRating'}
@@ -373,6 +374,7 @@
              'originalAirDate': 'program/originalAirDate',
              'isEpisode': 'program/isEpisode',
              'movieYear': 'program/movieYear',
+             'programId': 'program/uniqueId',
              'partCount': 'partCount',
              'partIndex': 'partIndex',
              'time': 'time'}
Index: plugins/video/templates/TvBus.tmpl
===================================================================
--- plugins/video/templates/TvBus.tmpl   (revision 1357)
+++ plugins/video/templates/TvBus.tmpl   (working copy)
@@ -98,6 +98,9 @@
             <element>$escape($element)</element>
             #end for
       </vWriter>
+      #if $video.programId
+      <uniqueId>$video.programId</uniqueId>
+      #end if
     </program>
     <channel>
       <displayMajorNumber>$video.displayMajorNumber</displayMajorNumber>
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2009
Location: Maryland

PostPosted: Sat Sep 08, 2012 6:43 pm    Post subject: Reply with quote

Well, I must concur with bwall23 that the patch above dumps the seriesId as the programId field, when dumping from a .TiVo file (i.e. "metadata.py filename.TiVo"). I don't know why you say he's confused. The from_details() match isn't working.

I have a tentative fix for this, but it needs more testing.

_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
lpwcomp



Joined: 09 Sep 2011
Posts: 70

PostPosted: Sat Sep 08, 2012 8:11 pm    Post subject: Reply with quote

wmcbrine wrote:
Well, I must concur with bwall23 that the patch above dumps the seriesId as the programId field, when dumping from a .TiVo file (i.e. "metadata.py filename.TiVo"). I don't know why you say he's confused. The from_details() match isn't working.

I have a tentative fix for this, but it needs more testing.
Ah, OK. In this case, I was the one who was confused. I haven't tested that specifically, just on a pull from the TiVo via the pyTivo web browser interface, which works as it should. Taking a closer look at the code, I'm not sure why it works. It should have the same issue that I initially encountered in kmttg, which is that getElementsByTagName finds the first occurrence of that tag, no matter how deep in the tree it is.

If I want to generate a metadata file from an existing .tivo file, I use kmttg, which has been modified, first by me for my own use, now by moyekj in the latest release (although he did it differently).
Back to top
View user's profile Send private message
bwall23



Joined: 03 Sep 2012
Posts: 7

PostPosted: Sun Sep 09, 2012 1:22 am    Post subject: Reply with quote

wmcbrine wrote:
Well, I must concur with bwall23 that the patch above dumps the seriesId as the programId field, when dumping from a .TiVo file (i.e. "metadata.py filename.TiVo"). I don't know why you say he's confused. The from_details() match isn't working.

I have a tentative fix for this, but it needs more testing.
In addition to the patches lpwcomp mentions, I also patched
container.tmpl
Code:
            <SeriesId>$video.seriesId</SeriesId>
+           #if $video.programId
+           <ProgramId>$video.programId</ProgramId>
+           #end if
            <CaptureDate>$video.captureDate</CaptureDate>

and container_xml.tmpl
Code:
            <SeriesId>$video.seriesId</SeriesId>
+           #if $video.programId
+           <ProgramId>$video.programId</ProgramId>
+           #end if
            #if $video.episodeNumber
            <EpisodeNumber>$video.episodeNumber</EpisodeNumber>

It works if I already have the programId tag and value in the metadata text file for a .tivo file and remove the tdcat bin location from pyTivo.conf

I verify by examining the container detail and video file detail output of pyTivo as would be seen by a TiVo.

Also pulled 2 old recording from pyTivo using my TiVo and they show in the NPL sorted with their original recorded date and display Season and Episode numbers in the HD My Shows. Details displays recorded date/time channel# and callsign. OAD displays correctly. Pressing info displays OAD and Episode#, but not Season#. SD menu displays everything correctly, including OAD and episode#.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2009
Location: Maryland

PostPosted: Sun Sep 09, 2012 2:54 am    Post subject: Reply with quote

No such thing as container.tmpl in the video plugin, unless it's residue from an old version.
_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
lpwcomp



Joined: 09 Sep 2011
Posts: 70

PostPosted: Sun Sep 09, 2012 3:26 am    Post subject: Reply with quote

I have a specific example of what I am talking about.

Using a version of pyTiVo with just my mods in it, I pulled an episode of "White Collar" from my THD, with the "Save metadata to .txt" option checked. The metadata file thus created had the following line in it:
Code:
programId: EP011775780049


If I run metadata.py on the .tivo file, the output contains the line:
Code:
programId: SH01177578
Back to top
View user's profile Send private message
bwall23



Joined: 03 Sep 2012
Posts: 7

PostPosted: Sun Sep 09, 2012 3:31 am    Post subject: Reply with quote

wmcbrine wrote:
No such thing as container.tmpl in the video plugin, unless it's residue from an old version.
It is residue. I've been unzipping each new version over the older installed directory structure.
Back to top
View user's profile Send private message
bwall23



Joined: 03 Sep 2012
Posts: 7

PostPosted: Sun Sep 09, 2012 3:46 am    Post subject: Reply with quote

bwall23 wrote:
Also pulled 2 old recording from pyTivo using my TiVo and they show in the NPL sorted with their original recorded date and display Season and Episode numbers in the HD My Shows. Details displays recorded date/time channel# and callsign. OAD displays correctly. Pressing info displays OAD and Episode#, but not Season#. SD menu displays everything correctly, including OAD and episode#.
Now after doing some more transfers I have to say it appears that if the recording I pull back to the TiVo is more than 28 days old and it's not still on the TiVo in the NPL or Recently Deleted, it doesn't show the Season/Episode in the HD NPL view or the episode# in the SD view. But the recording still appears sorted in the original recording date order in the NPL and both HD and SD views show correct info for OAD, Recorded on Date, Title, Series Title, Episode Title and my modified description from the metadata.txt file.
Back to top
View user's profile Send private message
bwall23



Joined: 03 Sep 2012
Posts: 7

PostPosted: Sun Sep 09, 2012 6:19 am    Post subject: Reply with quote

Strangeness ensues. programId is now on the TiVo with the transferred shows, but now looking at the shows on the TiVo (xml), other metadata in the NPL and video details are either missing or incorrect. Too many variables and probably trying to hit a moving taget anyway.
Back to top
View user's profile Send private message
lpwcomp



Joined: 09 Sep 2011
Posts: 70

PostPosted: Sun Sep 09, 2012 4:03 pm    Post subject: Reply with quote

Well, I got metadata.py to do what it should when run against a .tivo file, but I do not like my solution. Since I don't use it like that, I'll just wait for the official solution. There has to be a better way to do it than the way I did it. In fact, I know there is.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2009
Location: Maryland

PostPosted: Sun Sep 09, 2012 7:55 pm    Post subject: Reply with quote

It's already in my repos.
_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
lpwcomp



Joined: 09 Sep 2011
Posts: 70

PostPosted: Mon Sep 10, 2012 12:04 am    Post subject: Reply with quote

wmcbrine wrote:
It's already in my repos.
Switched to latest revision (1359) via SVN using Eclipse.

Exported to test directory

Started this vcersion of pyTiVo

Brought up web interface

Selected a TiVo to pull from

*KABOOM*

Code:
ERROR:pyTivo:Exception during request from ('127.0.0.1', 2312)
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:\pyTivo Test\pyTivo\httpserver.py", line 85, 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:\pyTivo Test\pyTivo\httpserver.py", line 111, in do_GET
    self.handle_query(query, tsn)
  File "C:\pyTivo Test\pyTivo\httpserver.py", line 164, in handle_query
    if self.do_command(query, command, basepath, tsn):
  File "C:\pyTivo Test\pyTivo\httpserver.py", line 143, in do_command
    method(self, query)
  File "C:\pyTivo Test\pyTivo\plugins\togo\togo.py", line 148, in NPL
    (float(entry['SourceSize']) / (1024 ** 3)) )
KeyError: 'SourceSize'


To (hopefully) eliminate SVN and Eclipse or my confguration as the source of the problem, I switched back to 1357, applied my patch, exported, started pyTivo. Everything OK.

* edited to correct version numbers


Last edited by lpwcomp on Mon Sep 10, 2012 2:08 am; edited 1 time in total
Back to top
View user's profile Send private message
BigErn



Joined: 10 Sep 2012
Posts: 2

PostPosted: Mon Sep 10, 2012 1:41 am    Post subject: Error Message Reply with quote

Code:
ERROR:pyTivo:Exception during request from ('127.0.0.1', 2312)
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:\pyTivo Test\pyTivo\httpserver.py", line 85, 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:\pyTivo Test\pyTivo\httpserver.py", line 111, in do_GET
    self.handle_query(query, tsn)
  File "C:\pyTivo Test\pyTivo\httpserver.py", line 164, in handle_query
    if self.do_command(query, command, basepath, tsn):
  File "C:\pyTivo Test\pyTivo\httpserver.py", line 143, in do_command
    method(self, query)
  File "C:\pyTivo Test\pyTivo\plugins\togo\togo.py", line 148, in NPL
    (float(entry['SourceSize']) / (1024 ** 3)) )
KeyError: 'SourceSize'


I also get this same error message with the latest builds from both wmcbrine and lucasnz forks, when trying to access the shows on any of my Tivo units. Tried the builds at https://github.com/wmcbrine/pytivo/zipball/master wmcbrine-pytivo-0af8ec1.zip and http://repo.or.cz/w/pyTivo/wmcbrine/lucasnz.git/snapshot/cefa6f9ef6abf65dd528d547ef5f7155dd184385.zip. Switching back to older builds resolves the problem. Tried both builds with python 2.6.5 and 2.7 with the same result.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Site is in NO WAY affiliated with TiVo Inc

Powered by phpBB © 2001, 2005 phpBB Group
phpBB SEO

Get pytivo at SourceForge.net. Fast, secure and Free Open Source software downloads
[ Time: 0.1765s ][ Queries: 12 (0.0129s) ][ GZIP on - Debug on ]