From d9142a73c32b7d49184ffe6966f1710588e3be8d Mon Sep 17 00:00:00 2001
From: PantsuDev
Date: Sun, 23 Jul 2017 15:46:29 +1000
Subject: [PATCH] Fix most go lint warnings
---
.eslintrc.json | 44 +-
.gitignore | 2 +-
.htmlhintrc | 25 +
.travis.yml | 2 +-
LICENSE.md | 1 -
apidoc.json | 2 +-
apidoc/api_data.js | 2076 +++++++------
apidoc/index.html | 883 +++---
apidoc/locales/ca.js | 46 +-
apidoc/locales/de.js | 46 +-
apidoc/locales/es.js | 46 +-
apidoc/locales/fr.js | 46 +-
apidoc/locales/it.js | 46 +-
apidoc/locales/locale.js | 84 +-
apidoc/locales/nl.js | 46 +-
apidoc/locales/pl.js | 46 +-
apidoc/locales/pt_br.js | 46 +-
apidoc/locales/ro.js | 46 +-
apidoc/locales/ru.js | 46 +-
apidoc/locales/tr.js | 46 +-
apidoc/locales/vi.js | 46 +-
apidoc/locales/zh.js | 46 +-
apidoc/locales/zh_cn.js | 46 +-
apidoc/main.js | 1557 +++++-----
config/config.go | 3 +
config/config_example.yml | 2 +-
controllers/api/_apidoc.js | 2 +-
controllers/feed/helpers.go | 2 +-
controllers/feed/torznab.go | 2 +-
controllers/middlewares/middlewares.go | 2 +-
controllers/moderator/helpers.go | 2 +-
controllers/moderator/reassign.go | 2 +-
controllers/settings/settings.go | 6 +-
header_api.md | 2 +-
translations/de-de.all.json | 2 +-
translations/en-us.all.json | 34 +-
translations/fr-fr.all.json | 6 +-
translations/it-it.all.json | 6 +-
translations/ja-jp.all.json | 3676 ++++++++++++------------
translations/nl-nl.all.json | 2 +-
translations/pt-br.all.json | 2748 +++++++++---------
translations/pt-pt.all.json | 1124 ++++----
translations/ro-ro.all.json | 1412 ++++-----
translations/th-th.all.json | 6 +-
utils/cache/cache.go | 1 +
utils/categories/categories.go | 4 +-
utils/cookies/user.go | 2 +-
utils/feeds/rss.go | 34 +-
utils/sanitize/markdown.go | 7 +-
utils/search/structs/cache.go | 1 +
utils/search/structs/structs.go | 23 +-
utils/signals/interrupt.go | 1 +
utils/signals/unix.go | 1 +
utils/validator/validator.go | 1 +
54 files changed, 7161 insertions(+), 7275 deletions(-)
create mode 100644 .htmlhintrc
diff --git a/.eslintrc.json b/.eslintrc.json
index c428aca9..e7a1b01b 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,24 +1,24 @@
{
- "env": {
- "browser": true,
- "commonjs": true,
- "es6": true,
- "node": true
+ "env": {
+ "browser": true,
+ "commonjs": true,
+ "es6": true,
+ "node": true
+ },
+ "parserOptions": {
+ "ecmaFeatures": {
+ "jsx": true
},
- "parserOptions": {
- "ecmaFeatures": {
- "jsx": true
- },
- "sourceType": "module"
- },
- "rules": {
- "no-const-assign": "warn",
- "no-this-before-super": "warn",
- "no-undef": "warn",
- "no-unreachable": "warn",
- "no-unused-vars": "warn",
- "constructor-super": "warn",
- "valid-typeof": "warn",
- "indent": ["error", 2]
- }
-}
\ No newline at end of file
+ "sourceType": "module"
+ },
+ "rules": {
+ "no-const-assign": "warn",
+ "no-this-before-super": "warn",
+ "no-undef": "warn",
+ "no-unreachable": "warn",
+ "no-unused-vars": "warn",
+ "constructor-super": "warn",
+ "valid-typeof": "warn",
+ "indent": ["error", 2]
+ }
+}
diff --git a/.gitignore b/.gitignore
index 34e59593..95ee4d63 100755
--- a/.gitignore
+++ b/.gitignore
@@ -19,4 +19,4 @@ config/config.yml
# emacs temp files
*\#*
-*~
\ No newline at end of file
+*~
diff --git a/.htmlhintrc b/.htmlhintrc
new file mode 100644
index 00000000..19796123
--- /dev/null
+++ b/.htmlhintrc
@@ -0,0 +1,25 @@
+{
+ "alt-require": true,
+ "attr-lowercase": true,
+ "attr-no-duplication": true,
+ "attr-unsafe-chars": true,
+ "attr-value-double-quotes": false,
+ "attr-value-not-empty": false,
+ "doctype-first": true,
+ "doctype-html5": true,
+ "head-script-disabled": true,
+ "href-abs-or-rel": false,
+ "id-class-ad-disabled": true,
+ "id-class-value": "dash",
+ "id-unique": true,
+ "inline-script-disabled": true,
+ "inline-style-disabled": true,
+ "space-tab-mixed-disabled": "space2",
+ "spec-char-escape": true,
+ "src-not-empty": true,
+ "style-disabled": true,
+ "tag-pair": true,
+ "tag-self-close": false,
+ "tagname-lowercase": true,
+ "title-require": true
+}
diff --git a/.travis.yml b/.travis.yml
index 52928323..4306c765 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,7 +21,7 @@ deploy:
provider: releases
api_key:
secure: Nz2M3ZbQumKGVga/nnZnz1VXikRkGoLXk5FoH4uOl6GF6rlUNmtvJYs34LWF0/CMswBXNhjCggEaMMtZC+j66ZjoAdHBXRfrOb6jisNJRF6FNk7Kob6W3itCEOTvEL/8a+k2fI95cLqOXDLR2tIX03nchb8rDmVALs7P4gQgy2Y7UAo/aa/0G+OhsSJrlQWt0MT9OKGoIXpeKZjOG3wO/YwqfDwRTItuA9DLFoMQ0gwQfgT58t1ullbpM+jISni7rwfK+jUnZHjUH/VHLguVFmL4A1DxWriJXNOrZR+i/eUJ94mWvfI08WR8Qh3UCr58FrKoWvPsu7HnCq0bn6RvQtCKqx5zgv+R+kxKIP+79SVjKZUi1ghswAuwx9+AT6vHgPLXjJLpZj9Ap/KhfnQR6VT3jBT+kEpmv3J+57JcJCyD4ZslT+LGW2ul0uWoGCVVMBdHqMzuC8OSxpKCw6bFNWnLq+JAU08zlJkAAllBKev+LZWiF8GBICKfynRgViy+MKNaMfzIUNlL9UDskaiWP+BL9RXGLJ2FVdeKkzqdAYdYlgdJChQ56KTtRukR7FlOqDXhszIPxJhU9wn9lNXmGvq1FJyo1LRY3HX+5o9lWw+enaswNxFxdLBMXPhF5jehMkImiR4/YS4WdlmHcEfsli9sBOjBQh1iIpCfme77PPU=
- script:
+ script:
- ./package.sh
file: dist/*.zip
skip_cleanup: true
diff --git a/LICENSE.md b/LICENSE.md
index c0831c37..62217aff 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -16,4 +16,3 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
diff --git a/apidoc.json b/apidoc.json
index d2e33dfe..f1912b95 100644
--- a/apidoc.json
+++ b/apidoc.json
@@ -21,4 +21,4 @@
"withCompare": true,
"withGenerator": true
}
-}
\ No newline at end of file
+}
diff --git a/apidoc/api_data.js b/apidoc/api_data.js
index abacba03..47ba70bc 100644
--- a/apidoc/api_data.js
+++ b/apidoc/api_data.js
@@ -1,1202 +1,1130 @@
-define({ "api": [
- {
- "type": "get",
- "url": "/search/",
- "title": "Search Torrents",
- "version": "1.1.1",
- "name": "FindTorrents",
- "group": "Torrents",
- "parameter": {
- "fields": {
- "Parameter": [
- {
- "group": "Parameter",
- "type": "String[]",
- "optional": false,
- "field": "c",
- "description": "In which categories to search.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "q",
- "description": "Query to search (torrent name).
"
- },
- {
- "group": "Parameter",
- "type": "Number",
- "optional": false,
- "field": "page",
- "description": "Page of the search results.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "limit",
- "description": "Number of results per page.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "userID",
- "description": "Uploader ID owning the torrents.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "fromID",
- "description": "Show results with torrents ID superior to this.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "s",
- "description": "Torrent status.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "maxage",
- "description": "Torrents which have been uploaded the last x days.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "toDate",
- "description": "Torrents which have been uploaded since x dateType
.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "fromDate",
- "description": "Torrents which have been uploaded the last x dateType
.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "dateType",
- "description": "Which type of date (d
for days, m
for months, y
for years).
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "minSize",
- "description": "Filter by minimal size in sizeType
.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "maxSize",
- "description": "Filter by maximal size in sizeType
.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "sizeType",
- "description": "Which type of size (b
for bytes, k
for kilobytes, m
for megabytes, g
for gigabytes).
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "sort",
- "description": "Torrent sorting type (0 = id, 1 = name, 2 = date, 3 = downloads, 4 = size, 5 = seeders, 6 = leechers, 7 = completed).
"
- },
- {
- "group": "Parameter",
- "type": "Boolean",
- "optional": false,
- "field": "order",
- "description": "Order ascending or descending (true = ascending).
"
- },
- {
- "group": "Parameter",
- "type": "String[]",
- "optional": false,
- "field": "lang",
- "description": "Filter the languages.
"
- }
- ]
- }
- },
- "success": {
- "fields": {
- "Success 200": [
- {
+define({
+ "api": [{
+ "type": "get",
+ "url": "/search/",
+ "title": "Search Torrents",
+ "version": "1.1.1",
+ "name": "FindTorrents",
+ "group": "Torrents",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
+ "group": "Parameter",
+ "type": "String[]",
+ "optional": false,
+ "field": "c",
+ "description": "In which categories to search.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "q",
+ "description": "Query to search (torrent name).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Number",
+ "optional": false,
+ "field": "page",
+ "description": "Page of the search results.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "limit",
+ "description": "Number of results per page.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "userID",
+ "description": "Uploader ID owning the torrents.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "fromID",
+ "description": "Show results with torrents ID superior to this.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "s",
+ "description": "Torrent status.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "maxage",
+ "description": "Torrents which have been uploaded the last x days.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "toDate",
+ "description": "Torrents which have been uploaded since x dateType
.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "fromDate",
+ "description": "Torrents which have been uploaded the last x dateType
.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "dateType",
+ "description": "Which type of date (d
for days, m
for months, y
for years).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "minSize",
+ "description": "Filter by minimal size in sizeType
.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "maxSize",
+ "description": "Filter by maximal size in sizeType
.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "sizeType",
+ "description": "Which type of size (b
for bytes, k
for kilobytes, m
for megabytes, g
for gigabytes).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "sort",
+ "description": "Torrent sorting type (0 = id, 1 = name, 2 = date, 3 = downloads, 4 = size, 5 = seeders, 6 = leechers, 7 = completed).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Boolean",
+ "optional": false,
+ "field": "order",
+ "description": "Order ascending or descending (true = ascending).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String[]",
+ "optional": false,
+ "field": "lang",
+ "description": "Filter the languages.
"
+ }
+ ]
+ }
+ },
+ "success": {
+ "fields": {
+ "Success 200": [{
"group": "Success 200",
"type": "Object[]",
"optional": false,
"field": "torrents",
"description": "List of torrent object (see view for the properties).
"
- }
- ]
- },
- "examples": [
- {
+ }]
+ },
+ "examples": [{
"title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/api.go",
- "groupTitle": "Torrents",
- "error": {
- "fields": {
- "Error 4xx": [
- {
+ }]
+ },
+ "filename": "controllers/api/api.go",
+ "groupTitle": "Torrents",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
"group": "Error 4xx",
"type": "String[]",
"optional": false,
"field": "errors",
"description": "List of errors messages with a 404 error message in it.
"
- }
- ]
- },
- "examples": [
- {
+ }]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json"
- }
- ]
- }
- },
- {
- "type": "get",
- "url": "/search/",
- "title": "Search Torrents",
- "version": "1.0.0",
- "name": "FindTorrents",
- "group": "Torrents",
- "parameter": {
- "fields": {
- "Parameter": [
- {
- "group": "Parameter",
- "type": "String[]",
- "optional": false,
- "field": "c",
- "description": "In which categories to search.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "q",
- "description": "Query to search (torrent name).
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "limit",
- "description": "Number of results per page.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "userID",
- "description": "Uploader ID owning the torrents.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "fromID",
- "description": "Show results with torrents ID superior to this.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "s",
- "description": "Torrent status.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "maxage",
- "description": "Torrents which have been uploaded the last x days.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "toDate",
- "description": "Torrents which have been uploaded since x dateType
.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "fromDate",
- "description": "Torrents which have been uploaded the last x dateType
.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "dateType",
- "description": "Which type of date (d
for days, m
for months, y
for years).
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "minSize",
- "description": "Filter by minimal size in sizeType
.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "maxSize",
- "description": "Filter by maximal size in sizeType
.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "sizeType",
- "description": "Which type of size (b
for bytes, k
for kilobytes, m
for megabytes, g
for gigabytes).
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "sort",
- "description": "Torrent sorting type (0 = id, 1 = name, 2 = date, 3 = downloads, 4 = size, 5 = seeders, 6 = leechers, 7 = completed).
"
- },
- {
- "group": "Parameter",
- "type": "Boolean",
- "optional": false,
- "field": "order",
- "description": "Order ascending or descending (true = ascending).
"
- },
- {
- "group": "Parameter",
- "type": "String[]",
- "optional": false,
- "field": "lang",
- "description": "Filter the languages.
"
- },
- {
- "group": "Parameter",
- "type": "Number",
- "optional": false,
- "field": "page",
- "description": "Search page.
"
- }
- ]
+ }]
}
},
- "success": {
- "fields": {
- "Success 200": [
- {
+ {
+ "type": "get",
+ "url": "/search/",
+ "title": "Search Torrents",
+ "version": "1.0.0",
+ "name": "FindTorrents",
+ "group": "Torrents",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
+ "group": "Parameter",
+ "type": "String[]",
+ "optional": false,
+ "field": "c",
+ "description": "In which categories to search.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "q",
+ "description": "Query to search (torrent name).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "limit",
+ "description": "Number of results per page.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "userID",
+ "description": "Uploader ID owning the torrents.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "fromID",
+ "description": "Show results with torrents ID superior to this.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "s",
+ "description": "Torrent status.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "maxage",
+ "description": "Torrents which have been uploaded the last x days.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "toDate",
+ "description": "Torrents which have been uploaded since x dateType
.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "fromDate",
+ "description": "Torrents which have been uploaded the last x dateType
.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "dateType",
+ "description": "Which type of date (d
for days, m
for months, y
for years).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "minSize",
+ "description": "Filter by minimal size in sizeType
.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "maxSize",
+ "description": "Filter by maximal size in sizeType
.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "sizeType",
+ "description": "Which type of size (b
for bytes, k
for kilobytes, m
for megabytes, g
for gigabytes).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "sort",
+ "description": "Torrent sorting type (0 = id, 1 = name, 2 = date, 3 = downloads, 4 = size, 5 = seeders, 6 = leechers, 7 = completed).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Boolean",
+ "optional": false,
+ "field": "order",
+ "description": "Order ascending or descending (true = ascending).
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String[]",
+ "optional": false,
+ "field": "lang",
+ "description": "Filter the languages.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Number",
+ "optional": false,
+ "field": "page",
+ "description": "Search page.
"
+ }
+ ]
+ }
+ },
+ "success": {
+ "fields": {
+ "Success 200": [{
"group": "Success 200",
"type": "Object[]",
"optional": false,
"field": "torrents",
"description": "List of torrent object (see view for the properties).
"
- }
- ]
- },
- "examples": [
- {
+ }]
+ },
+ "examples": [{
"title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n {\n\t\t\t[...]\n\t\t}",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/_apidoc.js",
- "groupTitle": "Torrents",
- "error": {
- "fields": {
- "Error 4xx": [
- {
+ }]
+ },
+ "filename": "controllers/api/_apidoc.js",
+ "groupTitle": "Torrents",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
"group": "Error 4xx",
"type": "String[]",
"optional": false,
"field": "errors",
"description": "List of errors messages with a 404 error message in it.
"
- }
- ]
- },
- "examples": [
- {
+ }]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json"
- }
- ]
- }
- },
- {
- "type": "get",
- "url": "/view/:id",
- "title": "Request Torrent information",
- "version": "1.1.1",
- "name": "GetTorrent",
- "group": "Torrents",
- "parameter": {
- "fields": {
- "Parameter": [
- {
+ }]
+ }
+ },
+ {
+ "type": "get",
+ "url": "/view/:id",
+ "title": "Request Torrent information",
+ "version": "1.1.1",
+ "name": "GetTorrent",
+ "group": "Torrents",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "id",
"description": "Torrent unique ID.
"
- }
- ]
- }
- },
- "success": {
- "fields": {
- "Success 200": [
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "id",
- "description": "ID of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "name",
- "description": "Name of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "status",
- "description": "Status of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "hash",
- "description": "Hash of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Date",
- "optional": false,
- "field": "date",
- "description": "Uploaded date of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "filesize",
- "description": "File size in Bytes of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "description",
- "description": "Description of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Object[]",
- "optional": false,
- "field": "comments",
- "description": "Comments of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "sub_category",
- "description": "Sub Category of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "category",
- "description": "Category of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "anidb_id",
- "description": "Anidb ID of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "uploader_id",
- "description": "ID of the torrent uploader.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "uploader_name",
- "description": "Username of the torrent uploader.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "uploader_old",
- "description": "Old username from nyaa of the torrent uploader.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "website_link",
- "description": "External Link of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String[]",
- "optional": false,
- "field": "languages",
- "description": "Languages of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "magnet",
- "description": "Magnet URI of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "String",
- "optional": false,
- "field": "torrent",
- "description": "Download URL of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "seeders",
- "description": "Number of seeders of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "leechers",
- "description": "Number of leechers of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "completed",
- "description": "Downloads completed of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Date",
- "optional": false,
- "field": "last_scrape",
- "description": "Last statistics update of the torrent.
"
- },
- {
- "group": "Success 200",
- "type": "Object[]",
- "optional": false,
- "field": "file_list",
- "description": "List of files in the torrent.
"
- }
- ]
+ }]
+ }
},
- "examples": [
- {
+ "success": {
+ "fields": {
+ "Success 200": [{
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "id",
+ "description": "ID of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "name",
+ "description": "Name of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "status",
+ "description": "Status of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "hash",
+ "description": "Hash of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Date",
+ "optional": false,
+ "field": "date",
+ "description": "Uploaded date of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "filesize",
+ "description": "File size in Bytes of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "description",
+ "description": "Description of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Object[]",
+ "optional": false,
+ "field": "comments",
+ "description": "Comments of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "sub_category",
+ "description": "Sub Category of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "category",
+ "description": "Category of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "anidb_id",
+ "description": "Anidb ID of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "uploader_id",
+ "description": "ID of the torrent uploader.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "uploader_name",
+ "description": "Username of the torrent uploader.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "uploader_old",
+ "description": "Old username from nyaa of the torrent uploader.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "website_link",
+ "description": "External Link of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String[]",
+ "optional": false,
+ "field": "languages",
+ "description": "Languages of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "magnet",
+ "description": "Magnet URI of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String",
+ "optional": false,
+ "field": "torrent",
+ "description": "Download URL of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "seeders",
+ "description": "Number of seeders of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "leechers",
+ "description": "Number of leechers of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "completed",
+ "description": "Downloads completed of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Date",
+ "optional": false,
+ "field": "last_scrape",
+ "description": "Last statistics update of the torrent.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Object[]",
+ "optional": false,
+ "field": "file_list",
+ "description": "List of files in the torrent.
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n\t{\n\t\"id\": 952801,\n\t\"name\": \"[HorribleSubs] Uchouten Kazoku S2 [720p]\",\n\t\"status\": 1,\n\t\"hash\": \"6E4D96F7A0B0456672E80B150CCB7C15868CD47D\",\n\t\"date\": \"2017-07-05T11:01:39Z\",\n\t\"filesize\": 4056160259,\n\t\"description\": \"Unofficial batch
\\n\",\n\t\"comments\": [],\n\t\"sub_category\": \"5\",\n\t\"category\": \"3\",\n\t\"anidb_id\": \"\",\n\t\"downloads\": 0,\n\t\"uploader_id\": 7177,\n\t\"uploader_name\": \"DarAR92\",\n\t\"uploader_old\": \"\",\n\t\"website_link\": \"http://horriblesubs.info/\",\n\t\"languages\": [\n\t\"en-us\"\n\t],\n\t\"magnet\": \"magnet:?xt=urn:btih:6E4D96F7A0B0456672E80B150CCB7C15868CD47D&dn=%5BHorribleSubs%5D+Uchouten+Kazoku+S2+%5B720p%5D&tr=http://nyaa.tracker.wf:7777/announce&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://tracker.doko.moe:6969&tr=http://tracker.anirena.com:80/announce&tr=http://anidex.moe:6969/announce&tr=udp://tracker.opentrackr.org:1337&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://zer0day.ch:1337&tr=udp://9.rarbg.com:2710/announce&tr=udp://tracker2.christianbro.pw:6969/announce&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://eddie4.nl:6969/announce&tr=udp://tracker.doko.moe:6969/announce\",\n\t\"torrent\": \"https://nyaa.pantsu.cat/download/6E4D96F7A0B0456672E80B150CCB7C15868CD47D\",\n\t\"seeders\": 4,\n\t\"leechers\": 2,\n\t\"completed\": 28,\n\t\"last_scrape\": \"2017-07-07T07:48:32.509635Z\",\n\t\"file_list\": [\n\t{\n\t\"path\": \"[HorribleSubs] Uchouten Kazoku S2 - 01[720p].mkv\",\n\t\"filesize\": 338250895\n\t},\n\t{\n\t\"path\": \"[HorribleSubs] Uchouten Kazoku S2 - 12 [720p].mkv\",\n\t\"filesize\": 338556275\n\t}\n\t]\n\t}",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/api.go",
- "groupTitle": "Torrents",
- "error": {
- "fields": {
- "Error 4xx": [
- {
+ }]
+ },
+ "filename": "controllers/api/api.go",
+ "groupTitle": "Torrents",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
"group": "Error 4xx",
"type": "String[]",
"optional": false,
"field": "errors",
"description": "List of errors messages with a 404 error message in it.
"
- }
- ]
- },
- "examples": [
- {
+ }]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json"
- }
- ]
- }
- },
- {
- "type": "get",
- "url": "/head/:id",
- "title": "Request Torrent Head",
- "version": "1.1.1",
- "name": "GetTorrentHead",
- "group": "Torrents",
- "parameter": {
- "fields": {
- "Parameter": [
- {
+ }]
+ }
+ },
+ {
+ "type": "get",
+ "url": "/head/:id",
+ "title": "Request Torrent Head",
+ "version": "1.1.1",
+ "name": "GetTorrentHead",
+ "group": "Torrents",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "id",
"description": "Torrent unique ID.
"
- }
- ]
- }
- },
- "success": {
- "examples": [
- {
+ }]
+ }
+ },
+ "success": {
+ "examples": [{
"title": "Success-Response:",
"content": "HTTP/1.1 200 OK",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/api.go",
- "groupTitle": "Torrents",
- "error": {
- "fields": {
- "Error 4xx": [
- {
+ }]
+ },
+ "filename": "controllers/api/api.go",
+ "groupTitle": "Torrents",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
"group": "Error 4xx",
"type": "String[]",
"optional": false,
"field": "errors",
"description": "List of errors messages with a 404 error message in it.
"
- }
- ]
- },
- "examples": [
- {
+ }]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json"
- }
- ]
- }
- },
- {
- "type": "get",
- "url": "/",
- "title": "Request Torrents index",
- "version": "1.1.1",
- "name": "GetTorrents",
- "group": "Torrents",
- "parameter": {
- "fields": {
- "Parameter": [
- {
+ }]
+ }
+ },
+ {
+ "type": "get",
+ "url": "/",
+ "title": "Request Torrents index",
+ "version": "1.1.1",
+ "name": "GetTorrents",
+ "group": "Torrents",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "id",
"description": "Torrent unique ID.
"
- }
- ]
- }
- },
- "success": {
- "fields": {
- "Success 200": [
- {
- "group": "Success 200",
- "type": "Object[]",
- "optional": false,
- "field": "torrents",
- "description": "List of torrent object (see view for the properties).
"
- },
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "queryRecordCount",
- "description": "Number of torrents given.
"
- },
- {
- "group": "Success 200",
- "type": "Number",
- "optional": false,
- "field": "totalRecordCount",
- "description": "Total number of torrents.
"
- }
- ]
+ }]
+ }
},
- "examples": [
- {
+ "success": {
+ "fields": {
+ "Success 200": [{
+ "group": "Success 200",
+ "type": "Object[]",
+ "optional": false,
+ "field": "torrents",
+ "description": "List of torrent object (see view for the properties).
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "queryRecordCount",
+ "description": "Number of torrents given.
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Number",
+ "optional": false,
+ "field": "totalRecordCount",
+ "description": "Total number of torrents.
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n {\n\t\t\t\"torrents\": [...],\n\t\t\t\"queryRecordCount\": 50,\n\t\t\t\"totalRecordCount\": 798414\n\t\t}",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/api.go",
- "groupTitle": "Torrents",
- "error": {
- "fields": {
- "Error 4xx": [
- {
+ }]
+ },
+ "filename": "controllers/api/api.go",
+ "groupTitle": "Torrents",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
"group": "Error 4xx",
"type": "String[]",
"optional": false,
"field": "errors",
"description": "List of errors messages with a 404 error message in it.
"
- }
- ]
- },
- "examples": [
- {
+ }]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": "HTTP/1.1 404 Not Found\n{\n \"errors\": [ \"404_not_found\", ... ]\n}",
"type": "json"
- }
- ]
- }
- },
- {
- "type": "post",
- "url": "/update/",
- "title": "Update a Torrent",
- "version": "1.1.1",
- "name": "UpdateTorrent",
- "group": "Torrents",
- "parameter": {
- "fields": {
- "Parameter": [
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "username",
- "description": "Torrent uploader name.
"
- },
- {
- "group": "Parameter",
- "type": "Number",
- "optional": false,
- "field": "id",
- "description": "Torrent ID.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "name",
- "description": "Torrent name.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "category",
- "description": "Torrent category.
"
- },
- {
- "group": "Parameter",
- "type": "Boolean",
- "optional": false,
- "field": "remake",
- "description": "Torrent is a remake.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "description",
- "description": "Torrent description.
"
- },
- {
- "group": "Parameter",
- "type": "Number",
- "optional": false,
- "field": "status",
- "description": "Torrent status.
"
- },
- {
- "group": "Parameter",
- "type": "Boolean",
- "optional": false,
- "field": "hidden",
- "description": "Torrent hidden.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "website_link",
- "description": "Torrent website link.
"
- },
- {
- "group": "Parameter",
- "type": "String[]",
- "optional": false,
- "field": "languages",
- "description": "Torrent languages.
"
- }
- ]
+ }]
}
},
- "success": {
- "fields": {
- "Success 200": [
- {
- "group": "Success 200",
- "type": "Boolean",
- "optional": false,
- "field": "ok",
- "description": "The request is done without failing
"
- },
- {
- "group": "Success 200",
- "type": "String[]",
- "optional": false,
- "field": "infos",
- "description": "Messages information relative to the request
"
- },
- {
- "group": "Success 200",
- "type": "Object",
- "optional": false,
- "field": "data",
- "description": "The resulting torrent updated (see view for the properties)
"
- }
- ]
+ {
+ "type": "post",
+ "url": "/update/",
+ "title": "Update a Torrent",
+ "version": "1.1.1",
+ "name": "UpdateTorrent",
+ "group": "Torrents",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "username",
+ "description": "Torrent uploader name.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Number",
+ "optional": false,
+ "field": "id",
+ "description": "Torrent ID.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "name",
+ "description": "Torrent name.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "category",
+ "description": "Torrent category.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Boolean",
+ "optional": false,
+ "field": "remake",
+ "description": "Torrent is a remake.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "description",
+ "description": "Torrent description.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Number",
+ "optional": false,
+ "field": "status",
+ "description": "Torrent status.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Boolean",
+ "optional": false,
+ "field": "hidden",
+ "description": "Torrent hidden.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "website_link",
+ "description": "Torrent website link.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String[]",
+ "optional": false,
+ "field": "languages",
+ "description": "Torrent languages.
"
+ }
+ ]
+ }
},
- "examples": [
- {
+ "success": {
+ "fields": {
+ "Success 200": [{
+ "group": "Success 200",
+ "type": "Boolean",
+ "optional": false,
+ "field": "ok",
+ "description": "The request is done without failing
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String[]",
+ "optional": false,
+ "field": "infos",
+ "description": "Messages information relative to the request
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Object",
+ "optional": false,
+ "field": "data",
+ "description": "The resulting torrent updated (see view for the properties)
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Success-Response:",
"content": "HTTP/1.1 200 OK",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/api.go",
- "groupTitle": "Torrents",
- "error": {
- "fields": {
- "Error 4xx": [
- {
- "group": "Error 4xx",
- "type": "Boolean",
- "optional": false,
- "field": "ok",
- "description": "The request couldn't be done due to some errors.
"
- },
- {
- "group": "Error 4xx",
- "type": "String[]",
- "optional": false,
- "field": "errors",
- "description": "List of errors messages.
"
- },
- {
- "group": "Error 4xx",
- "type": "Object[]",
- "optional": false,
- "field": "all_errors",
- "description": "List of errors object messages for each wrong field
"
- }
- ]
+ }]
},
- "examples": [
- {
+ "filename": "controllers/api/api.go",
+ "groupTitle": "Torrents",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
+ "group": "Error 4xx",
+ "type": "Boolean",
+ "optional": false,
+ "field": "ok",
+ "description": "The request couldn't be done due to some errors.
"
+ },
+ {
+ "group": "Error 4xx",
+ "type": "String[]",
+ "optional": false,
+ "field": "errors",
+ "description": "List of errors messages.
"
+ },
+ {
+ "group": "Error 4xx",
+ "type": "Object[]",
+ "optional": false,
+ "field": "all_errors",
+ "description": "List of errors object messages for each wrong field
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
"type": "json"
- }
- ]
- }
- },
- {
- "type": "post",
- "url": "/upload",
- "title": "Upload a Torrent",
- "version": "1.1.1",
- "name": "UploadTorrent",
- "group": "Torrents",
- "parameter": {
- "fields": {
- "Parameter": [
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "username",
- "description": "Torrent uploader name.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "name",
- "description": "Torrent name.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "magnet",
- "description": "Torrent magnet URI.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "category",
- "description": "Torrent category.
"
- },
- {
- "group": "Parameter",
- "type": "Boolean",
- "optional": false,
- "field": "remake",
- "description": "Torrent is a remake.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "description",
- "description": "Torrent description.
"
- },
- {
- "group": "Parameter",
- "type": "Number",
- "optional": false,
- "field": "status",
- "description": "Torrent status.
"
- },
- {
- "group": "Parameter",
- "type": "Boolean",
- "optional": false,
- "field": "hidden",
- "description": "Torrent hidden.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "website_link",
- "description": "Torrent website link.
"
- },
- {
- "group": "Parameter",
- "type": "String[]",
- "optional": false,
- "field": "languages",
- "description": "Torrent languages.
"
- },
- {
- "group": "Parameter",
- "type": "File",
- "optional": false,
- "field": "torrent",
- "description": "Torrent file to upload (you have to send a torrent file or a magnet, not both!).
"
- }
- ]
+ }]
}
},
- "success": {
- "fields": {
- "Success 200": [
- {
- "group": "Success 200",
- "type": "Boolean",
- "optional": false,
- "field": "ok",
- "description": "The request is done without failing
"
- },
- {
- "group": "Success 200",
- "type": "String[]",
- "optional": false,
- "field": "infos",
- "description": "Messages information relative to the request
"
- },
- {
- "group": "Success 200",
- "type": "Object",
- "optional": false,
- "field": "data",
- "description": "The resulting torrent uploaded (see view for the properties)
"
- }
- ]
+ {
+ "type": "post",
+ "url": "/upload",
+ "title": "Upload a Torrent",
+ "version": "1.1.1",
+ "name": "UploadTorrent",
+ "group": "Torrents",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "username",
+ "description": "Torrent uploader name.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "name",
+ "description": "Torrent name.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "magnet",
+ "description": "Torrent magnet URI.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "category",
+ "description": "Torrent category.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Boolean",
+ "optional": false,
+ "field": "remake",
+ "description": "Torrent is a remake.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "description",
+ "description": "Torrent description.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Number",
+ "optional": false,
+ "field": "status",
+ "description": "Torrent status.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "Boolean",
+ "optional": false,
+ "field": "hidden",
+ "description": "Torrent hidden.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "website_link",
+ "description": "Torrent website link.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String[]",
+ "optional": false,
+ "field": "languages",
+ "description": "Torrent languages.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "File",
+ "optional": false,
+ "field": "torrent",
+ "description": "Torrent file to upload (you have to send a torrent file or a magnet, not both!).
"
+ }
+ ]
+ }
},
- "examples": [
- {
+ "success": {
+ "fields": {
+ "Success 200": [{
+ "group": "Success 200",
+ "type": "Boolean",
+ "optional": false,
+ "field": "ok",
+ "description": "The request is done without failing
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String[]",
+ "optional": false,
+ "field": "infos",
+ "description": "Messages information relative to the request
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Object",
+ "optional": false,
+ "field": "data",
+ "description": "The resulting torrent uploaded (see view for the properties)
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Success-Response:",
"content": "HTTP/1.1 200 OK",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/api.go",
- "groupTitle": "Torrents",
- "error": {
- "fields": {
- "Error 4xx": [
- {
- "group": "Error 4xx",
- "type": "Boolean",
- "optional": false,
- "field": "ok",
- "description": "The request couldn't be done due to some errors.
"
- },
- {
- "group": "Error 4xx",
- "type": "String[]",
- "optional": false,
- "field": "errors",
- "description": "List of errors messages.
"
- },
- {
- "group": "Error 4xx",
- "type": "Object[]",
- "optional": false,
- "field": "all_errors",
- "description": "List of errors object messages for each wrong field
"
- }
- ]
+ }]
},
- "examples": [
- {
+ "filename": "controllers/api/api.go",
+ "groupTitle": "Torrents",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
+ "group": "Error 4xx",
+ "type": "Boolean",
+ "optional": false,
+ "field": "ok",
+ "description": "The request couldn't be done due to some errors.
"
+ },
+ {
+ "group": "Error 4xx",
+ "type": "String[]",
+ "optional": false,
+ "field": "errors",
+ "description": "List of errors messages.
"
+ },
+ {
+ "group": "Error 4xx",
+ "type": "Object[]",
+ "optional": false,
+ "field": "all_errors",
+ "description": "List of errors object messages for each wrong field
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
"type": "json"
- }
- ]
- }
- },
- {
- "type": "post",
- "url": "/login/",
- "title": "Login a user",
- "version": "1.1.1",
- "name": "Login",
- "group": "Users",
- "parameter": {
- "fields": {
- "Parameter": [
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "username",
- "description": "Username or Email.
"
- },
- {
- "group": "Parameter",
- "type": "String",
- "optional": false,
- "field": "password",
- "description": "Password.
"
- }
- ]
+ }]
}
},
- "success": {
- "fields": {
- "Success 200": [
- {
- "group": "Success 200",
- "type": "Boolean",
- "optional": false,
- "field": "ok",
- "description": "The request is done without failing
"
- },
- {
- "group": "Success 200",
- "type": "String[]",
- "optional": false,
- "field": "infos",
- "description": "Messages information relative to the request
"
- },
- {
- "group": "Success 200",
- "type": "Object",
- "optional": false,
- "field": "data",
- "description": "The connected user object
"
- }
- ]
+ {
+ "type": "post",
+ "url": "/login/",
+ "title": "Login a user",
+ "version": "1.1.1",
+ "name": "Login",
+ "group": "Users",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "username",
+ "description": "Username or Email.
"
+ },
+ {
+ "group": "Parameter",
+ "type": "String",
+ "optional": false,
+ "field": "password",
+ "description": "Password.
"
+ }
+ ]
+ }
},
- "examples": [
- {
+ "success": {
+ "fields": {
+ "Success 200": [{
+ "group": "Success 200",
+ "type": "Boolean",
+ "optional": false,
+ "field": "ok",
+ "description": "The request is done without failing
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String[]",
+ "optional": false,
+ "field": "infos",
+ "description": "Messages information relative to the request
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Object",
+ "optional": false,
+ "field": "data",
+ "description": "The connected user object
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\ttoken:\"token\",\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/api.go",
- "groupTitle": "Users",
- "error": {
- "fields": {
- "Error 4xx": [
- {
- "group": "Error 4xx",
- "type": "Boolean",
- "optional": false,
- "field": "ok",
- "description": "The request couldn't be done due to some errors.
"
- },
- {
- "group": "Error 4xx",
- "type": "String[]",
- "optional": false,
- "field": "errors",
- "description": "List of errors messages.
"
- },
- {
- "group": "Error 4xx",
- "type": "Object[]",
- "optional": false,
- "field": "all_errors",
- "description": "List of errors object messages for each wrong field
"
- }
- ]
+ }]
},
- "examples": [
- {
+ "filename": "controllers/api/api.go",
+ "groupTitle": "Users",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
+ "group": "Error 4xx",
+ "type": "Boolean",
+ "optional": false,
+ "field": "ok",
+ "description": "The request couldn't be done due to some errors.
"
+ },
+ {
+ "group": "Error 4xx",
+ "type": "String[]",
+ "optional": false,
+ "field": "errors",
+ "description": "List of errors messages.
"
+ },
+ {
+ "group": "Error 4xx",
+ "type": "Object[]",
+ "optional": false,
+ "field": "all_errors",
+ "description": "List of errors object messages for each wrong field
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
"type": "json"
- }
- ]
- }
- },
- {
- "type": "post",
- "url": "/profile/",
- "title": "Get a user profile",
- "version": "1.1.1",
- "name": "Profile",
- "group": "Users",
- "parameter": {
- "fields": {
- "Parameter": [
- {
+ }]
+ }
+ },
+ {
+ "type": "post",
+ "url": "/profile/",
+ "title": "Get a user profile",
+ "version": "1.1.1",
+ "name": "Profile",
+ "group": "Users",
+ "parameter": {
+ "fields": {
+ "Parameter": [{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "id",
"description": "User ID.
"
- }
- ]
- }
- },
- "success": {
- "fields": {
- "Success 200": [
- {
- "group": "Success 200",
- "type": "Boolean",
- "optional": false,
- "field": "ok",
- "description": "The request is done without failing
"
- },
- {
- "group": "Success 200",
- "type": "String[]",
- "optional": false,
- "field": "infos",
- "description": "Messages information relative to the request
"
- },
- {
- "group": "Success 200",
- "type": "Object",
- "optional": false,
- "field": "data",
- "description": "The user object
"
- }
- ]
+ }]
+ }
},
- "examples": [
- {
+ "success": {
+ "fields": {
+ "Success 200": [{
+ "group": "Success 200",
+ "type": "Boolean",
+ "optional": false,
+ "field": "ok",
+ "description": "The request is done without failing
"
+ },
+ {
+ "group": "Success 200",
+ "type": "String[]",
+ "optional": false,
+ "field": "infos",
+ "description": "Messages information relative to the request
"
+ },
+ {
+ "group": "Success 200",
+ "type": "Object",
+ "optional": false,
+ "field": "data",
+ "description": "The user object
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Success-Response:",
"content": " HTTP/1.1 200 OK\n\t\t{\n\t\t\tdata:\n \t\t[{\n\t\t\t\t\tuser_id:1,\n\t\t\t\t\tusername:\"username\",\n\t\t\t\t\tstatus:1,\n\t\t\t\t\tmd5:\"\",\n\t\t\t\t\tcreated_at:\"date\",\n\t\t\t\t\tliking_count:0,\n\t\t\t\t\tliked_count:0\n\t\t\t\t}],\n\t\t\tinfos: [\"Logged\", ... ],\n\t\t\tok:true\n\t\t}",
"type": "json"
- }
- ]
- },
- "filename": "controllers/api/api.go",
- "groupTitle": "Users",
- "error": {
- "fields": {
- "Error 4xx": [
- {
- "group": "Error 4xx",
- "type": "Boolean",
- "optional": false,
- "field": "ok",
- "description": "The request couldn't be done due to some errors.
"
- },
- {
- "group": "Error 4xx",
- "type": "String[]",
- "optional": false,
- "field": "errors",
- "description": "List of errors messages.
"
- },
- {
- "group": "Error 4xx",
- "type": "Object[]",
- "optional": false,
- "field": "all_errors",
- "description": "List of errors object messages for each wrong field
"
- }
- ]
+ }]
},
- "examples": [
- {
+ "filename": "controllers/api/api.go",
+ "groupTitle": "Users",
+ "error": {
+ "fields": {
+ "Error 4xx": [{
+ "group": "Error 4xx",
+ "type": "Boolean",
+ "optional": false,
+ "field": "ok",
+ "description": "The request couldn't be done due to some errors.
"
+ },
+ {
+ "group": "Error 4xx",
+ "type": "String[]",
+ "optional": false,
+ "field": "errors",
+ "description": "List of errors messages.
"
+ },
+ {
+ "group": "Error 4xx",
+ "type": "Object[]",
+ "optional": false,
+ "field": "all_errors",
+ "description": "List of errors object messages for each wrong field
"
+ }
+ ]
+ },
+ "examples": [{
"title": "Error-Response:",
"content": " HTTP/1.1 200 OK\n {\n \"ok\": false,\n \"errors\": [ ... ]\n \"all_errors\": {\n\t\t \t\"username\": [ ... ],\n }\n }",
"type": "json"
- }
- ]
+ }]
+ }
}
- }
-] });
+ ]
+});
diff --git a/apidoc/index.html b/apidoc/index.html
index 5f04deda..b5751e28 100644
--- a/apidoc/index.html
+++ b/apidoc/index.html
@@ -1,287 +1,249 @@
-
-
- Loading...
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ {{/if}} {{else}}
+
+ {{title}}
+
+ {{/if}} {{/if}} {{/each}}
+
+
+
-
+
+
+
+ {{/if}}
+
+
-
+
-
+
-
+ {{/if}} {{/if}}
+
-
+
-
- {{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}}
- {{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
- {{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}}
- {{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
-
- {{subTemplate "article-sample-request" article=article id=id}}
-
-
-
-
+ {{/if_gt}} {{/if}}
+
-
+ {{/if}}
+
-
- {{/each_compare_title}}
-
-
- {{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
- {{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}}
- {{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
-
- {{subTemplate "article-sample-request" article=article id=id}}
-
-
-
-
-
+ {{#unless _last}}, {{/unless}} {{/if}} {{/if}} {{/if}} {{/each_compare_list_field}}
+
+
-
+ {{/if}} {{/each_compare_title}}
+
+ {{/if}} {{/if}}
+
-
- {{/each_compare_field}}
-
-
+
-