Repair works now
This commit is contained in:
@@ -5,16 +5,12 @@ import (
|
||||
)
|
||||
|
||||
func NewTorrentState(initial string) *fsm.FSM {
|
||||
// ok_torrent 1
|
||||
// broken_torrent 1
|
||||
// unplayable_torrent 1
|
||||
return fsm.NewFSM(
|
||||
initial,
|
||||
fsm.Events{
|
||||
{Name: "break_torrent", Src: []string{"ok_torrent", "unplayable_torrent"}, Dst: "broken_torrent"},
|
||||
{Name: "break_torrent", Src: []string{"ok_torrent"}, Dst: "broken_torrent"},
|
||||
{Name: "repair_torrent", Src: []string{"broken_torrent"}, Dst: "under_repair_torrent"},
|
||||
{Name: "mark_as_repaired", Src: []string{"broken_torrent", "under_repair_torrent"}, Dst: "ok_torrent"},
|
||||
{Name: "mark_as_unplayable_torrent", Src: []string{"ok_torrent"}, Dst: "unplayable_torrent"},
|
||||
},
|
||||
fsm.Callbacks{},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user