From 1b9d23279c876904a1e003c40aedf2a8b88fe93d Mon Sep 17 00:00:00 2001 From: 6ea86b96 <6ea86b96@gmail.com> Date: Tue, 23 May 2017 11:48:36 +0400 Subject: [PATCH] Fix playing videos that have been previously downloaded but then deleted/moved --- ui/js/actions/content.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/js/actions/content.js b/ui/js/actions/content.js index efb1851e2..0e7366dca 100644 --- a/ui/js/actions/content.js +++ b/ui/js/actions/content.js @@ -223,8 +223,11 @@ export function doPurchaseUri(uri) { // the blobs. Or perhaps there's another way to see if a file was already // purchased? - // we already fully downloaded the file - if (fileInfo && fileInfo.completed) { + // we already fully downloaded the file. If completed is true but + // writtenBytes is false then we downloaded it before but deleted it again, + // which means it needs to be reconstructed from the blobs by dispatching + // doLoadVideo. + if (fileInfo && fileInfo.completed && !!fileInfo.writtenBytes) { return Promise.resolve() }