chore: compare by label if both height and bytes are the same
This commit is contained in:
parent
269a05499d
commit
e13ab0c70f
2 changed files with 10 additions and 5 deletions
|
|
@ -66,17 +66,17 @@ describe('resolve', () => {
|
|||
{
|
||||
url: expect.any(String),
|
||||
name: 'WebStreamr 720p',
|
||||
title: 'SuperVideo | 💾 1.1 GB | 🇮🇹',
|
||||
title: 'Dropload | 💾 1.1 GB | 🇮🇹',
|
||||
behaviourHints: {
|
||||
bingeGroup: 'webstreamr-supervideo_it',
|
||||
bingeGroup: 'webstreamr-dropload_it',
|
||||
},
|
||||
},
|
||||
{
|
||||
url: expect.any(String),
|
||||
name: 'WebStreamr 720p',
|
||||
title: 'Dropload | 💾 1.1 GB | 🇮🇹',
|
||||
title: 'SuperVideo | 💾 1.1 GB | 🇮🇹',
|
||||
behaviourHints: {
|
||||
bingeGroup: 'webstreamr-dropload_it',
|
||||
bingeGroup: 'webstreamr-supervideo_it',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,7 +52,12 @@ export class StreamResolver {
|
|||
return heightComparison;
|
||||
}
|
||||
|
||||
return b.bytes - a.bytes;
|
||||
const bytesComparison = b.bytes - a.bytes;
|
||||
if (bytesComparison !== 0) {
|
||||
return bytesComparison;
|
||||
}
|
||||
|
||||
return a.label.localeCompare(b.label);
|
||||
});
|
||||
|
||||
this.logger.info(`Return ${urlResults.length} streams`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue