Implement new fsm

This commit is contained in:
Ben Sarmiento
2024-05-21 01:59:53 +02:00
parent d5dd9426ed
commit 2c5e7a1db0
14 changed files with 121 additions and 59 deletions

View File

@@ -27,7 +27,7 @@ func CheckFile(directory, torrentName, fileName string, w http.ResponseWriter, r
}
file, ok := torrent.SelectedFiles.Get(fileName)
if !ok || file.IsDeleted {
if !ok || !file.State.Is("ok") {
log.Warnf("Cannot find file %s from path %s", fileName, req.URL.Path)
http.Error(w, "File not found", http.StatusNotFound)
return