mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-05 15:47:20 +02:00
Fixed: Releases from PTP showing skewed publish date
PTP returns UTC timestamps, without a timezone specifier. Previously, users would see skewed publish dates, as the UTC timestamps were being parsed as if they were in the system's timezone. To fix this, we just assume the publish date is in UTC.
This commit is contained in:
parent
affedd7f9d
commit
d91578aee3
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
@ -55,7 +56,7 @@ public void should_parse_feed_from_PTP(string fileName)
|
|||||||
first.DownloadUrl.Should().Be("https://passthepopcorn.me/torrents.php?action=download&id=452135&authkey=00000000000000000000000000000000&torrent_pass=00000000000000000000000000000000");
|
first.DownloadUrl.Should().Be("https://passthepopcorn.me/torrents.php?action=download&id=452135&authkey=00000000000000000000000000000000&torrent_pass=00000000000000000000000000000000");
|
||||||
first.InfoUrl.Should().Be("https://passthepopcorn.me/torrents.php?id=148131&torrentid=452135");
|
first.InfoUrl.Should().Be("https://passthepopcorn.me/torrents.php?id=148131&torrentid=452135");
|
||||||
|
|
||||||
// first.PublishDate.Should().Be(DateTime.Parse("2017-04-17T12:13:42+0000").ToUniversalTime()); stupid timezones
|
first.PublishDate.Should().Be(DateTime.Parse("2016-10-18T23:40:59+0000").ToUniversalTime());
|
||||||
first.Size.Should().Be(2466170624L);
|
first.Size.Should().Be(2466170624L);
|
||||||
first.InfoHash.Should().BeNullOrEmpty();
|
first.InfoHash.Should().BeNullOrEmpty();
|
||||||
first.MagnetUrl.Should().BeNullOrEmpty();
|
first.MagnetUrl.Should().BeNullOrEmpty();
|
||||||
|
@ -97,7 +97,7 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
|||||||
InfoUrl = GetInfoUrl(result.GroupId, id),
|
InfoUrl = GetInfoUrl(result.GroupId, id),
|
||||||
Seeders = int.Parse(torrent.Seeders),
|
Seeders = int.Parse(torrent.Seeders),
|
||||||
Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders),
|
Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders),
|
||||||
PublishDate = torrent.UploadTime.ToUniversalTime(),
|
PublishDate = TimeZoneInfo.ConvertTimeToUtc(torrent.UploadTime, TimeZoneInfo.Utc), // PTP returns UTC timestamps, without a timezone specifier.
|
||||||
Golden = torrent.GoldenPopcorn,
|
Golden = torrent.GoldenPopcorn,
|
||||||
Scene = torrent.Scene,
|
Scene = torrent.Scene,
|
||||||
Approved = torrent.Checked,
|
Approved = torrent.Checked,
|
||||||
|
Loading…
Reference in New Issue
Block a user