gnump3d-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnump3d-devel] Re: Idea for realtime tagcache updating


From: Stuffed Crust
Subject: Re: [Gnump3d-devel] Re: Idea for realtime tagcache updating
Date: Wed, 16 Mar 2005 22:53:14 -0500
User-agent: Mutt/1.4.1i

On Sun, Mar 13, 2005 at 10:32:43AM -0500, Stuffed Crust wrote:
> To do an exclusive open, it looks like I'm going to have to use 
> IO::Handle.  It was added to the core package set in perl 5.004, which I 
> believe is reasonable to require, if it's not already so.

I haven't done this yet -- but I'm otherwise done with my patch. 

-1) Fix the "compile" error in the path sanitization.  (someone goofed)
0) Don't bother with the stat array length test, it's defined at 13 
   elements, and on win32 the unused fields are 0, according to the 
   perl docs.  If I'm wrong here, please clue me in.
1) Capitalize 'mtime' in the tagcache to make it consistent with 
   everything else. Handle reading old caches with the lowercase entry.
2) And on that note, treat mtime as just another tag cache entry; it's 
   just another key=value pair.  If it's there, great.  If not, no big 
   deal.
3) Fix "FILENAME" tag computation for non-cached entries; this avoids 
   exposing filesystem layout to the web.
4) Fix the boneheaded SIGHUP "reload cache" test to happen in the 
   parent, not the children.  (this one's my fault, doubly so..)
5) Fix filesize prettyprinting to happen in the display formatting, not 
   on tag read.

And now, the meat of the patch:

5) When the children find files not in the tag cache, they read the tags 
   from the mp3 files then spit this out into $CACHE_FILE.updates.  The 
   parent reads this in, and updates the tag cache for subsequent 
   children.
6) The indexer loads both $CACHE_FILE and $CACHE_FILE.updates when 
   performing its indexing run, then removes $CACHE_FILE.updates.

Known warts: 

Concurrent accesses may cause the cachefile.updates to get garbled as we 
don't enforce exclusive access.  That's no big deal though, and I plan 
to fix it later.  I want to get this patch out there first.

I'm using this code on my server now, and it seems to work pretty well.  

 - Solomon
-- 
Solomon Peachy                                   ICQ: 1318344
Melbourne, FL                                    JID: address@hidden
Quidquid latine dictum sit, altum viditur

Attachment: pgpnSNb1GB8f1.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]