;;;; 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