importer chnges
This commit is contained in:
@@ -627,3 +627,14 @@ extension Library {
|
||||
try execute("UPDATE songs SET title=?,artist=?,album=?,track_number=?,rendition=?,metadata_edited=? WHERE id=?",[value.title,value.artist,value.album,value.track,value.rendition,String(edited),String(id)])
|
||||
}
|
||||
}
|
||||
|
||||
struct LibraryPage {
|
||||
static let size = 20
|
||||
let total: Int
|
||||
let count: Int
|
||||
let number: Int
|
||||
var range: Range<Int> { let start = number*Self.size;return start..<min(total,start+Self.size) }
|
||||
init(total:Int,requested:Int) {
|
||||
self.total = max(0,total);count = max(1,(max(0,total)+Self.size-1)/Self.size);number = min(count-1,max(0,requested))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user