37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using System.Text.Json;
|
|
|
|
namespace file_finder__test.DataBaseModules
|
|
{
|
|
public class mediaUpdate
|
|
{
|
|
public int Uid { get; set; }
|
|
public string MovieName { get; set; }
|
|
|
|
DataBase tmp = new DataBase("http//:localhost//file_finder/mediaUpdate");
|
|
public string Json { get; private set; }
|
|
public mediaUpdate(int uid, string movieName)
|
|
{
|
|
Uid = uid;
|
|
MovieName = movieName;
|
|
|
|
// Serialize to JSON
|
|
Json = JsonSerializer.Serialize(new
|
|
{
|
|
uid = Uid,
|
|
movieName = MovieName
|
|
});
|
|
Console.WriteLine(Json);
|
|
using var db = new DataBase("https://yourserver.com/api");
|
|
string response = db.MovieWatchIncrement(Json).Result;
|
|
|
|
if(response.Contains("302"))
|
|
Console.WriteLine("db not found");
|
|
else
|
|
{
|
|
Console.WriteLine(response);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
} |