2017-06-08 23:24:19 +00:00
|
|
|
import * as plugins from './smartdrive.plugins'
|
|
|
|
import { IDrive } from './smartdrive.interfaces'
|
|
|
|
|
2017-07-20 22:04:08 +00:00
|
|
|
let promisifiedDrivelist = plugins.smartq.promisify(plugins.drivelist.list)
|
2017-06-08 23:24:19 +00:00
|
|
|
|
|
|
|
export class LocalDriveList {
|
|
|
|
private _list: IDrive[] = null
|
|
|
|
|
|
|
|
async getList (): Promise<IDrive[]> {
|
|
|
|
if (!this._list) {
|
|
|
|
this._list = await promisifiedDrivelist()
|
|
|
|
}
|
|
|
|
return this._list
|
|
|
|
}
|
|
|
|
|
|
|
|
async getUpdatedList (): Promise<IDrive[]> {
|
|
|
|
this._list = null
|
|
|
|
return await this.getList()
|
|
|
|
}
|
|
|
|
}
|