File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed
Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 77 [db.core :as db]))
88
99
10- (defn local-file-paths []
11- (let [base-dir (str (fs/home ) " /gifs/" )]
12- (->
13- ^{:dir base-dir :out :string }
14- (proc/$ ls)
15- proc/check :out
16- (string/split #"\n " ))))
10+ (defn local-clip-paths
11+ ([] (local-clip-paths (str (fs/home ) " /Dropbox/game-assets/game-clips" )))
12+ ([dir]
13+ (if (not (fs/exists? dir))
14+ (println " clip dir path does not exist!" dir)
15+ (->> dir
16+ fs/list-dir
17+ (filter fs/directory?)
18+ (#(fs/list-dirs % " *.{gif,mp4}" ))
19+ (map str)))))
20+
21+ (comment
22+ (local-clip-paths )
23+ )
1724
1825
1926(defn fname->clip [f]
2330 (string/replace #"Kapture " " " )
2431 (string/replace #" \d {2}%" " " )
2532 (string/replace #" at " " _" )
33+ (string/replace #" " " _" )
2634 (string/replace #".gif" " " )
2735 (string/replace #".mp4" " " ))
2836 t (dates.tick/parse-time-string time-string)]
3745 :clip/time-string time-string})))
3846
3947(defn all-clips []
40- (->> (local-file -paths )
48+ (->> (local-clip -paths )
4149 (map fname->clip)
4250 (remove nil?)))
4351
4452(defn ingest-clips []
4553 (->> (all-clips )
4654 (take 200 )
4755 (db/transact )))
56+
57+ (comment
58+ (ingest-clips ))
You can’t perform that action at this time.
0 commit comments