-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd7b6b9
commit d83e64f
Showing
4 changed files
with
47 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
using System.IO; | ||
using System.Text; | ||
using System; | ||
using System.Net.Http; | ||
|
||
namespace SubDBSharp.Models | ||
{ | ||
public class Request | ||
{ | ||
public string MovieHash { get; set; } | ||
public string Content { get; set; } | ||
|
||
public Request(string movieFile, string subtitleFile) | ||
public Request(Uri endpoint, HttpMethod method, HttpContent content) | ||
{ | ||
if (File.Exists(movieFile)) | ||
{ | ||
throw new FileNotFoundException(movieFile); | ||
} | ||
if (File.Exists(subtitleFile)) | ||
{ | ||
throw new FileNotFoundException(movieFile); | ||
} | ||
MovieHash = Utils.GetMovieHash(movieFile); | ||
Content = File.ReadAllText(subtitleFile, Encoding.UTF8); | ||
EndPoint = endpoint; | ||
Method = method; | ||
Body = content; | ||
} | ||
|
||
public Uri EndPoint { get; } | ||
public HttpMethod Method { get; } | ||
public HttpContent Body { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters