41 lines
710 B
Plaintext
41 lines
710 B
Plaintext
import Model, enum from require "lapis.db.model"
|
|
|
|
class Tracks extends Model
|
|
next: =>
|
|
return @select("WHERE id < ? ORDER BY id DESC LIMIT 1", @id)[1]
|
|
previous: =>
|
|
return @select("WHERE id > ? ORDER BY id ASC LIMIT 1", @id)[1]
|
|
|
|
@statuses: enum {
|
|
new: 1
|
|
downloaded: 2
|
|
owned: 3
|
|
duplicate: 4
|
|
ignored: 5
|
|
imported: 6
|
|
}
|
|
@qualities: enum {
|
|
not_available: 1
|
|
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
|
|
}
|