iskdaemon
iskdaemon copied to clipboard
Remove addDir
addDir should be removed because it's impossible to correlate the created image ID's with the original image file.
addDir recurses a directory tree and adds each image it finds to the image DB with a newly generated image ID. However it does not return a list of image path/ID pairs, nor is the original image path stored in the image DB. Hence there is no way to know which image ID corresponds to which image file on disk. Hence addDir is useless and should be removed.
A better solution might be to add the original path to the image file to the record in the image DB and make that query-able. Seems like that would be a nice feature anyway. Without it, the user is left to keep some sort of record of what the image IDs correspond to.
The original intention was to keep iskdaemon as simple as possible. It seems reasonable to assume that any other system integrating into iskdaemon already keeps track of the original image path and has some sort of unique numeric ID for each image, which it should supply to iskdaemon when calling addImg for each image. So there would be no point in replicating this information into iskdaemon or adding complexity into it. I agree that addDir as it is now has no use case. The options would be either removing it or improving it to return a list of tuples (new img id, path) for each added image.