mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 10:45:27 +00:00
Add rehashStreams method to API and update SettingsPage to trigger stream rehash
This commit is contained in:
parent
34a3f75c1c
commit
3a60526fbd
2 changed files with 14 additions and 2 deletions
|
|
@ -1463,4 +1463,16 @@ export default class API {
|
|||
errorNotification('Failed to delete user', e);
|
||||
}
|
||||
}
|
||||
|
||||
static async rehashStreams() {
|
||||
try {
|
||||
const response = await request(`${host}/api/core/rehash-streams/`, {
|
||||
method: 'POST',
|
||||
});
|
||||
|
||||
return response;
|
||||
} catch (e) {
|
||||
errorNotification('Failed to trigger stream rehash', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -250,9 +250,9 @@ const SettingsPage = () => {
|
|||
const onRehashStreams = async () => {
|
||||
setRehashingStreams(true);
|
||||
setRehashSuccess(false);
|
||||
|
||||
|
||||
try {
|
||||
await API.post('/core/rehash-streams/');
|
||||
await API.rehashStreams();
|
||||
setRehashSuccess(true);
|
||||
setTimeout(() => setRehashSuccess(false), 5000); // Clear success message after 5 seconds
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue