diff --git a/src/Jackett/Content/animate.css b/src/Jackett.Common/Content/animate.css similarity index 100% rename from src/Jackett/Content/animate.css rename to src/Jackett.Common/Content/animate.css diff --git a/src/Jackett/Content/apple-touch-icon-114x114.png b/src/Jackett.Common/Content/apple-touch-icon-114x114.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon-114x114.png rename to src/Jackett.Common/Content/apple-touch-icon-114x114.png diff --git a/src/Jackett/Content/apple-touch-icon-120x120.png b/src/Jackett.Common/Content/apple-touch-icon-120x120.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon-120x120.png rename to src/Jackett.Common/Content/apple-touch-icon-120x120.png diff --git a/src/Jackett/Content/apple-touch-icon-144x144.png b/src/Jackett.Common/Content/apple-touch-icon-144x144.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon-144x144.png rename to src/Jackett.Common/Content/apple-touch-icon-144x144.png diff --git a/src/Jackett/Content/apple-touch-icon-152x152.png b/src/Jackett.Common/Content/apple-touch-icon-152x152.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon-152x152.png rename to src/Jackett.Common/Content/apple-touch-icon-152x152.png diff --git a/src/Jackett/Content/apple-touch-icon-180x180.png b/src/Jackett.Common/Content/apple-touch-icon-180x180.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon-180x180.png rename to src/Jackett.Common/Content/apple-touch-icon-180x180.png diff --git a/src/Jackett/Content/apple-touch-icon-57x57.png b/src/Jackett.Common/Content/apple-touch-icon-57x57.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon-57x57.png rename to src/Jackett.Common/Content/apple-touch-icon-57x57.png diff --git a/src/Jackett/Content/apple-touch-icon-72x72.png b/src/Jackett.Common/Content/apple-touch-icon-72x72.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon-72x72.png rename to src/Jackett.Common/Content/apple-touch-icon-72x72.png diff --git a/src/Jackett/Content/apple-touch-icon-76x76.png b/src/Jackett.Common/Content/apple-touch-icon-76x76.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon-76x76.png rename to src/Jackett.Common/Content/apple-touch-icon-76x76.png diff --git a/src/Jackett/Content/apple-touch-icon.png b/src/Jackett.Common/Content/apple-touch-icon.png similarity index 100% rename from src/Jackett/Content/apple-touch-icon.png rename to src/Jackett.Common/Content/apple-touch-icon.png diff --git a/src/Jackett/Content/binding_dark.png b/src/Jackett.Common/Content/binding_dark.png similarity index 100% rename from src/Jackett/Content/binding_dark.png rename to src/Jackett.Common/Content/binding_dark.png diff --git a/src/Jackett/Content/bootstrap/bootstrap.min.css b/src/Jackett.Common/Content/bootstrap/bootstrap.min.css similarity index 100% rename from src/Jackett/Content/bootstrap/bootstrap.min.css rename to src/Jackett.Common/Content/bootstrap/bootstrap.min.css diff --git a/src/Jackett/Content/bootstrap/bootstrap.min.js b/src/Jackett.Common/Content/bootstrap/bootstrap.min.js similarity index 100% rename from src/Jackett/Content/bootstrap/bootstrap.min.js rename to src/Jackett.Common/Content/bootstrap/bootstrap.min.js diff --git a/src/Jackett/Content/common.js b/src/Jackett.Common/Content/common.js similarity index 100% rename from src/Jackett/Content/common.js rename to src/Jackett.Common/Content/common.js diff --git a/src/Jackett/Content/congruent_outline.png b/src/Jackett.Common/Content/congruent_outline.png similarity index 100% rename from src/Jackett/Content/congruent_outline.png rename to src/Jackett.Common/Content/congruent_outline.png diff --git a/src/Jackett/Content/crissXcross.png b/src/Jackett.Common/Content/crissXcross.png similarity index 100% rename from src/Jackett/Content/crissXcross.png rename to src/Jackett.Common/Content/crissXcross.png diff --git a/src/Jackett/Content/css/bootstrap-multiselect.css b/src/Jackett.Common/Content/css/bootstrap-multiselect.css similarity index 100% rename from src/Jackett/Content/css/bootstrap-multiselect.css rename to src/Jackett.Common/Content/css/bootstrap-multiselect.css diff --git a/src/Jackett/Content/css/font-awesome.min.css b/src/Jackett.Common/Content/css/font-awesome.min.css similarity index 100% rename from src/Jackett/Content/css/font-awesome.min.css rename to src/Jackett.Common/Content/css/font-awesome.min.css diff --git a/src/Jackett/Content/css/jquery.dataTables.min.css b/src/Jackett.Common/Content/css/jquery.dataTables.min.css similarity index 100% rename from src/Jackett/Content/css/jquery.dataTables.min.css rename to src/Jackett.Common/Content/css/jquery.dataTables.min.css diff --git a/src/Jackett/Content/custom.css b/src/Jackett.Common/Content/custom.css similarity index 93% rename from src/Jackett/Content/custom.css rename to src/Jackett.Common/Content/custom.css index dc82febcc..8c97a6dc6 100644 --- a/src/Jackett/Content/custom.css +++ b/src/Jackett.Common/Content/custom.css @@ -1,275 +1,275 @@ -body { - background-image: url("binding_dark.png"); - background-repeat: repeat; -} - -#page { - border-radius: 6px; - background-color: white; - max-width: 900px; - margin: 0 auto; - margin-top: 30px; - padding: 20px; - margin-bottom: 100px; -} - -.container-fluid { -} - -#templates { - display: none; -} - -#indexers { - text-align: center; - margin-top: 30px; -} - -.indexer-table { - text-align: left; -} - -.test-success { - color: #449d44; -} - -.test-error { - color: #c9302c; -} - -.test-inprogress { - color: #286090; -} - -.indexer-buttons { - text-align: center; -} - -.indexer-buttons > .btn { - margin-bottom: 2px; -} - -.indexer-button-test { - width: 60px; -} - -.setup-item-inputstring { - max-width: 255px; -} - -.setup-item-inputbool input { - max-width: 100px; - height: 20px; -} - -.setup-item-inputselect { - max-width: 255px; -} - -[data-type=hiddendata]{ - display: none; -} - -.spinner { - -webkit-animation: spin 2s infinite linear; - -moz-animation: spin 2s infinite linear; - -o-animation: spin 2s infinite linear; - animation: spin 2s infinite linear; -} - -@-moz-keyframes spin { - from { - -moz-transform: rotate(0deg); - } - - to { - -moz-transform: rotate(360deg); - } -} - -@-webkit-keyframes spin { - from { - -webkit-transform: rotate(0deg); - } - - to { - -webkit-transform: rotate(360deg); - } -} - -@keyframes spin { - from { - transform: rotate(0deg); - } - - to { - transform: rotate(360deg); - } -} - -#setup-indexer-go { - width: 70px; -} - -hr { - border-top-color: #cdcdcd; -} - -.input-area { - margin: 4px 0px; -} - - .input-area > * { - vertical-align: middle; - } - - .input-area > p { - margin-top: 10px; - } - -.input-header { - font-size: 18px; - width: 160px; - display: inline-block; -} - -.input-right { - width: 300px; - display: inline-block; - font-family: monospace; -} - -#sonarr-warning { - display: none; -} - -#logo { - max-width: 50px; -} - -#header-title { - font-size: 34px; - vertical-align: middle; - padding-left: 15px; -} - -#footer { - color: #444444; - margin: 0 auto; - margin-top: 10px; - text-align: center; -} - -#jackett-allowext, #jackett-allowupdate, #jackett-logging, #jackett-prerelease { - width: 25px; -} - -.modal-fillwidth { - width: 1200px; - min-width:80%; -} - -.indexer-caps { - padding: 0px 15px 15px 15px; - border-top: 1px solid #e5e5e5; -} - -.indexer-caps table { - border-bottom: 1px solid #ddd; -} - -.jackettlogWarn { - background-color: #FFFF8E !important; -} - -.jackettlogError { - background-color: #FF6060 !important; -} - -.jackettdownloaded { - color: blueviolet; -} - -.jacketdownloadlocal { - padding-left: 10px; -} - -.downloadcolumn { - text-align:center; -} - -pre { - display: block; - padding: 3px; - margin: 0 0 0px; - font-size: 13px; - line-height: 1.42857143; - color: #333; - word-break: break-all; - word-wrap: break-word; - background-color: transparent; - border: 0px; - border-radius: 0px; -} - -.modal-open .modal { - overflow-x: auto; /* Model can be bigger than the screen on mobiles */ -} - -.dataTables_filter input { - width: 400px -} - -#unconfigured-indexers-template { - display: none; -} -.jackett-apikey{ - margin-top: 10px; -} - -.jackett-apikey .input-header{ - width: 80px; -} - -.setup-item-displayinfo:empty { - display: none; -} - -table td.fit{ - white-space: nowrap; - width: 1%; -} - -.label-imdb { - background-color: #d0ab44; -} - -.tooltip-inner { - max-width: 500px !important; -} - -.tooltip-inner img { - max-width: 250px; - height: auto; -} - -.type-public { - color: #449d44 -} - -.type-private { - color: #c9302c -} - -.type-semi-private { - color: #ec971f -} - -.dataTables_deadfilter { - float: right; - text-align: right; - margin-right: 1em; -} -input#searchquery{ - width:400px; -} +body { + background-image: url("binding_dark.png"); + background-repeat: repeat; +} + +#page { + border-radius: 6px; + background-color: white; + max-width: 900px; + margin: 0 auto; + margin-top: 30px; + padding: 20px; + margin-bottom: 100px; +} + +.container-fluid { +} + +#templates { + display: none; +} + +#indexers { + text-align: center; + margin-top: 30px; +} + +.indexer-table { + text-align: left; +} + +.test-success { + color: #449d44; +} + +.test-error { + color: #c9302c; +} + +.test-inprogress { + color: #286090; +} + +.indexer-buttons { + text-align: center; +} + +.indexer-buttons > .btn { + margin-bottom: 2px; +} + +.indexer-button-test { + width: 60px; +} + +.setup-item-inputstring { + max-width: 255px; +} + +.setup-item-inputbool input { + max-width: 100px; + height: 20px; +} + +.setup-item-inputselect { + max-width: 255px; +} + +[data-type=hiddendata]{ + display: none; +} + +.spinner { + -webkit-animation: spin 2s infinite linear; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} + +@-moz-keyframes spin { + from { + -moz-transform: rotate(0deg); + } + + to { + -moz-transform: rotate(360deg); + } +} + +@-webkit-keyframes spin { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +@keyframes spin { + from { + transform: rotate(0deg); + } + + to { + transform: rotate(360deg); + } +} + +#setup-indexer-go { + width: 70px; +} + +hr { + border-top-color: #cdcdcd; +} + +.input-area { + margin: 4px 0px; +} + + .input-area > * { + vertical-align: middle; + } + + .input-area > p { + margin-top: 10px; + } + +.input-header { + font-size: 18px; + width: 160px; + display: inline-block; +} + +.input-right { + width: 300px; + display: inline-block; + font-family: monospace; +} + +#sonarr-warning { + display: none; +} + +#logo { + max-width: 50px; +} + +#header-title { + font-size: 34px; + vertical-align: middle; + padding-left: 15px; +} + +#footer { + color: #444444; + margin: 0 auto; + margin-top: 10px; + text-align: center; +} + +#jackett-allowext, #jackett-allowupdate, #jackett-logging, #jackett-prerelease { + width: 25px; +} + +.modal-fillwidth { + width: 1200px; + min-width:80%; +} + +.indexer-caps { + padding: 0px 15px 15px 15px; + border-top: 1px solid #e5e5e5; +} + +.indexer-caps table { + border-bottom: 1px solid #ddd; +} + +.jackettlogWarn { + background-color: #FFFF8E !important; +} + +.jackettlogError { + background-color: #FF6060 !important; +} + +.jackettdownloaded { + color: blueviolet; +} + +.jacketdownloadlocal { + padding-left: 10px; +} + +.downloadcolumn { + text-align:center; +} + +pre { + display: block; + padding: 3px; + margin: 0 0 0px; + font-size: 13px; + line-height: 1.42857143; + color: #333; + word-break: break-all; + word-wrap: break-word; + background-color: transparent; + border: 0px; + border-radius: 0px; +} + +.modal-open .modal { + overflow-x: auto; /* Model can be bigger than the screen on mobiles */ +} + +.dataTables_filter input { + width: 400px +} + +#unconfigured-indexers-template { + display: none; +} +.jackett-apikey{ + margin-top: 10px; +} + +.jackett-apikey .input-header{ + width: 80px; +} + +.setup-item-displayinfo:empty { + display: none; +} + +table td.fit{ + white-space: nowrap; + width: 1%; +} + +.label-imdb { + background-color: #d0ab44; +} + +.tooltip-inner { + max-width: 500px !important; +} + +.tooltip-inner img { + max-width: 250px; + height: auto; +} + +.type-public { + color: #449d44 +} + +.type-private { + color: #c9302c +} + +.type-semi-private { + color: #ec971f +} + +.dataTables_deadfilter { + float: right; + text-align: right; + margin-right: 1em; +} +input#searchquery{ + width:400px; +} diff --git a/src/Jackett/Content/custom.js b/src/Jackett.Common/Content/custom.js similarity index 100% rename from src/Jackett/Content/custom.js rename to src/Jackett.Common/Content/custom.js diff --git a/src/Jackett/Content/custom_mobile.css b/src/Jackett.Common/Content/custom_mobile.css similarity index 100% rename from src/Jackett/Content/custom_mobile.css rename to src/Jackett.Common/Content/custom_mobile.css diff --git a/src/Jackett/Content/favicon.ico b/src/Jackett.Common/Content/favicon.ico similarity index 100% rename from src/Jackett/Content/favicon.ico rename to src/Jackett.Common/Content/favicon.ico diff --git a/src/Jackett/Content/fonts/FontAwesome.otf b/src/Jackett.Common/Content/fonts/FontAwesome.otf similarity index 100% rename from src/Jackett/Content/fonts/FontAwesome.otf rename to src/Jackett.Common/Content/fonts/FontAwesome.otf diff --git a/src/Jackett/Content/fonts/fontawesome-webfont.eot b/src/Jackett.Common/Content/fonts/fontawesome-webfont.eot similarity index 100% rename from src/Jackett/Content/fonts/fontawesome-webfont.eot rename to src/Jackett.Common/Content/fonts/fontawesome-webfont.eot diff --git a/src/Jackett/Content/fonts/fontawesome-webfont.svg b/src/Jackett.Common/Content/fonts/fontawesome-webfont.svg similarity index 100% rename from src/Jackett/Content/fonts/fontawesome-webfont.svg rename to src/Jackett.Common/Content/fonts/fontawesome-webfont.svg diff --git a/src/Jackett/Content/fonts/fontawesome-webfont.ttf b/src/Jackett.Common/Content/fonts/fontawesome-webfont.ttf similarity index 100% rename from src/Jackett/Content/fonts/fontawesome-webfont.ttf rename to src/Jackett.Common/Content/fonts/fontawesome-webfont.ttf diff --git a/src/Jackett/Content/fonts/fontawesome-webfont.woff b/src/Jackett.Common/Content/fonts/fontawesome-webfont.woff similarity index 100% rename from src/Jackett/Content/fonts/fontawesome-webfont.woff rename to src/Jackett.Common/Content/fonts/fontawesome-webfont.woff diff --git a/src/Jackett/Content/fonts/fontawesome-webfont.woff2 b/src/Jackett.Common/Content/fonts/fontawesome-webfont.woff2 similarity index 100% rename from src/Jackett/Content/fonts/fontawesome-webfont.woff2 rename to src/Jackett.Common/Content/fonts/fontawesome-webfont.woff2 diff --git a/src/Jackett/Content/fonts/glyphicons-halflings-regular.eot b/src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from src/Jackett/Content/fonts/glyphicons-halflings-regular.eot rename to src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.eot diff --git a/src/Jackett/Content/fonts/glyphicons-halflings-regular.svg b/src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from src/Jackett/Content/fonts/glyphicons-halflings-regular.svg rename to src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.svg diff --git a/src/Jackett/Content/fonts/glyphicons-halflings-regular.ttf b/src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from src/Jackett/Content/fonts/glyphicons-halflings-regular.ttf rename to src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.ttf diff --git a/src/Jackett/Content/fonts/glyphicons-halflings-regular.woff b/src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from src/Jackett/Content/fonts/glyphicons-halflings-regular.woff rename to src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.woff diff --git a/src/Jackett/Content/fonts/glyphicons-halflings-regular.woff2 b/src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from src/Jackett/Content/fonts/glyphicons-halflings-regular.woff2 rename to src/Jackett.Common/Content/fonts/glyphicons-halflings-regular.woff2 diff --git a/src/Jackett/Content/images/sort_asc.png b/src/Jackett.Common/Content/images/sort_asc.png similarity index 100% rename from src/Jackett/Content/images/sort_asc.png rename to src/Jackett.Common/Content/images/sort_asc.png diff --git a/src/Jackett/Content/images/sort_asc_disabled.png b/src/Jackett.Common/Content/images/sort_asc_disabled.png similarity index 100% rename from src/Jackett/Content/images/sort_asc_disabled.png rename to src/Jackett.Common/Content/images/sort_asc_disabled.png diff --git a/src/Jackett/Content/images/sort_both.png b/src/Jackett.Common/Content/images/sort_both.png similarity index 100% rename from src/Jackett/Content/images/sort_both.png rename to src/Jackett.Common/Content/images/sort_both.png diff --git a/src/Jackett/Content/images/sort_desc.png b/src/Jackett.Common/Content/images/sort_desc.png similarity index 100% rename from src/Jackett/Content/images/sort_desc.png rename to src/Jackett.Common/Content/images/sort_desc.png diff --git a/src/Jackett/Content/images/sort_desc_disabled.png b/src/Jackett.Common/Content/images/sort_desc_disabled.png similarity index 100% rename from src/Jackett/Content/images/sort_desc_disabled.png rename to src/Jackett.Common/Content/images/sort_desc_disabled.png diff --git a/src/Jackett/Content/index.html b/src/Jackett.Common/Content/index.html similarity index 100% rename from src/Jackett/Content/index.html rename to src/Jackett.Common/Content/index.html diff --git a/src/Jackett/Content/jacket_medium.png b/src/Jackett.Common/Content/jacket_medium.png similarity index 100% rename from src/Jackett/Content/jacket_medium.png rename to src/Jackett.Common/Content/jacket_medium.png diff --git a/src/Jackett/Content/libs/api.js b/src/Jackett.Common/Content/libs/api.js similarity index 100% rename from src/Jackett/Content/libs/api.js rename to src/Jackett.Common/Content/libs/api.js diff --git a/src/Jackett/Content/libs/bootstrap-multiselect.js b/src/Jackett.Common/Content/libs/bootstrap-multiselect.js similarity index 100% rename from src/Jackett/Content/libs/bootstrap-multiselect.js rename to src/Jackett.Common/Content/libs/bootstrap-multiselect.js diff --git a/src/Jackett/Content/libs/bootstrap-notify.js b/src/Jackett.Common/Content/libs/bootstrap-notify.js similarity index 100% rename from src/Jackett/Content/libs/bootstrap-notify.js rename to src/Jackett.Common/Content/libs/bootstrap-notify.js diff --git a/src/Jackett/Content/libs/filesize.min.js b/src/Jackett.Common/Content/libs/filesize.min.js similarity index 99% rename from src/Jackett/Content/libs/filesize.min.js rename to src/Jackett.Common/Content/libs/filesize.min.js index bc4cbe92e..fc752eaf1 100644 --- a/src/Jackett/Content/libs/filesize.min.js +++ b/src/Jackett.Common/Content/libs/filesize.min.js @@ -1,6 +1,6 @@ -/* - 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); +/* + 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 diff --git a/src/Jackett/Content/libs/handlebars.min.js b/src/Jackett.Common/Content/libs/handlebars.min.js similarity index 100% rename from src/Jackett/Content/libs/handlebars.min.js rename to src/Jackett.Common/Content/libs/handlebars.min.js diff --git a/src/Jackett/Content/libs/handlebarsextend.js b/src/Jackett.Common/Content/libs/handlebarsextend.js similarity index 100% rename from src/Jackett/Content/libs/handlebarsextend.js rename to src/Jackett.Common/Content/libs/handlebarsextend.js diff --git a/src/Jackett/Content/libs/handlebarsmoment.js b/src/Jackett.Common/Content/libs/handlebarsmoment.js similarity index 96% rename from src/Jackett/Content/libs/handlebarsmoment.js rename to src/Jackett.Common/Content/libs/handlebarsmoment.js index 158822eab..1f8aa1932 100644 --- a/src/Jackett/Content/libs/handlebarsmoment.js +++ b/src/Jackett.Common/Content/libs/handlebarsmoment.js @@ -1,37 +1,37 @@ - -Handlebars.registerHelper('dateFormat', function (context, block) { - if (window.moment) { - var f = block.hash.format || "MMM DD, YYYY hh:mm:ss A"; - return moment(context).format(f); //had to remove Date(context) - } else { - return context; // moment plugin not available. return data as is. - }; -}); - -Handlebars.registerHelper('jacketTimespan', function (context, block) { - var now = moment(); - var from = moment(context); - var timeSpan = moment.duration(now.diff(from)); - - var minutes = timeSpan.asMinutes(); - if (minutes < 120) { - return Math.round(minutes) + 'm ago'; - } - - var hours = timeSpan.asHours(); - if (hours < 48) { - return Math.round(hours) + 'h ago'; - } - - var days = timeSpan.asDays(); - if (days < 365) { - return Math.round(days) + 'd ago'; - } - - var years = timeSpan.asYears(); - return Math.round(years) + 'y ago'; -}); - -Handlebars.registerHelper('jacketSize', function (context, block) { - return filesize(context, { round: 1 }); + +Handlebars.registerHelper('dateFormat', function (context, block) { + if (window.moment) { + var f = block.hash.format || "MMM DD, YYYY hh:mm:ss A"; + return moment(context).format(f); //had to remove Date(context) + } else { + return context; // moment plugin not available. return data as is. + }; +}); + +Handlebars.registerHelper('jacketTimespan', function (context, block) { + var now = moment(); + var from = moment(context); + var timeSpan = moment.duration(now.diff(from)); + + var minutes = timeSpan.asMinutes(); + if (minutes < 120) { + return Math.round(minutes) + 'm ago'; + } + + var hours = timeSpan.asHours(); + if (hours < 48) { + return Math.round(hours) + 'h ago'; + } + + var days = timeSpan.asDays(); + if (days < 365) { + return Math.round(days) + 'd ago'; + } + + 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 diff --git a/src/Jackett/Content/libs/jquery.dataTables.min.js b/src/Jackett.Common/Content/libs/jquery.dataTables.min.js similarity index 100% rename from src/Jackett/Content/libs/jquery.dataTables.min.js rename to src/Jackett.Common/Content/libs/jquery.dataTables.min.js diff --git a/src/Jackett/Content/libs/jquery.min.js b/src/Jackett.Common/Content/libs/jquery.min.js similarity index 100% rename from src/Jackett/Content/libs/jquery.min.js rename to src/Jackett.Common/Content/libs/jquery.min.js diff --git a/src/Jackett/Content/libs/moment.min.js b/src/Jackett.Common/Content/libs/moment.min.js similarity index 100% rename from src/Jackett/Content/libs/moment.min.js rename to src/Jackett.Common/Content/libs/moment.min.js diff --git a/src/Jackett/Content/login.html b/src/Jackett.Common/Content/login.html similarity index 100% rename from src/Jackett/Content/login.html rename to src/Jackett.Common/Content/login.html diff --git a/src/Jackett/Engine.cs b/src/Jackett.Common/Engine.cs similarity index 89% rename from src/Jackett/Engine.cs rename to src/Jackett.Common/Engine.cs index 63e794613..e35cb3925 100644 --- a/src/Jackett/Engine.cs +++ b/src/Jackett.Common/Engine.cs @@ -10,44 +10,35 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Web.Http.Dependencies; -using Autofac.Integration.WebApi; using Jackett.Services.Interfaces; using Jacket.Common; using Jackett.Models.Config; +using System.Reflection; namespace Jackett { public class Engine { private static IContainer container = null; - - static Engine() - { - BuildContainer(); - - } - - public static void BuildContainer() + + public static void BuildContainer(params Autofac.Module[] ApplicationSpecificModules) { var builder = new ContainerBuilder(); builder.RegisterModule(); + foreach(var module in ApplicationSpecificModules) + { + builder.RegisterModule(module); + } + SetupLogging(builder); container = builder.Build(); - - // Register the container in itself to allow for late resolves - var secondaryBuilder = new ContainerBuilder(); - secondaryBuilder.RegisterInstance(container).SingleInstance(); - SetupLogging(secondaryBuilder); - secondaryBuilder.Update(container); - } - public static IDependencyResolver DependencyResolver() + public static IContainer GetContainer() { - return new AutofacWebApiDependencyResolver(container); + return container; } - + public static IConfigurationService ConfigService { get diff --git a/src/Jackett/CookieContainerExtensions.cs b/src/Jackett.Common/Helpers/CookieContainerExtensions.cs similarity index 100% rename from src/Jackett/CookieContainerExtensions.cs rename to src/Jackett.Common/Helpers/CookieContainerExtensions.cs diff --git a/src/Jackett/HttpClientExtensions.cs b/src/Jackett.Common/Helpers/HttpClientExtensions.cs similarity index 100% rename from src/Jackett/HttpClientExtensions.cs rename to src/Jackett.Common/Helpers/HttpClientExtensions.cs diff --git a/src/Jackett.Common/Jackett.Common.csproj b/src/Jackett.Common/Jackett.Common.csproj index 2787c0dee..9669a5c9e 100644 --- a/src/Jackett.Common/Jackett.Common.csproj +++ b/src/Jackett.Common/Jackett.Common.csproj @@ -6,11 +6,115 @@ + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + @@ -39,9 +143,41 @@ True True + + True + True + Resources.resx + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + TextTemplatingFileGenerator TorznabCatType.generated.cs @@ -71,6 +207,13 @@ 2.0.0 + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + diff --git a/src/Jackett/JackettProtectedAttribute.cs b/src/Jackett.Common/JackettProtectedAttribute.cs similarity index 100% rename from src/Jackett/JackettProtectedAttribute.cs rename to src/Jackett.Common/JackettProtectedAttribute.cs diff --git a/src/Jackett/JackettModule.cs b/src/Jackett.Common/Plumbing/JackettModule.cs similarity index 95% rename from src/Jackett/JackettModule.cs rename to src/Jackett.Common/Plumbing/JackettModule.cs index 882e85cad..82940082a 100644 --- a/src/Jackett/JackettModule.cs +++ b/src/Jackett.Common/Plumbing/JackettModule.cs @@ -2,7 +2,6 @@ using System; using System.Linq; using System.Text; -using Autofac.Integration.WebApi; using Jackett.Indexers; using Jackett.Utils.Clients; using AutoMapper; @@ -16,6 +15,7 @@ using Jackett.Models.Config; using System.IO; using Newtonsoft.Json.Linq; using Jackett.Utils; +using System.Collections.Generic; namespace Jackett { @@ -24,10 +24,7 @@ namespace Jackett protected override void Load(ContainerBuilder builder) { // Just register everything! TODO: Something better and more explicit than scanning everything. - var assembliesToScan = new Assembly[] { typeof(JackettModule).Assembly, typeof(JackettStartup).Assembly }; - foreach (var assembly in assembliesToScan) - { - builder.RegisterAssemblyTypes(assembly) + builder.RegisterAssemblyTypes(typeof(JackettModule).Assembly) .Except() .Except() .Except() @@ -43,8 +40,7 @@ namespace Jackett .Except() .Except() .AsImplementedInterfaces().SingleInstance(); - } - builder.RegisterApiControllers(typeof(JackettModule).Assembly).InstancePerRequest(); + builder.Register(ctx => { return BuildServerConfig(ctx); diff --git a/src/Jackett.Common/Properties/Resources.Designer.cs b/src/Jackett.Common/Properties/Resources.Designer.cs new file mode 100644 index 000000000..9ac7be583 --- /dev/null +++ b/src/Jackett.Common/Properties/Resources.Designer.cs @@ -0,0 +1,101 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Jackett.Common.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Jackett.Common.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" ?> + ///<rss version="1.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:torznab="http://torznab.com/schemas/2015/feed"> + /// <channel> + /// <atom:link href="https://hdaccess.net/api" rel="self" type="application/rss+xml" /> + /// <title>HDAccess</title> + /// <description>HDAccess API</description> + /// <link>https://hdaccess.net</link> + /// <language>en-us</language> + /// <webMaster>($email) (HDA Invites)</webMaster> + /// <category>search</category> + /// <image> + /// <url>h [rest of string was truncated]";. + /// + public static string test { + get { + return ResourceManager.GetString("test", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" ?> + ///<rss version="1.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:torznab="http://torznab.com/schemas/2015/feed"> + /// <channel> + /// <item> + /// <link>https://example.com</link> + /// <pubDate>Sat, 14 Mar 2015 17:10:42 -0400</pubDate> + /// <enclosure url="https://example.com" length="1" type="application/x-bittorrent" /> + /// </item> + /// </channel> + ///</rss>. + /// + public static string validator_reply { + get { + return ResourceManager.GetString("validator_reply", resourceCulture); + } + } + } +} diff --git a/src/Jackett.Common/Properties/Resources.resx b/src/Jackett.Common/Properties/Resources.resx new file mode 100644 index 000000000..e74f51ff0 --- /dev/null +++ b/src/Jackett.Common/Properties/Resources.resx @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\test.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + + ..\Resources\validator_reply.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + \ No newline at end of file diff --git a/src/Jackett/Resources/test.xml b/src/Jackett.Common/Resources/test.xml similarity index 100% rename from src/Jackett/Resources/test.xml rename to src/Jackett.Common/Resources/test.xml diff --git a/src/Jackett/Resources/validator_reply.xml b/src/Jackett.Common/Resources/validator_reply.xml similarity index 100% rename from src/Jackett/Resources/validator_reply.xml rename to src/Jackett.Common/Resources/validator_reply.xml diff --git a/src/Jackett.Console/Program.cs b/src/Jackett.Console/Program.cs index a11a3ab98..d1f5aca3e 100644 --- a/src/Jackett.Console/Program.cs +++ b/src/Jackett.Console/Program.cs @@ -222,6 +222,7 @@ namespace JackettConsole JackettStartup.NoRestart = options.NoRestart; } + Engine.BuildContainer(new WebApi2Module()); Engine.Server.Initalize(); Engine.Server.Start(); Engine.RunTime.Spin(); diff --git a/src/Jackett.Service/Jackett.Service.csproj b/src/Jackett.Service/Jackett.Service.csproj index 4258d52a3..a22b7ddd6 100644 --- a/src/Jackett.Service/Jackett.Service.csproj +++ b/src/Jackett.Service/Jackett.Service.csproj @@ -66,7 +66,6 @@ - diff --git a/src/Jackett.Service/Service.cs b/src/Jackett.Service/Service.cs index d0a4bbce9..55bb83c6d 100644 --- a/src/Jackett.Service/Service.cs +++ b/src/Jackett.Service/Service.cs @@ -20,6 +20,7 @@ namespace Jackett.Service protected override void OnStart(string[] args) { Engine.Logger.Info("Service starting"); + Engine.BuildContainer(new WebApi2Module()); Engine.Server.Initalize(); Engine.Server.Start(); Engine.Logger.Info("Service started"); diff --git a/src/Jackett.Test/TestUtil.cs b/src/Jackett.Test/TestUtil.cs index f6f847e97..6281fa62b 100644 --- a/src/Jackett.Test/TestUtil.cs +++ b/src/Jackett.Test/TestUtil.cs @@ -22,15 +22,11 @@ namespace Jackett.Test { var builder = new ContainerBuilder(); builder.RegisterModule(); + builder.RegisterModule(); builder.RegisterType().As().SingleInstance(); builder.RegisterInstance(LogManager.GetCurrentClassLogger()).SingleInstance(); builder.RegisterType().As().SingleInstance(); testContainer = builder.Build(); - - // Register the container in itself to allow for late resolves - var secondaryBuilder = new ContainerBuilder(); - secondaryBuilder.RegisterInstance(testContainer).SingleInstance(); - secondaryBuilder.Update(testContainer); } public static TestIndexerManagerServiceHelper IndexManager diff --git a/src/Jackett.Tray/Main.cs b/src/Jackett.Tray/Main.cs index d04886595..b053a289d 100644 --- a/src/Jackett.Tray/Main.cs +++ b/src/Jackett.Tray/Main.cs @@ -28,12 +28,13 @@ namespace JackettTray toolStripMenuItemWebUI.Click += toolStripMenuItemWebUI_Click; toolStripMenuItemShutdown.Click += toolStripMenuItemShutdown_Click; -#if __MonoCS__ - // No shortcuts on linux -#else - toolStripMenuItemAutoStart.Visible = true; -#endif + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + toolStripMenuItemAutoStart.Visible = true; + } + + Engine.BuildContainer(new WebApi2Module()); Engine.Server.Initalize(); if (!Engine.ServiceConfig.ServiceExists()) @@ -104,16 +105,15 @@ namespace JackettTray private void CreateShortcut() { -#if __MonoCS__ - // No shortcuts on linux -#else - var appPath = Assembly.GetExecutingAssembly().Location; - var shell = new IWshRuntimeLibrary.WshShell(); - var shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(ShortcutPath); - shortcut.Description = Assembly.GetExecutingAssembly().GetName().Name; - shortcut.TargetPath = appPath; - shortcut.Save(); -#endif + if (Environment.OSVersion.Platform == PlatformID.Win32NT) + { + var appPath = Assembly.GetExecutingAssembly().Location; + var shell = new IWshRuntimeLibrary.WshShell(); + var shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(ShortcutPath); + shortcut.Description = Assembly.GetExecutingAssembly().GetName().Name; + shortcut.TargetPath = appPath; + shortcut.Save(); + } } private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) diff --git a/src/Jackett.Updater/Program.cs b/src/Jackett.Updater/Program.cs index cf107fdf6..2108685c7 100644 --- a/src/Jackett.Updater/Program.cs +++ b/src/Jackett.Updater/Program.cs @@ -10,12 +10,6 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using System.Web; -/* -// no supported by appveyor, disabeling for now -#if __MonoCS__ -using Mono.Unix.Native; -#endif -*/ namespace Jackett.Updater { @@ -68,13 +62,7 @@ namespace Jackett.Updater var exited = proc.WaitForExit(5000); if (!exited) Engine.Logger.Info("Process " + pid.ToString() + " didn't exit within 5 seconds"); -/* -// no supported by appveyor, disabeling for now -#if __MonoCS__ - Engine.Logger.Info("Sending SIGKILL to process " + pid.ToString()); - Syscall.kill(proc.Id, Signum.SIGKILL); -#endif -*/ + } catch (ArgumentException) { diff --git a/src/Jackett/Controllers/ServerConfigurationController.cs b/src/Jackett/Controllers/ServerConfigurationController.cs index 28d3f6b48..3d6bf0786 100644 --- a/src/Jackett/Controllers/ServerConfigurationController.cs +++ b/src/Jackett/Controllers/ServerConfigurationController.cs @@ -168,7 +168,7 @@ namespace Jackett.Controllers.V20 { Thread.Sleep(500); serverService.Stop(); - Engine.BuildContainer(); + Engine.BuildContainer(new WebApi2Module()); Engine.Server.Initalize(); Engine.Server.Start(); })).Start(); diff --git a/src/Jackett/Jackett.csproj b/src/Jackett/Jackett.csproj index ee3599fed..e459eb6c7 100644 --- a/src/Jackett/Jackett.csproj +++ b/src/Jackett/Jackett.csproj @@ -76,17 +76,13 @@ - - - - - True True Resources.resx + @@ -99,58 +95,12 @@ + Designer - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - - - PreserveNewest - - - PreserveNewest - @@ -158,96 +108,6 @@ Resources.Designer.cs - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - False @@ -269,8 +129,8 @@ - - 4.0.0 + + 4.1.0 5.2.3 diff --git a/src/Jackett/Properties/Resources.Designer.cs b/src/Jackett/Properties/Resources.Designer.cs index 080841b71..c348be735 100644 --- a/src/Jackett/Properties/Resources.Designer.cs +++ b/src/Jackett/Properties/Resources.Designer.cs @@ -59,43 +59,5 @@ namespace Jackett.Properties { resourceCulture = value; } } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" ?> - ///<rss version="1.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:torznab="http://torznab.com/schemas/2015/feed"> - /// <channel> - /// <atom:link href="https://hdaccess.net/api" rel="self" type="application/rss+xml" /> - /// <title>HDAccess</title> - /// <description>HDAccess API</description> - /// <link>https://hdaccess.net</link> - /// <language>en-us</language> - /// <webMaster>($email) (HDA Invites)</webMaster> - /// <category>search</category> - /// <image> - /// <url>h [rest of string was truncated]";. - /// - internal static string test { - get { - return ResourceManager.GetString("test", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" ?> - ///<rss version="1.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:torznab="http://torznab.com/schemas/2015/feed"> - /// <channel> - /// <item> - /// <link>https://example.com</link> - /// <pubDate>Sat, 14 Mar 2015 17:10:42 -0400</pubDate> - /// <enclosure url="https://example.com" length="1" type="application/x-bittorrent" /> - /// </item> - /// </channel> - ///</rss>. - /// - internal static string validator_reply { - get { - return ResourceManager.GetString("validator_reply", resourceCulture); - } - } } } diff --git a/src/Jackett/Properties/Resources.resx b/src/Jackett/Properties/Resources.resx index e74f51ff0..1af7de150 100644 --- a/src/Jackett/Properties/Resources.resx +++ b/src/Jackett/Properties/Resources.resx @@ -117,11 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\test.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - - - ..\Resources\validator_reply.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - \ No newline at end of file diff --git a/src/Jackett.Service/ServiceConfigService.cs b/src/Jackett/Services/ServiceConfigService.cs similarity index 100% rename from src/Jackett.Service/ServiceConfigService.cs rename to src/Jackett/Services/ServiceConfigService.cs diff --git a/src/Jackett/Startup.cs b/src/Jackett/Startup.cs index d136e6be5..095bad838 100644 --- a/src/Jackett/Startup.cs +++ b/src/Jackett/Startup.cs @@ -15,6 +15,7 @@ using System.Web.Http.Filters; using Newtonsoft.Json.Linq; using Jacket.Common; using System.Text; +using Autofac.Integration.WebApi; [assembly: OwinStartup(typeof(Startup))] namespace Jackett @@ -134,7 +135,9 @@ namespace Jackett if (JackettStartup.LogRequests) config.MessageHandlers.Add(new WebAPIRequestLogger()); - config.DependencyResolver = Engine.DependencyResolver(); + config.DependencyResolver = new AutofacWebApiDependencyResolver(Engine.GetContainer()); + + config.MapHttpAttributeRoutes(); // Sonarr appends /api by default to all Torznab indexers, so we need that "ignored" diff --git a/src/Jackett/WebApi2Module.cs b/src/Jackett/WebApi2Module.cs new file mode 100644 index 000000000..dddc6c033 --- /dev/null +++ b/src/Jackett/WebApi2Module.cs @@ -0,0 +1,19 @@ +using Autofac; +using Autofac.Integration.WebApi; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett +{ + public class WebApi2Module : Module + { + protected override void Load(ContainerBuilder builder) + { + builder.RegisterAssemblyTypes(typeof(WebApi2Module).Assembly).AsImplementedInterfaces().SingleInstance(); + builder.RegisterApiControllers(typeof(WebApi2Module).Assembly).InstancePerRequest(); + } + } +}