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 

Does PyTivo cache directory names/times?

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



Joined: 26 Oct 2010
Posts: 24

PostPosted: Tue Jun 12, 2012 1:30 pm    Post subject: Does PyTivo cache directory names/times? Reply with quote

I have a cron job that resets directory times to the time of the most recent file in it, so when I view them in Tivo, they sort by date according to the most recent show.

However, if I view them in Tivo, often the directory times are wrong; and that even though when I view them in the filesystem they are correct, Tivo shows an older time (causing the sorting to be wrong).

Does PyTivo cache these dirs and their modified dates/times, and is there any way to flush this cache?
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2010
Location: Maryland

PostPosted: Tue Jun 12, 2012 8:28 pm    Post subject: Reply with quote

Yes, pyTivo caches. It's a bit complicated... the simplest way to flush it would be to restart pyTivo.
_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
mcampbell



Joined: 26 Oct 2010
Posts: 24

PostPosted: Tue Jun 12, 2012 9:08 pm    Post subject: Reply with quote

Ugh. Is this happening via the lrucache code? I can easily reduce the # that thing is caching; I don't have enough stuff that performance is going to be an issue for me. (And if it is, I can up it again, I suppose).
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2010
Location: Maryland

PostPosted: Tue Jun 12, 2012 9:31 pm    Post subject: Reply with quote

It's not that big a deal to restart, surely? You can do it from the same script.
_________________
My pyTivo fork . My page
Back to top
View user's profile Send private message Visit poster's website
mcampbell



Joined: 26 Oct 2010
Posts: 24

PostPosted: Wed Jun 13, 2012 12:20 am    Post subject: Reply with quote

I can; but it runs several times a day (new downloads come in via sickbeard at indeterminate times), almost surely at some point while pytivo is being used. Plus, my directory-re-datetimer runs as me (cron), while restarting pytivo requires root, since it's started by root on system start.

Once the transcoding starts with ffmpeg, is it safe to restart pytivo in the middle of that, or would that kill the transfer? (This is running on Linux, btw, so we'd have normal unix job controls in effect.)

(Edit)

That said, I wrote a script I'm having root run in cron that checks the pytivo.log file; if it's not "old" enough (over 15 mins of no activity), it does nothing. Otherwise, it restarts pytivo. I suspect I might catch a race condition now and again, but it will be rare.
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2010
Location: Maryland

PostPosted: Wed Jun 13, 2012 4:50 am    Post subject: Reply with quote

mcampbell wrote:
Once the transcoding starts with ffmpeg, is it safe to restart pytivo in the middle of that, or would that kill the transfer?

That should kill the transfer, yeah.

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



Joined: 20 Jun 2012
Posts: 7

PostPosted: Wed Jun 20, 2012 5:48 pm    Post subject: Reply with quote

I have hacked my pyTivo to look in the sub folder and actually use the date/time of the newest video file. I did this because I also wanted to ignore empty folders and if there is only one file it is not displayed in a folder at all like the Tivo does in now playing. I'm also caching all this so the speed is really good after the first scan which for me only takes a few seconds. I check the folder date/time to see if I need to update the cache.

I wanted to make a fork that has my changes, but I just have not got back to it. It is working so well I have not had to touch it.

I also started caching more of the metadata and it great for push screens that list a lot of files, but I have found that the cache can get out of date if only the metadata is changed. The parent folder only updates the modified date/time when files are added or removed and that is my trigger that I need to update the cache.
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 -> Support 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.3488s ][ Queries: 17 (0.0195s) ][ GZIP on - Debug on ]