forked from Furumi/furumi-web
Report a failed podcast search without ending the music search
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
678c7b8211
commit
2ea3f7b337
7 files changed
+119
-31
No files matched your search
@@ -1216,11 +1216,30 @@ test('the federated search shows podcast cards next to music, ordered by rank',
|
||||
|
||||
source.emit('search.completed', {entity: {partial: false, podcast_discovery: 'running'}});
|
||||
assert.equal(library.federationSearch.loading, false);
|
||||
assert.equal(library.federationSearch.podcastDiscovery, 'running');
|
||||
assert.equal(source.closed, true);
|
||||
// Events of a closed search change nothing.
|
||||
library.startFederationSearch('other');
|
||||
source.emit('federation.podcast', {entity: foundEntity()});
|
||||
assert.deepEqual(Array.from(library.federationSearch.podcasts), []);
|
||||
assert.equal(library.federationSearch.podcastDiscovery, '');
|
||||
|
||||
// A failed podcast search is reported, not shown as "nothing found";
|
||||
// the music results stay.
|
||||
const failing = sources[1];
|
||||
failing.emit('federation.track', {type: 'music', kind: 'federation.track', entity: {key: {content_id: 'b3:2'}, metadata: {title: 'Other'}}});
|
||||
failing.emit('search.completed', {entity: {partial: false, podcast_discovery: 'failed'}});
|
||||
assert.equal(library.federationSearch.podcastDiscovery, 'failed');
|
||||
assert.equal(library.federationSearch.tracks.length, 1);
|
||||
assert.equal(library.federationSearch.error, '');
|
||||
// Unknown states and malformed data are ignored.
|
||||
library.startFederationSearch('third');
|
||||
sources[2].emit('search.completed', {entity: {podcast_discovery: '<b>x</b>'}});
|
||||
assert.equal(library.federationSearch.podcastDiscovery, '');
|
||||
library.startFederationSearch('fourth');
|
||||
sources[3].listeners['search.completed']({data: 'not json'});
|
||||
assert.equal(library.federationSearch.loading, false);
|
||||
assert.equal(library.federationSearch.podcastDiscovery, '');
|
||||
});
|
||||
|
||||
test('a found podcast is previewed, then subscribed with the card id and origin URL', async () => {
|
||||
|
||||
Reference in new issue
Block a user