This PR fixes one of our number 2 top error (142 error reports today
alone):
Processes: webtorrent window, platforms: darwin linux win32, versions:
pre-0.12 0.14.0 0.17.0 0.17.1
TypeError: Cannot read property 'files' of null
at getAudioMetadata (.../build/renderer/webtorrent.js:328:21)
at EventEmitter.<anonymous> (.../build/renderer/webtorrent.js:84:74)
at emitThree (events.js:116:13)
at EventEmitter.emit (events.js:194:7)
This error is reproducible if you start webtorrent for the first time
and click the WIRED CD torrent. This causes the webtorrent process to
get a 'wt-get-audio-metadata' before 'wt-start-torrenting'.
You can reproduce it 100% of the time if you force the race condition
to show itself by slowing down the sending of the 'wt-start-torrenting'
event.
(This same error was showing for an unrelated reason in the past: #891)
In Electron apps, the cost of large modules is very real.
fs-extra is very convenient, but removing it caused 50 fewer unique
files to be required(), resultin in 60ms faster startup!
Before: 557 unique requires (1330-1340ms)
After: 507 unique requires (1270-1280ms)
Before this change, using the "Open Torrent Address" dialog to paste a
magnet link would fail with leading or trailing spaces.
Pasting on the torrent list page has always trimmed. So this PR just
makes it consistent.
- Make State.save() always throttle calls -- since that's the common
case.
- Immediate saves are now the exception, with State.saveImmediate().
- The function is called State.save(), so the dispatch event should be
'stateSave'.
* Open multi-file torrents as playlists
* Add `repeat` and `shuffle` options to the player
* Autoplay first file in torrent
* replaces `pickFileToPlay` feature
* when reopening player, restores the most recently viewed file
* Add playlist navigation buttons to Windows thumbar
* Remove `repeat` and `shuffle` options
This reverts commit 9284122461.
* Play files in order they appear in torrent
* Clean up playlists code