chore: compare by label if both height and bytes are the same

This commit is contained in:
WebStreamr 2025-05-16 15:31:54 +00:00
parent 269a05499d
commit e13ab0c70f
No known key found for this signature in database
2 changed files with 10 additions and 5 deletions

View file

@ -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',
},
},
{

View file

@ -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`);