From 4b5b84a0fc3187a2b273de236397bc7ca48c333f Mon Sep 17 00:00:00 2001 From: DC Date: Sat, 21 May 2016 08:29:01 -0700 Subject: [PATCH] Resume playback from saved position, even if we had to restart the torrent --- renderer/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/renderer/index.js b/renderer/index.js index 5ae89b05..f82dab2a 100644 --- a/renderer/index.js +++ b/renderer/index.js @@ -873,8 +873,13 @@ function torrentMetadata (torrentKey, torrentInfo) { torrentSummary.status = 'downloading' torrentSummary.name = torrentSummary.displayName || torrentInfo.name torrentSummary.path = torrentInfo.path - torrentSummary.files = torrentInfo.files torrentSummary.magnetURI = torrentInfo.magnetURI + // TODO: make torrentInfo immutable, save separately as torrentSummary.info + // For now, check whether torrentSummary.files has already been set: + var hasDetailedFileInfo = torrentSummary.files && torrentSummary.files[0].path + if (!hasDetailedFileInfo) { + torrentSummary.files = torrentInfo.files + } if (!torrentSummary.selections) { torrentSummary.selections = torrentSummary.files.map((x) => true) }