mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-05 17:08:26 +00:00
fix(downloads): harden add modal and retry state
Route explicit no-limit speed overrides without inheriting the global cap. Preserve dotted media titles when switching formats and drain retry gid completions through remember_gid.
This commit is contained in:
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
canSubmitMetadataRows,
|
||||
mediaFormatSelectorForRow,
|
||||
mediaFileNameForSelectedFormat,
|
||||
metadataSummaryMessage,
|
||||
reconcileDownloadRows,
|
||||
refreshFailedMetadataRows,
|
||||
@@ -154,6 +155,36 @@ describe('add download metadata workflow', () => {
|
||||
expect(mediaFormatSelectorForRow(failedMedia)).toBeUndefined();
|
||||
});
|
||||
|
||||
it('replaces only known media container suffixes when selecting formats', () => {
|
||||
const mediaRow = row({
|
||||
isMedia: true,
|
||||
formats: [
|
||||
{
|
||||
name: '1080p MP4',
|
||||
selector: 'mp4',
|
||||
ext: 'mp4',
|
||||
formatLabel: '1080p',
|
||||
detail: '10 MB',
|
||||
type: 'Video',
|
||||
bytes: 10
|
||||
},
|
||||
{
|
||||
name: '1080p MKV',
|
||||
selector: 'mkv',
|
||||
ext: 'mkv',
|
||||
formatLabel: '1080p',
|
||||
detail: '11 MB',
|
||||
type: 'Video',
|
||||
bytes: 11
|
||||
}
|
||||
],
|
||||
selectedFormat: 1
|
||||
});
|
||||
|
||||
expect(mediaFileNameForSelectedFormat('Version 1.5', mediaRow)).toBe('Version 1.5.mkv');
|
||||
expect(mediaFileNameForSelectedFormat('Version 1.5.mp4', mediaRow)).toBe('Version 1.5.mkv');
|
||||
});
|
||||
|
||||
it('reports fallback and invalid states accurately', () => {
|
||||
expect(metadataSummaryMessage([
|
||||
row(),
|
||||
|
||||
Reference in New Issue
Block a user