Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
Jackett
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
Jackett
Commits
43845c4b
Commit
43845c4b
authored
Nov 21, 2015
by
flightlevel
Browse files
Options
Downloads
Patches
Plain Diff
FreshOn: Add Tv Categories and Fix Time
-Add Tv Categories -Incorrect time was being returned
parent
7a026405
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Jackett/Indexers/Freshon.cs
+21
-11
21 additions, 11 deletions
src/Jackett/Indexers/Freshon.cs
with
21 additions
and
11 deletions
src/Jackett/Indexers/Freshon.cs
+
21
−
11
View file @
43845c4b
...
@@ -70,6 +70,13 @@ namespace Jackett.Indexers
...
@@ -70,6 +70,13 @@ namespace Jackett.Indexers
public
async
Task
<
IEnumerable
<
ReleaseInfo
>>
PerformQuery
(
TorznabQuery
query
)
public
async
Task
<
IEnumerable
<
ReleaseInfo
>>
PerformQuery
(
TorznabQuery
query
)
{
{
TimeZoneInfo
.
TransitionTime
startTransition
=
TimeZoneInfo
.
TransitionTime
.
CreateFloatingDateRule
(
new
DateTime
(
1
,
1
,
1
,
3
,
0
,
0
),
3
,
5
,
DayOfWeek
.
Sunday
);
TimeZoneInfo
.
TransitionTime
endTransition
=
TimeZoneInfo
.
TransitionTime
.
CreateFloatingDateRule
(
new
DateTime
(
1
,
1
,
1
,
4
,
0
,
0
),
10
,
5
,
DayOfWeek
.
Sunday
);
TimeSpan
delta
=
new
TimeSpan
(
1
,
0
,
0
);
TimeZoneInfo
.
AdjustmentRule
adjustment
=
TimeZoneInfo
.
AdjustmentRule
.
CreateAdjustmentRule
(
new
DateTime
(
1999
,
10
,
1
),
DateTime
.
MaxValue
.
Date
,
delta
,
startTransition
,
endTransition
);
TimeZoneInfo
.
AdjustmentRule
[]
adjustments
=
{
adjustment
};
TimeZoneInfo
romaniaTz
=
TimeZoneInfo
.
CreateCustomTimeZone
(
"Romania Time"
,
new
TimeSpan
(
2
,
0
,
0
),
"(GMT+02:00) Romania Time"
,
"Romania Time"
,
"Romania Daylight Time"
,
adjustments
);
var
releases
=
new
List
<
ReleaseInfo
>();
var
releases
=
new
List
<
ReleaseInfo
>();
string
episodeSearchUrl
;
string
episodeSearchUrl
;
...
@@ -77,7 +84,7 @@ namespace Jackett.Indexers
...
@@ -77,7 +84,7 @@ namespace Jackett.Indexers
episodeSearchUrl
=
SearchUrl
;
episodeSearchUrl
=
SearchUrl
;
else
else
{
{
episodeSearchUrl
=
string
.
Format
(
"{0}?search={1}&cat=0"
,
SearchUrl
,
HttpUtility
.
UrlEncode
(
query
.
GetQueryString
())
)
;
episodeSearchUrl
=
$"
{
SearchUrl
}
?search=
{
HttpUtility
.
UrlEncode
(
query
.
GetQueryString
())
}
&cat=0"
;
}
}
var
results
=
await
RequestStringWithCookiesAndRetry
(
episodeSearchUrl
);
var
results
=
await
RequestStringWithCookiesAndRetry
(
episodeSearchUrl
);
...
@@ -101,16 +108,7 @@ namespace Jackett.Indexers
...
@@ -101,16 +108,7 @@ namespace Jackett.Indexers
release
.
Guid
=
new
Uri
(
SiteLink
+
qLink
.
Attr
(
"href"
));
release
.
Guid
=
new
Uri
(
SiteLink
+
qLink
.
Attr
(
"href"
));
release
.
Comments
=
release
.
Guid
;
release
.
Comments
=
release
.
Guid
;
release
.
Link
=
new
Uri
(
SiteLink
+
qRow
.
Find
(
"td.table_links > a"
).
First
().
Attr
(
"href"
));
release
.
Link
=
new
Uri
(
SiteLink
+
qRow
.
Find
(
"td.table_links > a"
).
First
().
Attr
(
"href"
));
release
.
Category
=
TvCategoryParser
.
ParseTvShowQuality
(
release
.
Title
);
DateTime
pubDate
;
var
dateString
=
qRow
.
Find
(
"td.table_added"
).
Text
().
Trim
();
if
(
dateString
.
StartsWith
(
"Today "
))
pubDate
=
(
DateTime
.
UtcNow
+
TimeSpan
.
Parse
(
dateString
.
Split
(
' '
)[
1
])).
ToLocalTime
();
else
if
(
dateString
.
StartsWith
(
"Yesterday "
))
pubDate
=
(
DateTime
.
UtcNow
+
TimeSpan
.
Parse
(
dateString
.
Split
(
' '
)[
1
])
-
TimeSpan
.
FromDays
(
1
)).
ToLocalTime
();
else
pubDate
=
DateTime
.
ParseExact
(
dateString
,
"d-MMM-yyyy HH:mm:ss"
,
CultureInfo
.
InvariantCulture
,
DateTimeStyles
.
AssumeUniversal
).
ToLocalTime
();
release
.
PublishDate
=
pubDate
;
release
.
Seeders
=
ParseUtil
.
CoerceInt
(
qRow
.
Find
(
"td.table_seeders"
).
Text
().
Trim
());
release
.
Seeders
=
ParseUtil
.
CoerceInt
(
qRow
.
Find
(
"td.table_seeders"
).
Text
().
Trim
());
release
.
Peers
=
ParseUtil
.
CoerceInt
(
qRow
.
Find
(
"td.table_leechers"
).
Text
().
Trim
())
+
release
.
Seeders
;
release
.
Peers
=
ParseUtil
.
CoerceInt
(
qRow
.
Find
(
"td.table_leechers"
).
Text
().
Trim
())
+
release
.
Seeders
;
...
@@ -118,6 +116,18 @@ namespace Jackett.Indexers
...
@@ -118,6 +116,18 @@ namespace Jackett.Indexers
var
sizeStr
=
qRow
.
Find
(
"td.table_size"
)[
0
].
Cq
().
Text
();
var
sizeStr
=
qRow
.
Find
(
"td.table_size"
)[
0
].
Cq
().
Text
();
release
.
Size
=
ReleaseInfo
.
GetBytes
(
sizeStr
);
release
.
Size
=
ReleaseInfo
.
GetBytes
(
sizeStr
);
DateTime
pubDateRomania
;
var
dateString
=
qRow
.
Find
(
"td.table_added"
).
Text
().
Trim
();
if
(
dateString
.
StartsWith
(
"Today "
))
{
pubDateRomania
=
DateTime
.
SpecifyKind
(
DateTime
.
UtcNow
.
Date
,
DateTimeKind
.
Unspecified
)
+
TimeSpan
.
Parse
(
dateString
.
Split
(
' '
)[
1
]);
}
else
if
(
dateString
.
StartsWith
(
"Yesterday "
))
{
pubDateRomania
=
DateTime
.
SpecifyKind
(
DateTime
.
UtcNow
.
Date
,
DateTimeKind
.
Unspecified
)
+
TimeSpan
.
Parse
(
dateString
.
Split
(
' '
)[
1
])
-
TimeSpan
.
FromDays
(
1
);
}
else
{
pubDateRomania
=
DateTime
.
SpecifyKind
(
DateTime
.
ParseExact
(
dateString
,
"d-MMM-yyyy HH:mm:ss"
,
CultureInfo
.
InvariantCulture
),
DateTimeKind
.
Unspecified
);
}
DateTime
pubDateUtc
=
TimeZoneInfo
.
ConvertTimeToUtc
(
pubDateRomania
,
romaniaTz
);
release
.
PublishDate
=
pubDateUtc
.
ToLocalTime
();
releases
.
Add
(
release
);
releases
.
Add
(
release
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment