Private GIT

Skip to content
Snippets Groups Projects
Commit e8bb1680 authored by KZ's avatar KZ
Browse files

#181 Fix links are not cleaned before being sent to the webui. Fix failed...

#181 Fix links are not cleaned before being sent to the webui.  Fix failed requests not being forwarded to the caller.  Add size display to web ui.
parent f45c58b2
Branches
No related tags found
No related merge requests found
......@@ -349,6 +349,18 @@ function bindUIButtons() {
"visible": true,
"searchable": false,
"iDataSort": 1
},
{
"targets": 6,
"visible": false,
"searchable": false,
"type": 'num'
},
{
"targets": 7,
"visible": true,
"searchable": false,
"iDataSort": 6
}
],
initComplete: function () {
......@@ -466,6 +478,18 @@ function bindUIButtons() {
"searchable": false,
"iDataSort": 0
},
{
"targets": 4,
"visible": false,
"searchable": false,
"type": 'num'
},
{
"targets": 5,
"visible": true,
"searchable": false,
"iDataSort": 4
}
],
initComplete: function () {
var count = 0;
......
......@@ -4,6 +4,7 @@
<head>
<meta charset="utf-8" />
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' />
<script src="/libs/filesize.min.js"></script>
<script src="/libs/jquery.min.js"></script>
<script src="/libs/jquery.dataTables.min.js"></script>
<script src="/libs/handlebars.min.js"></script>
......@@ -202,6 +203,8 @@
<th>First Seen</th>
<th>Tracker</th>
<th>Name</th>
<th>Size</th>
<th>Size</th>
<th>Category</th>
<th>Seeds</th>
<th>Leechers</th>
......@@ -217,6 +220,8 @@
<td>{{jacketTimespan FirstSeen}}</td>
<td>{{Tracker}}</td>
<td><a href="{{Comments}}">{{Title}}</a></td>
<td>{{Size}}</td>
<td>{{jacketSize Size}}</td>
<td>{{CategoryDesc}}</td>
<td>{{Seeders}}</td>
<td>{{Peers}}</td>
......@@ -296,6 +301,8 @@
<th>Published</th>
<th>Tracker</th>
<th>Name</th>
<th>Size</th>
<th>Size</th>
<th>Category</th>
<th>Seeds</th>
<th>Leechers</th>
......@@ -309,6 +316,8 @@
<td>{{jacketTimespan PublishDate}}</td>
<td>{{Tracker}}</td>
<td><a href="{{Comments}}">{{Title}}</a></td>
<td>{{Size}}</td>
<td>{{jacketSize Size}}</td>
<td>{{CategoryDesc}}</td>
<td>{{Seeders}}</td>
<td>{{Peers}}</td>
......
/*
2015 Jason Mulligan
@version 3.1.2
*/
"use strict"; !function (a) { var b = /b$/, c = { bits: ["B", "kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"], bytes: ["B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"] }, d = function (a) { var d = void 0 === arguments[1] ? {} : arguments[1], e = [], f = !1, g = 0, h = void 0, i = void 0, j = void 0, k = void 0, l = void 0, m = void 0, n = void 0, o = void 0, p = void 0, q = void 0, r = void 0; if (isNaN(a)) throw new Error("Invalid arguments"); return j = d.bits === !0, p = d.unix === !0, i = void 0 !== d.base ? d.base : 2, o = void 0 !== d.round ? d.round : p ? 1 : 2, q = void 0 !== d.spacer ? d.spacer : p ? "" : " ", r = void 0 !== d.suffixes ? d.suffixes : {}, n = void 0 !== d.output ? d.output : "string", h = void 0 !== d.exponent ? d.exponent : -1, m = Number(a), l = 0 > m, k = i > 2 ? 1e3 : 1024, l && (m = -m), 0 === m ? (e[0] = 0, e[1] = p ? "" : "B") : ((-1 === h || isNaN(h)) && (h = Math.floor(Math.log(m) / Math.log(k))), h > 8 && (g = 1e3 * g * (h - 8), h = 8), g = 2 === i ? m / Math.pow(2, 10 * h) : m / Math.pow(1e3, h), j && (g = 8 * g, g > k && (g /= k, h++)), e[0] = Number(g.toFixed(h > 0 ? o : 0)), e[1] = c[j ? "bits" : "bytes"][h], !f && p && (j && b.test(e[1]) && (e[1] = e[1].toLowerCase()), e[1] = e[1].charAt(0), "B" === e[1] ? (e[0] = Math.floor(e[0]), e[1] = "") : j || "k" !== e[1] || (e[1] = "K"))), l && (e[0] = -e[0]), e[1] = r[e[1]] || e[1], "array" === n ? e : "exponent" === n ? h : "object" === n ? { value: e[0], suffix: e[1] } : e.join(q) }; "undefined" != typeof exports ? module.exports = d : "function" == typeof define ? define(function () { return d }) : a.filesize = d }("undefined" != typeof global ? global : window);
//# sourceMappingURL=filesize.min.js.map
\ No newline at end of file
......@@ -31,3 +31,7 @@ Handlebars.registerHelper('jacketTimespan', function (context, block) {
var years = timeSpan.asYears();
return Math.round(years) + 'y ago';
});
Handlebars.registerHelper('jacketSize', function (context, block) {
return filesize(context, { round: 1 });
});
\ No newline at end of file
......@@ -468,6 +468,7 @@ namespace Jackett.Controllers
try
{
var searchResults = indexer.PerformQuery(query).Result;
searchResults = indexer.CleanLinks(searchResults);
cacheService.CacheRssResults(indexer, searchResults);
searchResults = indexer.FilterResults(query, searchResults);
......
......@@ -83,6 +83,11 @@ namespace Jackett.Indexers
public Uri UncleanLink(Uri link)
{
if (link.ToString().StartsWith(downloadUrlBase))
{
return link;
}
return new Uri(downloadUrlBase + link.ToString(), UriKind.RelativeOrAbsolute);
}
......@@ -223,6 +228,11 @@ namespace Jackett.Indexers
public async virtual Task<byte[]> Download(Uri link)
{
var response = await RequestBytesWithCookiesAndRetry(link.ToString());
if(response.Status != System.Net.HttpStatusCode.OK && response.Status != System.Net.HttpStatusCode.Continue && response.Status != System.Net.HttpStatusCode.PartialContent)
{
throw new Exception($"Remote server returned {response.Status.ToString()}");
}
return response.Content;
}
......
......@@ -368,6 +368,7 @@
<Content Include="Content\custom.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\libs\filesize.min.js" />
<Content Include="Content\fonts\fontawesome-webfont.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment