Update of /cvsroot/freevo/freevo/helpers
In directory sc8-pr-cvs1:/tmp/cvs-serv10955/helpers

Modified Files:
        musicsqlimport.py 
Log Message:
Speed things up a lot for large directories by skipping tracks already
present in the database. The main advantage is we don't have to calculate
a zillion MD5 sums for those files.


Index: musicsqlimport.py
===================================================================
RCS file: /cvsroot/freevo/freevo/helpers/musicsqlimport.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** musicsqlimport.py   6 Jul 2003 20:34:47 -0000       1.11
--- musicsqlimport.py   7 Jul 2003 15:15:17 -0000       1.12
***************
*** 85,98 ****
      songs = util.recursefolders(path,1,type,1)
  
!     # TODO
!     # Check the database and generate a list and then use
!     # songs.remove(os.path.join(path,filename)) 
!     # to remove it so # we can speed up the whole process. We just 
!     # need a function that returns a list of files with full paths
!     # from the database.
!     #
!     # It's not a necessity, but it'll make large directories less 
!     # time consuming to do.
! 
  
      tempvar = ''
--- 85,100 ----
      songs = util.recursefolders(path,1,type,1)
  
!     cursor.execute('SELECT path, filename FROM music')
!     count = 0
!     for row in cursor.fetchall():
!         try:
!             songs.remove(os.path.join(row['path'],row['filename']))
!             count = count + 1
!         except ValueError:
!             # Why doesn't it just give a return code
!             pass
!   
!     if count > 0:
!         print "Skipped %i songs already in the database..." % (count)
  
      tempvar = ''




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to