From 5056b39de76dccc56a612843e1d5464a1da67620 Mon Sep 17 00:00:00 2001 From: Wesley Kerfoot Date: Sun, 26 Aug 2012 19:11:40 -0400 Subject: [PATCH] changed retrieve-videos to use a page number parameter --- playlist_server.rkt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/playlist_server.rkt b/playlist_server.rkt index 86e3ee2..dd8ff06 100644 --- a/playlist_server.rkt +++ b/playlist_server.rkt @@ -5,6 +5,7 @@ (require web-server/dispatch) (require "links.rkt") (require "command_parser.rkt") +(require "cacher.rkt") (require xml) (define (make-server player-thread parse-command) @@ -32,11 +33,19 @@ [("add") add-name] [else user-list])) +;(check-cache +; username +; 'user +; (λ () (retrieve-videos username)) +; identity) + ;; Returns all of the videos for a user (define (user-list req) (response/xexpr (string->xexpr - (retrieve-videos (path/param-path (car (url-path (request-uri req)))))))) + (let [(username (path/param-path (car (url-path (request-uri req))))) + (page-n (hash-ref (list->hash (url-query (request-uri req))) 'p))] + (retrieve-videos username (string->number page-n)))))) ;; Adds a new resource to the lazyplay queue (define (add-name req)