BencodeNET icon indicating copy to clipboard operation
BencodeNET copied to clipboard

Feature/existing data validation

Open djon2003 opened this issue 5 years ago • 4 comments

Add possiblity to validate existing files contained in the torrent file

djon2003 avatar Dec 10 '20 19:12 djon2003

I will publish a new version this week. There was a little bug and I add support for partial validation.

djon2003 avatar Dec 15 '20 18:12 djon2003

Sorry for taking so long to get back to you. I've been looking a bit deeper into this and I don't feel it's a right fit for this library at this point, but I'll leave it open for now if anyone else should show their support for something like this.

For now one could just use the code you created and add an extension method to use it, like this:

public static async virtual Task<bool> ValidateExistingDataAsync(this Torrent torrent, string path, 
	ValidationOptions options = null)
{
    var validator = new Validator(torrent, options);
    return await validator.ValidateExistingDataAsync(path);
}

Krusen avatar Jan 23 '21 16:01 Krusen

Hi!

May I know why you think it is not a good fit at the moment?

Best regards, Jonathan

Le 23 janv. 2021 à 11:08, Søren Kruse <[email protected]mailto:[email protected]> a écrit :

Sorry for taking so long to get back to you. I've been looking a bit deeper into this and I don't feel it's a right fit for this library at this point, but I'll leave it open for now if anyone else should show their support for something like this.

For now one could just use the code you created and add an extension method to use it, like this:

public static async virtual Task ValidateExistingDataAsync(this Torrent torrent, string path, ValidationOptions options = null) { var validator = new Validator(torrent, options); return await validator.ValidateExistingDataAsync(path); }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Krusen/BencodeNET/pull/51#issuecomment-766110882, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEAHCA2T6QFIKDOXNRXA6LDS3LYALANCNFSM4UVQUQTA.

djon2003 avatar Jan 24 '21 15:01 djon2003

I'm a bit nitpicky regarding my library and code in general. The focus of this library was always meant to be encoding/decoding bencode. Torrent-handling was added on later as a quick convenience, but never meant to be the main focus.

As I said it's still possible to simply use your code as an extension method or similar. Also feel free to fork this repo and use the code directly in your project.

Krusen avatar Jan 30 '21 08:01 Krusen