feat(search): queue pasted share links from Live Search and mobile search

Implement share-link detection in search (track, queue, album, artist,
composer): enqueue tracks/queues without interrupting playback; preview
album/artist/composer without switching the active server; queue preview
modal with scrollable track list. Based on community PR #551.

Co-authored-by: Daniel Wagner <daniel.iuser@icloud.com>
This commit is contained in:
Maxim Isaev
2026-05-15 13:38:35 +03:00
parent 02fd828049
commit e7431b94b8
30 changed files with 2323 additions and 16 deletions
+26 -1
View File
@@ -10,7 +10,14 @@
* Network-bound endpoints (`getAlbum`, `search`, etc.) require axios
* mocking and are not in this PR.
*/
import { buildCoverArtUrl, buildDownloadUrl, buildStreamUrl, coverArtCacheKey } from './subsonicStreamUrl';
import {
buildCoverArtUrl,
buildCoverArtUrlForServer,
buildDownloadUrl,
buildStreamUrl,
coverArtCacheKey,
coverArtCacheKeyForServer,
} from './subsonicStreamUrl';
import { beforeEach, describe, expect, it } from 'vitest';
import { parseSubsonicEntityStarRating } from './subsonicRatings';
import { getClient, libraryFilterParams } from './subsonicClient';
@@ -173,6 +180,24 @@ describe('buildCoverArtUrl', () => {
});
});
describe('buildCoverArtUrlForServer', () => {
it('builds getCoverArt URL with explicit server credentials', () => {
const url = new URL(buildCoverArtUrlForServer('https://remote.example', 'bob', 'secret', 'art-9', 40));
expect(url.origin).toBe('https://remote.example');
expect(url.pathname).toBe('/rest/getCoverArt.view');
expect(url.searchParams.get('id')).toBe('art-9');
expect(url.searchParams.get('size')).toBe('40');
expect(url.searchParams.get('u')).toBe('bob');
expect(url.searchParams.get('t')).toBeTruthy();
});
});
describe('coverArtCacheKeyForServer', () => {
it('scopes cache keys by server id', () => {
expect(coverArtCacheKeyForServer('srv-b', 'cover-1', 80)).toBe('srv-b:cover:cover-1:80');
});
});
describe('buildDownloadUrl', () => {
it('returns a /rest/download.view URL with id + auth params', () => {
setUpServer({ url: 'https://music.example.com' });