refactoring volgens skill
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
id
|
||||
name
|
||||
(filter-map
|
||||
(lambda (item) (datum->track item libraries))
|
||||
(λ (item) (datum->track item libraries))
|
||||
tracks))))))
|
||||
|
||||
(define (open-playlist-store file)
|
||||
@@ -82,7 +82,7 @@
|
||||
(when store
|
||||
(call-with-semaphore
|
||||
(playlist-store-lock store)
|
||||
(lambda () (ks-close (playlist-store-keystore store)))))
|
||||
(λ () (ks-close (playlist-store-keystore store)))))
|
||||
(void))
|
||||
|
||||
(define (load-user-playlists store username libraries)
|
||||
@@ -90,12 +90,12 @@
|
||||
'()
|
||||
(call-with-semaphore
|
||||
(playlist-store-lock store)
|
||||
(lambda ()
|
||||
(λ ()
|
||||
(define ks (playlist-store-keystore store))
|
||||
(define ids (ks-get ks (user-playlists-key username) '()))
|
||||
(if (list? ids)
|
||||
(filter-map
|
||||
(lambda (id)
|
||||
(λ (id)
|
||||
(datum->tab id (ks-get ks id #f) libraries))
|
||||
(remove-duplicates (filter uuid-string? ids) string=?))
|
||||
'())))))
|
||||
@@ -104,7 +104,7 @@
|
||||
(when store
|
||||
(call-with-semaphore
|
||||
(playlist-store-lock store)
|
||||
(lambda ()
|
||||
(λ ()
|
||||
(define ks (playlist-store-keystore store))
|
||||
(define index-key (user-playlists-key username))
|
||||
(define old-ids (ks-get ks index-key '()))
|
||||
@@ -174,13 +174,13 @@
|
||||
(define outside (build-path root "outside.flac"))
|
||||
(define store-file (build-path root "data" "playlists.keystore"))
|
||||
(dynamic-wind
|
||||
(lambda ()
|
||||
(λ ()
|
||||
(make-directory music)
|
||||
(make-directory music-two)
|
||||
(call-with-output-file (build-path music "one.flac") void)
|
||||
(call-with-output-file (build-path music-two "two.flac") void)
|
||||
(call-with-output-file outside void))
|
||||
(lambda ()
|
||||
(λ ()
|
||||
(define libraries (make-music-libraries (list music music-two)))
|
||||
(define store (open-playlist-store store-file))
|
||||
(define first-id (uuid-string))
|
||||
@@ -253,4 +253,4 @@
|
||||
(car (load-user-playlists store "unsafe" libraries)))
|
||||
'())
|
||||
(close-playlist-store! store))
|
||||
(lambda () (delete-directory/files root))))
|
||||
(λ () (delete-directory/files root))))
|
||||
|
||||
Reference in New Issue
Block a user