Common components refactor #1
2 changed files with 15 additions and 7 deletions
|
@ -167,6 +167,7 @@ var LOADING_VIDEO_FAILED = exports.LOADING_VIDEO_FAILED = 'LOADING_VIDEO_FAILED'
|
|||
var DOWNLOADING_STARTED = exports.DOWNLOADING_STARTED = 'DOWNLOADING_STARTED';
|
||||
var DOWNLOADING_PROGRESSED = exports.DOWNLOADING_PROGRESSED = 'DOWNLOADING_PROGRESSED';
|
||||
var DOWNLOADING_COMPLETED = exports.DOWNLOADING_COMPLETED = 'DOWNLOADING_COMPLETED';
|
||||
var DOWNLOADING_CANCELED = exports.DOWNLOADING_CANCELED = 'DOWNLOADING_CANCELED';
|
||||
var PLAY_VIDEO_STARTED = exports.PLAY_VIDEO_STARTED = 'PLAY_VIDEO_STARTED';
|
||||
var FETCH_AVAILABILITY_STARTED = exports.FETCH_AVAILABILITY_STARTED = 'FETCH_AVAILABILITY_STARTED';
|
||||
var FETCH_AVAILABILITY_COMPLETED = exports.FETCH_AVAILABILITY_COMPLETED = 'FETCH_AVAILABILITY_COMPLETED';
|
||||
|
@ -1047,6 +1048,13 @@ Lbry.file_delete = function () {
|
|||
});
|
||||
};
|
||||
|
||||
Lbry.file_set_status = function () {
|
||||
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
return new Promise(function (resolve, reject) {
|
||||
apiCall('file_set_status', params, resolve, reject);
|
||||
});
|
||||
};
|
||||
|
||||
Lbry.connectPromise = null;
|
||||
Lbry.connect = function () {
|
||||
if (Lbry.connectPromise === null) {
|
||||
|
|
14
src/lbry.js
14
src/lbry.js
|
@ -143,15 +143,15 @@ Lbry.status = () =>
|
|||
reject
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Lbry.file_delete = (params = {}) =>
|
||||
new Promise((resolve, reject) => {
|
||||
apiCall(
|
||||
'file_delete',
|
||||
params,
|
||||
resolve,
|
||||
reject
|
||||
);
|
||||
apiCall('file_delete', params, resolve, reject);
|
||||
});
|
||||
|
||||
Lbry.file_set_status = (params = {}) =>
|
||||
new Promise((resolve, reject) => {
|
||||
apiCall('file_set_status', params, resolve, reject);
|
||||
});
|
||||
|
||||
Lbry.connectPromise = null;
|
||||
|
|
Loading…
Reference in a new issue