Rename all vars called "___sInfo" to "___Infos"

This commit is contained in:
Alex Liebowitz 2017-01-17 05:06:39 -05:00
parent 425fbb84a5
commit 0b9980f371
2 changed files with 12 additions and 12 deletions

View file

@ -286,8 +286,8 @@ lbry.revealFile = function(path, callback) {
lbry.getFileInfoWhenListed = function(name, callback, timeoutCallback, tryNum=0) {
// Calls callback with file info when it appears in the list of files returned by lbry.getFilesInfo().
// If timeoutCallback is provided, it will be called if the file fails to appear.
lbry.getFilesInfo(function(filesInfo) {
for (var fileInfo of filesInfo) {
lbry.getFilesInfo(function(fileInfos) {
for (var fileInfo of fileInfos) {
if (fileInfo.lbry_uri == name) {
callback(fileInfo);
return;
@ -468,8 +468,8 @@ lbry._removedFiles = [];
lbry._claimIdOwnershipCache = {}; // should be claimId!!! But not
lbry._updateClaimOwnershipCache = function(claimId) {
lbry.getMyClaims((claimsInfo) => {
lbry._claimIdOwnershipCache[claimId] = !!claimsInfo.reduce(function(match, claimInfo) {
lbry.getMyClaims((claimInfos) => {
lbry._claimIdOwnershipCache[claimId] = !!claimInfos.reduce(function(match, claimInfo) {
return match || claimInfo.claim_id == claimId;
});
});
@ -520,4 +520,4 @@ lbry.fileInfoUnsubscribe = function(name, subscribeId) {
delete lbry._fileInfoSubscribeCallbacks[name][subscribeId];
}
export default lbry;
export default lbry;

View file

@ -19,11 +19,11 @@ export let FileListDownloaded = React.createClass({
document.title = "Downloaded Files";
let publishedFilesSdHashes = [];
lbry.getMyClaims((claimsInfo) => {
lbry.getMyClaims((claimInfos) => {
if (!this._isMounted) { return; }
for (let claimInfo of claimsInfo) {
for (let claimInfo of claimInfos) {
let metadata = JSON.parse(claimInfo.value);
publishedFilesSdHashes.push(metadata.sources.lbry_sd_hash);
}
@ -74,23 +74,23 @@ export let FileListPublished = React.createClass({
this._isMounted = true;
document.title = "Published Files";
lbry.getMyClaims((claimsInfo) => {
lbry.getMyClaims((claimInfos) => {
/**
* Build newFileInfos as a sparse array and drop elements in at the same position they
* occur in claimsInfo, so the order is preserved even if the API calls inside this loop
* occur in claimInfos, so the order is preserved even if the API calls inside this loop
* return out of order.
*/
let newFileInfos = Array(claimsInfo.length),
let newFileInfos = Array(claimInfos.length),
claimInfoProcessedCount = 0;
for (let [i, claimInfo] of claimsInfo.entries()) {
for (let [i, claimInfo] of claimInfos.entries()) {
let metadata = JSON.parse(claimInfo.value);
lbry.getFileInfoBySdHash(metadata.sources.lbry_sd_hash, (fileInfo) => {
claimInfoProcessedCount++;
if (fileInfo !== false) {
newFileInfos[i] = fileInfo;
}
if (claimInfoProcessedCount >= claimsInfo.length) {
if (claimInfoProcessedCount >= claimInfos.length) {
/**
* newfileInfos may have gaps from claims that don't have associated files in
* lbrynet, so filter out any missing elements