-
Notifications
You must be signed in to change notification settings - Fork 793
Fine tune blacklist handling #1269
Fine tune blacklist handling #1269
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor test comments.
@@ -487,7 +510,9 @@ Playlist.duration = duration; | |||
Playlist.seekable = seekable; | |||
Playlist.getMediaInfoForTime = getMediaInfoForTime; | |||
Playlist.isEnabled = isEnabled; | |||
Playlist.isDisabled = isDisabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might hit a merge conflict due to: #1271.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya we'll just merge that one first and i can rebase this or vice versa
test/playlist.test.js
Outdated
playlist.excludeUntil = Infinity; | ||
assert.notOk(Playlist.isEnabled(playlist), 'playlist is not enabled'); | ||
|
||
delete playlist.excludeUntil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we maybe break this test up in some way? Maybe one for if playerlist.disabled is set to true? Or maybe based on the expectation (should be enabled vs should not be enabled)?
It also might be safer to not maintain the const playlist
here and instead pass the raw values for playlist
in. As an example:
playlist.excludeUntil = Date.now() - 1;
assert.ok(Playlist.isEnabled(playlist), 'playlist is enabled');
Just becomes:
assert.ok(Playlist.isEnabled({ excludeUntil: Date.now() - 1 }), 'playlist is enabled');
This way you don't need to worry about deleting things and the order of the tests won't matter.
test/playlist.test.js
Outdated
// incompatible means that the playlist was blacklisted due to incompatible | ||
// configuration e.g. audio only stream when trying to playback audio and video. | ||
// incompaatibility is denoted by a blacklist of Infinity. | ||
const playlist = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to my comment below, you could just get rid of const playlist
and pass the raw values into the method under test.
Description
Currently it doesn't really matter whether a representation is disabled through user interaction via the representations api, or blacklisted internally because of network or playback errors. This can cause undefined references in our playlist selector (#1206 #1267) when whatever playlists have not been manually disabled are all blacklisted internally due to errors.
Specific Changes proposed