-
Notifications
You must be signed in to change notification settings - Fork 13
torrent.DateAdded Property #15
Comments
Can you provide sample program that demonstrate the issue? |
Yes, On the Server side of my application I create an object to send through to my client when accessing (I realize I could probabaly just send alonog the clients data, but I do some byte conversions, and create some booleans to make things simple for the web side of the application. Please excuse the Exraction bit, I'm using SharpCompress to extract zips, and rar files into Emby's auto organize folders). I hold information for JSON Serialization to the front end web application in an object which looks like this like this: public class ActiveTorrent
{
public string title { get; set; }
public string percentage { get; set; }
public string state { get; set; }
public string id { get; set; }
public string ETA { get; set; }
public bool extraction { get; set; }
public string type { get; set; }
public string ExtractionPercentage { get; set; }
public string downloadSpeed { get; set; }
public bool isNew { get; set; }
} I then run this function to return the ActiveTorrent Object when the javascript in the web application makes a request to the backend code. public static async Task<List<ActiveTorrent>> GetActiveTorrents()
{
try
{
var client = GetClient();
//Program.ConsoleReadout("Create Active Torrent List...");
var torrentList = await client.GetListAsync();
var activeTorrents = new List<ActiveTorrent>();
foreach (var torrent in torrentList.Result.Torrents)
{
var T = new ActiveTorrent
{
title = torrent.Name,
percentage = torrent.Progress.ToString(CultureInfo.InvariantCulture),
state = torrent.Status.ToString(),
id = torrent.Hash,
ETA = torrent.Eta.ToString(CultureInfo.InvariantCulture),
extraction = FolderMonitor.IsExtracting(torrent.Name).Extracting,
ExtractionPercentage = Math.Round(FolderMonitor.IsExtracting(torrent.Name).Percentage, MidpointRounding.ToEven).ToString(),
downloadSpeed = ByteSizeConverter.SizeSuffix(torrent.DownloadSpeed),
isNew = torrent.AddedDate > DateTime.Now.AddDays(-3) ? true : false //Right Here :)
};
activeTorrents.Add(T);
}
return activeTorrents;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
return null;
} It returns a boolean for The 'torrent.DateAdded' will always return Janurary 1 0001. :) Please let me know if I can explain anything further. Great Library by the way! Thank you |
I tested with version 3.5.5 and the property Can you provide the json corresponding to Also which environment do you have ? (version/language/...) |
oh, that might be an issue. You see I use uTorrent 2.2.1 for a specific reason. That version is white-listed for me to use. I'm not sure about going into much more detail on that here. ;) The JSON readout is as follows: `{"build":25249,"label": [ ["3DE04A5C7A4A32282252D723BA5B1D14D6AD4636",201,"##########################",4126091910,1000,4126091910,5402394624,1309,0,0,-1,"",0,0,0,0,65536,-1,0],…` Would you need more than that? This is a clip of the response, but I think the web browser is truncating the whole response. (only slightly incriminating...) LOL! using C# libraries in visual studio 2017. I kept it a .netFramework Application. I didn't move to core yet for this project. |
The date field seem not part of the json. So they are nothing I can do for you. |
Okay! I will handle the date added as part of my own API. I appreciate you looking at it. Thank you :) |
Hi there. I've been using this great library for quite a while.
I was about to add some extra functionality into my web service application when I realized that the 'torrent.DateAdded' property is only returning a DateTime of 'Date = {1/1/0001 12:00:00 AM}'
The beginning of time! :)
The text was updated successfully, but these errors were encountered: