import Model, enum from require "lapis.db.model" class Tracks extends Model next: => return Tracks\select("WHERE id > ? ORDER BY id ASC LIMIT 1", @id)[1] previous: => return Tracks\select("WHERE id < ? ORDER BY id DESC LIMIT 1", @id)[1] @statuses: enum { new: 1 -- needs to be checked out / downloaded / bought downloaded: 2 -- illegal owned: 3 -- legal! duplicate: 4 -- needs to be deleted ignored: 5 -- don't want it imported: 6 -- needs to be checked out } @qualities: enum { not_available: 1 -- not in library lossless: 2 high: 3 acceptable: 4 low: 5 unacceptable: 6 } @fields = { id: true artist: true title: true link: true status: true art_url: true file_url: true file_size: true album: true genre: true tags: true quality: true mood: true }