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 

pyTivo Video Templates
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> Hacks
 View previous topic :: View next topic  
Author Message
choekstr



Joined: 06 Dec 2008
Posts: 152

PostPosted: Thu Jun 18, 2009 5:56 am    Post subject: Reply with quote

Is there more detail on templates either on the wiki or in a post that someone has created?

I would like to change what pytivo displays for tv shows when browsing on the Tivo (not transferred yet). Right now it shows episodeTitle and I would prefer series title. I mash the few tv shows I get into one directory and all I see is a listing of episode titles and can't determine what show is what without going into each one.

The way I see it, there are 4 areas where our pyTivo content is displayed:
1.) Once transferred in NPL
2.) Prior to transfer in pyTivo share
3.) Selecting file to view details Line1 <- Currently in template
4.) Selecting file to view details Line2 <- Currently in template

What I would like is the ability to also adjust #1 and #2 but I am not finding anything in the templates that seems to be applicable. I don't care as much about modifying it once it is on the Tivo but sure would like to manipulate #2.

Does anyone know if this is possible in our current template implementation? If not, maybe a pointer to somewhere in the pyTivo code that controls which field is displayed on displaying a list of media?

--
Chris
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 1420

PostPosted: Fri Jun 19, 2009 10:10 pm    Post subject: Reply with quote

IIRC, the episodeTitle field shows up in two places in the template files. All the published ones in this thread set both locations to the same values, but you might be able to achieve what you want by changing just one of them.

You'd have to experiment with it.

Grab one of my modified sets and then diff it with the originals to find the locations to change.
Back to top
View user's profile Send private message
choekstr



Joined: 06 Dec 2008
Posts: 152

PostPosted: Sun Jun 21, 2009 1:40 am    Post subject: Reply with quote

Yeah I saw you had mentioned that in the past and I had already done a complete search for episodeTitle and replace with seriesTitle (with a pytivo service restart) and that didn't make a difference. Now that I think about it, I can't remember if I did it in both TvBus.tmpl and container.tmpl. Maybe I did the wrong one?

Speaking of the different files, what are the difference between the two files? episodeTitle shows up in both. I thought at first one was for movies and one was for episodes but the more I looked at them the more I convinced myself they were not. This is really why I wanted more documentation.

Another approach would be to modify the pytivo code that shows the share listings to show what I desire but while I did find where it loaded in the metadata file I got lost on the specifics in the various files that I checked. I think this approach would have me in the video plugin but then again you, wmcbrine, wgw, etc are so far beyond where I am as a programmer that the code is hard for me to follow in many areas.

I am going to spend some more time experimenting with it to see if I can determine what in the template(s) would control this. We might have to extend the templates and the pytivo appropriate sections to allow for this if it isn't in there.

One other question: When people have a directory of a show, say Lost, and it has all the files from a season in there. How do you guys determine what episode is what to find the right season/episode number? Right now one would have to go into each and every episode to find out what season and number it was. With the alpha vs date sorting discussions this could sort and put the files all over in the list. I can't believe others haven't commented on this in the past. Maybe I am not getting what everyone else is since I can't see anyone wanting it this way. Here is what I have:
Code:

Tivo
  |->pyTivo_tv_share
               |->Lost subdir
                      |->Born to Run
                      |->Do No Harm
                      |->Exodus
               |->True Blood subdir


Those are season 1, episodes 22,20, and 23 respectively but I can only tell by going into each one and THEN the templates kick in and I can see the changes as "Lost 0122 Born to Run". Since they are sorted in alpha or mtime date order there is no way to find the next episode without going into each one. Is this desired? Is this what everyone else sees?

Scratching my head,
Chris
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 1420

PostPosted: Sun Jun 21, 2009 2:19 am    Post subject: Reply with quote

Yeah, I didn't like that either so I took both of wgw's template hacks and combined them into the templates in my post here:

http://pytivo.krkeegan.com/post6541.html#6541

Have you tried just using my zero pad template and alpha sorting?

If so, I think you'll see this:

Code:

Tivo
  |->pyTivo_tv_share
               |->Lost subdir
                      |->0120 Do No Harm
                      |->0122 Born to Run
                      |->0123 Exodus
               |->True Blood subdir


Then once you pull to the Tivo, if the show has an active seriesID in your guide data AND at least two pulled episodes exist AND grouping is enabled, THEN the seriesTitle in the metadata is IGNORED and the group will be named after the title of the series coming from the guide data. So you end up with this (assuming alpha sort and both the example seriesID's are in your guide data):

Code:

Tivo
  |->Lost subdir
         |->0120 Do No Harm
         |->0122 Born to Run
         |->0123 Exodus
   |->True Blood subdir


Now if all the seriesID magic that is necessary to trigger grouping doesn't work OR you only have one episode with the seriesId on the Tivo, you would see (assuming alpha sort):

Code:

Tivo
  |->Lost 0120 Do No Harm
  |->Lost 0122 Born to Run
  |->Lost 0123 Exodus
  |->True Blood 0101 Strange Love



That being said, I actually keep my Tivo in date sort most of the time because my newly transferred stuff bubbles too the top that way once transferred.

Pre-transfer, I tend to copy my files between machines because I don't have lots of drive space on my pyTivo box. And since my files are named:

"<seriestitle> S<seasonnum>E<episodenum>.<filetype>"

When I select all and copy them, the mtime's tend to change in alphabetical order (reverse alphabetically technically.)
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2033
Location: Maryland

PostPosted: Sun Jun 21, 2009 2:46 am    Post subject: Reply with quote

choekstr wrote:
TvBus.tmpl and container.tmpl. ... what are the difference between the two files?

container.tmpl is used to answer the request that generates the one-line-per-video list that you page through. TvBus.tmpl is used for the request that generates the info screen you get when you select a specific video. There's a lot of overlap in the contents, but some info is only in one or the other. And just to make things fun, the two requests expect different tags for the duplicate info, though mostly (?) in the form of capitalization ("Description" vs. "description", etc.).

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



Joined: 06 Dec 2008
Posts: 152

PostPosted: Mon Jun 22, 2009 1:47 pm    Post subject: Reply with quote

wmcbrine,
Thanks for the clarification of what the two files do. That REALLY helps.

rdian06,
I was using your latest templates and is what prompted me to work on this. I think there was something weird with my meta data as when I deleted and re-ran pyTivoMetaThis the files in a folder now work properly and display as you have expressed. That was strange.

However, in the root of the pytivo share I still see the episodeTitle only. So in a folder under the pytivo share it displays using the template criteria but in the top level it doesn't. Is this the same for you?
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 1420

PostPosted: Mon Jun 22, 2009 3:53 pm    Post subject: Reply with quote

choekstr wrote:

However, in the root of the pytivo share I still see the episodeTitle only. So in a folder under the pytivo share it displays using the template criteria but in the top level it doesn't. Is this the same for you?


I'm not sure. I don't normally have any TV shows at the top level, only folders or movies. I'll give it a try later and let you know.
Back to top
View user's profile Send private message
choekstr



Joined: 06 Dec 2008
Posts: 152

PostPosted: Mon Jun 22, 2009 4:13 pm    Post subject: Reply with quote

Ok, armed with knowing that container.tmpl is where I want to play I finally found the line that controls the top level. Line 48 on rdian06's latest template is what I changed from:
Code:
<Title>$escape($video.title)</Title>
to
Code:
<Title>$escape($video.seriesTitle) $pad($escape($video.episodeNumber)) $escape($video.title)</Title>


This change makes it now show the seriesTitle, then the episodeNumber, then the episodeTitle for just the main (root) share as in the following:
Lost 0123 Exodus

Within a folder it still acts the same as the original template dictates.

Whew, thanks for all the help on this one guys. It had been bothering me and now I finally have it the way that works best for me.

[EDIT: Added in the missing padding for episodeNumber]
[EDIT#2: UPDATED VERSION: Fixed small bug where videos would show episodeNumber and therefore a prefaced '0' in-front of the video name. NOTE: $video.isEpisode is not set correctly in container.tmpl so I had to use #if $video.episodeTitle]


Last edited by choekstr on Mon Jun 29, 2009 11:24 pm; edited 3 times in total
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 1420

PostPosted: Mon Jun 22, 2009 4:30 pm    Post subject: Reply with quote

Quick question, are you zero padding the season number in your metadata?
Back to top
View user's profile Send private message
choekstr



Joined: 06 Dec 2008
Posts: 152

PostPosted: Mon Jun 22, 2009 4:34 pm    Post subject: Reply with quote

Oh, good call. I did forget to add that and I added in the missing padding to my previous post.
Back to top
View user's profile Send private message
jcthorne



Joined: 30 Jan 2008
Posts: 243
Location: Houston, TX

PostPosted: Sun Aug 30, 2009 1:22 pm    Post subject: Reply with quote

rdian06, any idea why these templates work fine for pulled video and when the web interface is used but not for vids pushed to tivo? Any way to do the same for pushed video?
Back to top
View user's profile Send private message
rdian06



Joined: 12 Apr 2008
Posts: 1420

PostPosted: Mon Aug 31, 2009 7:06 am    Post subject: Reply with quote

Push has different metadata fields from pull. The set is more limited and it doesn't use the templates. I think the code selects the metadata fields directly so remapping has to be done in the code instead of in the templates.
Back to top
View user's profile Send private message
jcthorne



Joined: 30 Jan 2008
Posts: 243
Location: Houston, TX

PostPosted: Mon Aug 31, 2009 12:08 pm    Post subject: Reply with quote

Thanks for the explaination. Perhaps we can persuade WmMcBrine to update the push code to use a similar template arrangement to the pull code.

Bummer, I so seldom use pull anymore since it does not support MP4 files.
Back to top
View user's profile Send private message
reneg



Joined: 04 Jan 2008
Posts: 161

PostPosted: Mon Aug 31, 2009 1:25 pm    Post subject: Reply with quote

I wonder if both push and pull could get their display characteristics from the same place? Maybe like a configuration file. Hmmm.
Back to top
View user's profile Send private message
tbrowne



Joined: 26 Jun 2009
Posts: 2

PostPosted: Fri Feb 05, 2010 6:37 pm    Post subject: Hacked Template Replacement Calrification Reply with quote

Could someone please clarify how to replace the current video templates (C:\Program Files\pyTivo\plugins\video\templates)?

It is easy enough to just replace the standard files with Radion06's replacements (which replaced my container.tmpl and TvBus.tmpl files, but did not replace my container.xsl file in this folder), as instructed above, but then what are the next steps to see if the replacement files take (mine do not seem to have). Do we create a new meta file (with metagenerator) which from our share we can pull to the NPL and expect to see the new and highly desired format??? Or is there another (missing, in my case) step?

What I did
1. replaced template (in C:\Program Files\pyTivo\plugins\video\templates)
2. soft reset of pytivo
3. created new meta file using metagenerator
4. saved new meta file with show in share folder (meta in .meta subfolder)
5. restart tivo box
6. pulled show to NPL from share using tivo

When done, there was NO change whatsoever in the way Tivo displayed the show in the NPL (sadly not even episodeNumber).

And, thanks to Radion06 for all the work and help...
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 -> Hacks All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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 cannot 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.2500s ][ Queries: 13 (0.0134s) ][ GZIP on - Debug on ]