feat(downloads): add dedicated Torrent category

This commit is contained in:
NimBold
2026-08-10 14:20:50 +03:30
parent 23991c3dea
commit 472da5a681
22 changed files with 150 additions and 25 deletions
+17
View File
@@ -1607,6 +1607,23 @@ describe('useDownloadStore', () => {
expect(ipc.invokeCommand).not.toHaveBeenCalledWith('enqueue_download', expect.anything());
});
it('normalizes new Torrent rows before resolving their default destination', async () => {
await useDownloadStore.getState().addDownload({
id: 'torrent-default',
url: 'magnet:?xt=urn:btih:default',
fileName: 'metadata',
category: 'Other',
dateAdded: '',
isTorrent: true
}, { type: 'add-to-queue', queueId: 'queue-torrents' });
expect(useDownloadStore.getState().downloads[0]).toMatchObject({
category: 'Torrents',
destination: '/Users/test/Downloads/Torrents',
status: 'staged'
});
});
it('inserts a newly staged queue item before paused rows', async () => {
useDownloadStore.setState({
downloads: [{