mirror of
https://github.com/zoriya/flood.git
synced 2026-08-15 18:53:27 +00:00
client: add "Reannounce" action
This commit is contained in:
@@ -8,6 +8,7 @@ import UIStore from '@client/stores/UIStore';
|
||||
import type {
|
||||
AddTorrentByFileOptions,
|
||||
AddTorrentByURLOptions,
|
||||
ReannounceTorrentsOptions,
|
||||
SetTorrentsTagsOptions,
|
||||
} from '@shared/schema/api/torrents';
|
||||
import type {
|
||||
@@ -194,6 +195,19 @@ const TorrentActions = {
|
||||
},
|
||||
),
|
||||
|
||||
reannounce: (options: ReannounceTorrentsOptions) =>
|
||||
axios
|
||||
.post(`${baseURI}api/torrents/reannounce`, options)
|
||||
.then((json) => json.data)
|
||||
.then(
|
||||
() => {
|
||||
// do nothing.
|
||||
},
|
||||
() => {
|
||||
// do nothing.
|
||||
},
|
||||
),
|
||||
|
||||
startTorrents: async (options: StartTorrentsOptions): Promise<void> => {
|
||||
if (options.hashes.length > 0) {
|
||||
return axios
|
||||
|
||||
@@ -74,6 +74,16 @@ const getContextMenuItems = (torrent: TorrentProperties): Array<ContextMenuItem>
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'action',
|
||||
action: 'reannounce',
|
||||
label: TorrentContextMenuActions.reannounce,
|
||||
clickHandler: () => {
|
||||
TorrentActions.reannounce({
|
||||
hashes: TorrentStore.selectedTorrents as [string, ...string[]],
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ const TorrentContextMenuActions = {
|
||||
stop: 'torrents.list.context.stop',
|
||||
remove: 'torrents.list.context.remove',
|
||||
checkHash: 'torrents.list.context.check.hash',
|
||||
reannounce: 'torrents.list.context.reannounce',
|
||||
setTaxonomy: 'torrents.list.context.set.tags',
|
||||
move: 'torrents.list.context.move',
|
||||
setTrackers: 'torrents.list.context.set.trackers',
|
||||
|
||||
@@ -324,6 +324,7 @@
|
||||
"torrents.list.context.move": "Set Torrent Location",
|
||||
"torrents.list.context.pause": "Pause",
|
||||
"torrents.list.context.priority": "Priority",
|
||||
"torrents.list.context.reannounce": "Reannounce",
|
||||
"torrents.list.context.remove": "Remove",
|
||||
"torrents.list.context.sequential": "Sequential",
|
||||
"torrents.list.context.set.tags": "Set Tags",
|
||||
|
||||
@@ -53,6 +53,7 @@ const defaultFloodSettings: Readonly<FloodSettings> = {
|
||||
{id: 'stop', visible: true},
|
||||
{id: 'remove', visible: true},
|
||||
{id: 'checkHash', visible: true},
|
||||
{id: 'reannounce', visible: false},
|
||||
{id: 'setTaxonomy', visible: true},
|
||||
{id: 'move', visible: true},
|
||||
{id: 'setTrackers', visible: false},
|
||||
|
||||
Reference in New Issue
Block a user