Commits

Philip Kent committed f95c5bc

Add support for storing the mime-type in the metadata cache

Currently, the mime_type field from dropbox is ignored. In this patch,
the mime_type will be stored within Dropbox's metadata cache and can
be accessed when running 'ls' on a directory.

Signed-off-by: Philip Kent <philip@knodium.com>

Comments (0)

Files changed (1)

 
 (define (select-metadata path-key #!optional recursive)
  `(select (columns (col ,(metadata-cache-table)
-			path-key revision rev thumb_exists bytes modified path
+			path-key mime_type revision rev thumb_exists bytes modified path
 			is_dir icon root size is_deleted hash client_mtime))
 	  (from ,(metadata-cache-table))
 	  (where (and (or (= (col ,(metadata-cache-table) path-key) ,path-key)
   (let ((path-key (string-append path-key "/%")))
     `(select (columns (col ,(metadata-cache-table)
 			   path-key revision rev thumb_exists bytes modified path
-			   is_dir icon root size is_deleted hash client_mtime))
+			   mime_type is_dir icon root size is_deleted hash client_mtime))
 	     (from ,(metadata-cache-table))
 	     (where (and (like (col ,(metadata-cache-table) path-key) ,path-key)
 			 (not (like (col ,(metadata-cache-table) path-key) ,(string-append path-key "/%")))
   (let* ((path (canonicalise-path path))
 	 (path-meta (if (equal? "" path)
 		      '(((path-key . "")
+			 (mime_type . #f)
 			 (revision . #f)
 			 (rev . #f)
 			 (thumb_exists . #f)