torrent-to-pixeldrain
Version:
Allows you to download a torrent and upload it to pixeldrain.com
35 lines • 1.61 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UploadableFile = void 0;
class UploadableFile {
/**
* Creates an instance of UploadableFile.
* @param {string} location Path to the file as a string
* @param {string} fileName Name of the file
* @param {PixeldrainService} pixeldrainService
* @memberof UploadableFile
*/
constructor(location, fileName, pixeldrainService) {
this.location = location;
this.fileName = fileName;
this.pixeldrainService = pixeldrainService;
}
upload() {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
this.pixeldrainService.uploadFile(this.location, this.fileName)
.then(resolve)
.catch(reject);
}));
}
}
exports.UploadableFile = UploadableFile;
//# sourceMappingURL=uploadablefile.js.map
;