aboutsummaryrefslogtreecommitdiff
path: root/src/cljs/gnunet_web/filesharing.cljs
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2014-10-25 22:57:09 -0500
committerDavid Barksdale <amatus@amatus.name>2014-10-25 22:57:09 -0500
commit8dc400f66d9bbed2d32a9e3087c432e895a2b959 (patch)
tree4a41830f8669dbe4708ecdcde24e538fe71209ed /src/cljs/gnunet_web/filesharing.cljs
parentf05f7a1e146c8a55dce98a4b33d0985d423b0bac (diff)
Icon in search bar and filename column in results
Diffstat (limited to 'src/cljs/gnunet_web/filesharing.cljs')
-rw-r--r--src/cljs/gnunet_web/filesharing.cljs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cljs/gnunet_web/filesharing.cljs b/src/cljs/gnunet_web/filesharing.cljs
index 90d0196..1ce891a 100644
--- a/src/cljs/gnunet_web/filesharing.cljs
+++ b/src/cljs/gnunet_web/filesharing.cljs
@@ -127,3 +127,15 @@
(array search))
(js/Runtime.removeFunction callback-pointer)
(close! ch))
+
+(defn guess-filename
+ [metadata]
+ (let [preference ["original filename"
+ "title"
+ ;; ...
+ ]]
+ (first
+ (for [type preference
+ x metadata
+ :when (= type (e/metatype-to-string (:type x)))]
+ (:data x)))))