|
| Author |
Message |
mcampbell
Joined: 26 Oct 2010 Posts: 24
|
Posted: Tue Jun 12, 2012 1:30 pm Post subject: Does PyTivo cache directory names/times? |
|
|
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 |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 2010 Location: Maryland
|
Posted: Tue Jun 12, 2012 8:28 pm Post subject: |
|
|
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 |
|
 |
mcampbell
Joined: 26 Oct 2010 Posts: 24
|
Posted: Tue Jun 12, 2012 9:08 pm Post subject: |
|
|
| 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 |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 2010 Location: Maryland
|
Posted: Tue Jun 12, 2012 9:31 pm Post subject: |
|
|
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 |
|
 |
mcampbell
Joined: 26 Oct 2010 Posts: 24
|
Posted: Wed Jun 13, 2012 12:20 am Post subject: |
|
|
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 |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 2010 Location: Maryland
|
Posted: Wed Jun 13, 2012 4:50 am Post subject: |
|
|
| 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 |
|
 |
wsware
Joined: 20 Jun 2012 Posts: 7
|
Posted: Wed Jun 20, 2012 5:48 pm Post subject: |
|
|
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 |
|
 |
|