From ac32ec366a6bfbad89b0509a728f73af52590c6f Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Fri, 6 Jan 2017 06:41:31 -0500 Subject: [PATCH] Update MyFilesPage to work with updated FileTile Also did a little cleanup/refactoring --- js/page/my_files.js | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/js/page/my_files.js b/js/page/my_files.js index f2381555b..eed82b670 100644 --- a/js/page/my_files.js +++ b/js/page/my_files.js @@ -122,7 +122,7 @@ var MyFilesPage = React.createClass({ return { filesInfo: null, publishedFilesSdHashes: null, - filesAvailable: {}, + filesAvailable: null, sortBy: 'date', }; }, @@ -260,8 +260,7 @@ var MyFilesPage = React.createClass({ const filesInfoSorted = this._sortFunctions[this.state.sortBy](this.state.filesInfo); for (let fileInfo of filesInfoSorted) { - let {completed, written_bytes, total_bytes, lbry_uri, file_name, download_path, - stopped, metadata, sd_hash} = fileInfo; + let {completed, lbry_uri, sd_hash, metadata, download_path, stopped, pending} = fileInfo; if (!metadata || seenUris[lbry_uri]) { continue; @@ -269,26 +268,9 @@ var MyFilesPage = React.createClass({ seenUris[lbry_uri] = true; - let {title, thumbnail} = metadata; - - if (!fileInfo.pending && typeof metadata == 'object') { - var {title, thumbnail} = metadata; - var pending = false; - } else { - var title = null; - var thumbnail = null; - var pending = true; - } - - var ratioLoaded = written_bytes / total_bytes; - - var mediaType = lbry.getMediaType(metadata.content_type, file_name); - var showWatchButton = (mediaType == 'video'); - - content.push(); + content.push(); } } return (