Note that there are some explanatory texts on larger screens.

plurals
  1. POI want a clever algorithm for indexing a file directory...pointers?
    primarykey
    data
    text
    <p>I have a directory of music on Ubuntu (.mp3, .wav, etc) files. This directory can have as many sub directories as it needs, no limits. I want to be able to make a music library out of it - that is, return list of songs based on filters of:</p> <p>1) membership to playlist 2) artist name 3) string search 4) name of song etc, etc</p> <p>However, if file names are changed, moved, or even added to my Music directory, I need to be able to reflect this is in my music organization engine - quickly! </p> <p>I originally thought to just monitor my directory with pyinotify, incron, or inotify. Unfortunately my directory is a Samba share and so monitoring file events <a href="https://stackoverflow.com/questions/6795847/notifier-on-linux-filesystem-for-samba-share">failed</a>. So my next guess was to simply recursively search the directory in python, and populate a SQL database. Then when updating, I would just look to see if anything has changed (scanning each subfolder to see if each song's name is in the database already, and if not adding it), and make UPDATEs accordingly. Unfortunately, this seems to be a terrible <code>O(n^2)</code> implementation - awful for a multi-terabyte music collection. </p> <p>A slightly better one might involve creating a tree structure in SQL, thus narrowing the possible candidates to search for a match at any given subfolder step to the size of that subfolder. Still seems inelegant. </p> <p>What design paradigms/packages can I use to help myself out? Obviously will involve lots of clever hash tables. I'm just looking for some pointers in the right direction for how to approach the problem. (Also I'm a complete junkie for optimization.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload