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 

Fixing "Sub-Folder" Item count

 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo
 View previous topic :: View next topic  
Author Message
rfryar



Joined: 10 Feb 2008
Posts: 36

PostPosted: Sun Feb 17, 2008 12:56 am    Post subject: Fixing "Sub-Folder" Item count Reply with quote

In the process of developing my new plug in I have stumpled across a fix that will correctly show the items inside of a subfolder instead of the (0) that shows up there in the video plugin.

Now I am not totally familiar with the Video plugin so I will just show the change that I used for my ReplayTV plugin but I would assume that one of the coders here should be able to update video.py to fix this soon.

Basically in the comtainer.tmpl file you need to add the TotalItem field to the item details for a sub folder. In my case when I was creating the sub folder "video" dictionary I added a count field that is the total of the items inside that sub folder.

Code:

    #if $video.is_dir
    <Item>
        <Details>
            <Title>$escape($video.title)</Title>
            <ContentType>x-container/tivo-videos</ContentType>
            <SourceFormat>x-container/folder</SourceFormat>
            <TotalItems>$video.count</TotalItems>
            <UniqueId>$crc($guid + $video.uniquename)</UniqueId>
        </Details>
        <Links>
            <Content>
                    <Url>/TiVoConnect?Command=QueryContainer&amp;Container=$quote($name)/$quote($video.id)</Url>
                    <ContentType>x-tivo-container/folder</ContentType>
            </Content>
        </Links>
    </Item>


Hope that makes sense.. Have at it and issue the fix to the videos plug-in.

Cheers,

Rick
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2008
Location: Maryland

PostPosted: Sun Feb 17, 2008 1:57 am    Post subject: Re: Fixing "Sub-Folder" Item count Reply with quote

rfryar wrote:
Basically in the comtainer.tmpl file you need to add the TotalItem field to the item details for a sub folder.

Yes, but more importantly, we'd have to actually count them first. Currently this is not done. However, I think that with the recent changes, this would no longer be too slow to consider.

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



Joined: 04 Jan 2008
Posts: 472

PostPosted: Tue Feb 19, 2008 2:08 am    Post subject: Reply with quote

Yes

Since we can precache, this should make it easier to update/add this field
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
Page 1 of 1

 
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.1577s ][ Queries: 12 (0.0159s) ][ GZIP on - Debug on ]