summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vampire.lisp55
1 files changed, 55 insertions, 0 deletions
diff --git a/vampire.lisp b/vampire.lisp
index f6d5d20..7ad9b63 100644
--- a/vampire.lisp
+++ b/vampire.lisp
@@ -1,3 +1,58 @@
;;;; vampire.lisp
(in-package #:vampire)
+
+;;; SYSTEM CONFIG COMPONENT
+
+(defvar *config* nil)
+
+(defclass/std config ()
+ ((datastore-directory :ir
+ :std #P"/srv/parasite/store/")
+ (port :ir
+ :std 4919)
+ (media-directory :ir
+ :std #P"/srv/parasite/media/")))
+
+;;; RESOURCE MODEL
+
+(defclass/bknr keyed ()
+ ((key
+ :r :std (nuid)
+ :index-type string-unique-index
+ :index-reader object-with-key)))
+
+(defclass/bknr content (keyed)
+ ((title :with :std "")
+ (user :with
+ :ri
+ :std (error "A USER is required to have created the content.")
+ :index-type hash-index
+ :index-reader content-by-user)))
+
+(defmethod initialize-instance :after ((content content) &key)
+ (when (zerop (length (content-title content)))
+ (setf (content-title content) (format nil "~a-~a"
+ (class-of content)
+ (store-object-id content)))))
+
+(defclass/bknr playlist (content)
+ ((tracks editors :with :std (list))))
+
+(defclass/bknr track (content)
+ ((source media artist album :with)
+ (playlists :with :std (list) :doc "Playlists in which this track appears.")
+ (status :a :with
+ :std :uninitialized
+ :doc ":uninitialized, :acquiring, :available, :error-aquiring")))
+
+(defclass/bknr user (keyed)
+ ((name :with :std "")
+ (pw pwhash :with )
+ (playlists :with :std (list) :doc "Playlists made by this user")))
+
+(defclass/std media (bknr.datastore:blob)
+ ((track :with))
+ (:metaclass persistent-class))
+
+;;; RESOURCE ACCESS PROTOCOL