mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-11-15 07:57:40 +01:00
Fail upload if metadata stripping fails
This commit is contained in:
@@ -79,21 +79,21 @@ public class LocalDiskFileStore : StreamFileStore, IFileStore
|
||||
}
|
||||
else
|
||||
{
|
||||
// move orig file back
|
||||
File.Move(srcPath, finalPath);
|
||||
File.Delete(srcPath);
|
||||
throw new Exception("Failed to strip metadata, please try again");
|
||||
}
|
||||
}
|
||||
|
||||
if (payload.Segment == payload.TotalSegments)
|
||||
{
|
||||
var t = await vf.Metadata!.MakeTorrent(
|
||||
new FileStream(finalPath, FileMode.Open),
|
||||
_settings.SiteUrl,
|
||||
new FileStream(finalPath, FileMode.Open),
|
||||
_settings.SiteUrl,
|
||||
_settings.TorrentTrackers);
|
||||
|
||||
var ub = new UriBuilder(_settings.SiteUrl);
|
||||
ub.Path = $"/d/{vf.Id.ToBase58()}.torrent";
|
||||
|
||||
|
||||
vf.Metadata!.MagnetLink = $"{t.GetMagnetLink()}&xs={Uri.EscapeDataString(ub.ToString())}";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user