diff options
author | Colin Okay <colin@cicadas.surf> | 2022-10-25 09:42:53 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-10-25 09:42:53 -0500 |
commit | 8f7a582c90eb6a879deeb39658dd9f7de3b31149 (patch) | |
tree | d54a86a4d1ea34219b51b6ac7e67e8ec197b0afc | |
parent | a47d4afe8f58b509a19af137191f7dbe7172b4c1 (diff) |
Modify: nabbing playlist key from path
-rw-r--r-- | vampire.lisp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vampire.lisp b/vampire.lisp index e7ce96d..d530fb3 100644 --- a/vampire.lisp +++ b/vampire.lisp @@ -111,7 +111,7 @@ (reload (location (connection-body parent))))))) (defun url-to-playlist (pl location) - (format nil "~a//~a/playlist?list=~a" + (format nil "~a//~a/playlist/~a" (protocol location) (host location) (key pl))) @@ -136,8 +136,6 @@ (pathname-name (track-file track)) (pathname-type (track-file track)))) -(create-audio ) - (defun create-track-listing (parent playlist &rest args) (declare (ignorable args)) (dolist (track (playlist-tracks playlist)) @@ -185,9 +183,12 @@ (format nil "Error whiel fetching track at: ~a~%" url))))))))) +(defun playlist-key-from-url (url) + (first (last (ppcre:split "/" (nth 4 (multiple-value-list (quri:parse-uri url))))))) + (defun playlist-page (body) (when-let* ((listid - (form-data-item (form-get-data body) "list")) + (playlist-key-from-url (url (location body)))) (playlist (object-with-key listid))) (with-clog-create body |