Changeset bed890a2afe3daa816c83274d5a0c9ff09b3c694

Show
Ignore:
Timestamp:
04/27/08 17:28:08 (7 months ago)
Author:
Jason Michalski <armooo@armooo.net>
git-committer:
Jason Michalski <armooo@armooo.net> 1209335288 -0500
git-parent:

[1778ab1cb1dc9b8e47928c28ca96938b4d47e28d]

git-author:
Jason Michalski <armooo@armooo.net> 1209334971 -0500
Message:

Using FS mtime to reload non recursive cache.
Recursive cache expires after a hour.

Girlfriend said this must be fixed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/music/music.py

    r9181fdc rbed890a  
    427427        recurse = query.get('Recurse',['No'])[0] == 'Yes' 
    428428 
     429        filelist = [] 
    429430        if recurse and path in self.recurse_cache: 
    430             filelist = self.recurse_cache[path] 
     431            if self.dir_cache.mtime(path) + 3600 >= time.time(): 
     432                filelist = self.recurse_cache[path] 
    431433        elif not recurse and path in self.dir_cache: 
    432             filelist = self.dir_cache[path] 
    433         else: 
     434            if self.dir_cache.mtime(path) >= os.stat(path)[8]: 
     435                filelist = self.dir_cache[path] 
     436 
     437        if not filelist: 
    434438            filelist = SortList(build_recursive_list(path, recurse)) 
    435439