Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix most go lint warnings

Cette révision appartient à :
PantsuDev 2017-07-23 15:46:29 +10:00
Parent a931b47bff
révision d9142a73c3
54 fichiers modifiés avec 7161 ajouts et 7275 suppressions

Voir le fichier

@ -1,24 +1,24 @@
{ {
"env": { "env": {
"browser": true, "browser": true,
"commonjs": true, "commonjs": true,
"es6": true, "es6": true,
"node": true "node": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}, },
"parserOptions": { "sourceType": "module"
"ecmaFeatures": { },
"jsx": true "rules": {
}, "no-const-assign": "warn",
"sourceType": "module" "no-this-before-super": "warn",
}, "no-undef": "warn",
"rules": { "no-unreachable": "warn",
"no-const-assign": "warn", "no-unused-vars": "warn",
"no-this-before-super": "warn", "constructor-super": "warn",
"no-undef": "warn", "valid-typeof": "warn",
"no-unreachable": "warn", "indent": ["error", 2]
"no-unused-vars": "warn", }
"constructor-super": "warn", }
"valid-typeof": "warn",
"indent": ["error", 2]
}
}

2
.gitignore externe
Voir le fichier

@ -19,4 +19,4 @@ config/config.yml
# emacs temp files # emacs temp files
*\#* *\#*
*~ *~

25
.htmlhintrc Fichier normal
Voir le fichier

@ -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
}

Voir le fichier

@ -21,7 +21,7 @@ deploy:
provider: releases provider: releases
api_key: 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= 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 - ./package.sh
file: dist/*.zip file: dist/*.zip
skip_cleanup: true skip_cleanup: true

Voir le fichier

@ -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 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 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. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Voir le fichier

@ -21,4 +21,4 @@
"withCompare": true, "withCompare": true,
"withGenerator": true "withGenerator": true
} }
} }

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
ca: { ca: {
'Allowed values:' : 'Valors permesos:', 'Allowed values:': 'Valors permesos:',
'Compare all with predecessor': 'Comparar tot amb versió anterior', 'Compare all with predecessor': 'Comparar tot amb versió anterior',
'compare changes to:' : 'comparar canvis amb:', 'compare changes to:': 'comparar canvis amb:',
'compared to' : 'comparat amb', 'compared to': 'comparat amb',
'Default value:' : 'Valor per defecte:', 'Default value:': 'Valor per defecte:',
'Description' : 'Descripció', 'Description': 'Descripció',
'Field' : 'Camp', 'Field': 'Camp',
'General' : 'General', 'General': 'General',
'Generated with' : 'Generat amb', 'Generated with': 'Generat amb',
'Name' : 'Nom', 'Name': 'Nom',
'No response values.' : 'Sense valors en la resposta.', 'No response values.': 'Sense valors en la resposta.',
'optional' : 'opcional', 'optional': 'opcional',
'Parameter' : 'Paràmetre', 'Parameter': 'Paràmetre',
'Permission:' : 'Permisos:', 'Permission:': 'Permisos:',
'Response' : 'Resposta', 'Response': 'Resposta',
'Send' : 'Enviar', 'Send': 'Enviar',
'Send a Sample Request' : 'Enviar una petició d\'exemple', 'Send a Sample Request': 'Enviar una petició d\'exemple',
'show up to version:' : 'mostrar versió:', 'show up to version:': 'mostrar versió:',
'Size range:' : 'Tamany de rang:', 'Size range:': 'Tamany de rang:',
'Type' : 'Tipus', 'Type': 'Tipus',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
de: { de: {
'Allowed values:' : 'Erlaubte Werte:', 'Allowed values:': 'Erlaubte Werte:',
'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern',
'compare changes to:' : 'vergleiche Änderungen mit:', 'compare changes to:': 'vergleiche Änderungen mit:',
'compared to' : 'verglichen mit', 'compared to': 'verglichen mit',
'Default value:' : 'Standardwert:', 'Default value:': 'Standardwert:',
'Description' : 'Beschreibung', 'Description': 'Beschreibung',
'Field' : 'Feld', 'Field': 'Feld',
'General' : 'Allgemein', 'General': 'Allgemein',
'Generated with' : 'Erstellt mit', 'Generated with': 'Erstellt mit',
'Name' : 'Name', 'Name': 'Name',
'No response values.' : 'Keine Rückgabewerte.', 'No response values.': 'Keine Rückgabewerte.',
'optional' : 'optional', 'optional': 'optional',
'Parameter' : 'Parameter', 'Parameter': 'Parameter',
'Permission:' : 'Berechtigung:', 'Permission:': 'Berechtigung:',
'Response' : 'Antwort', 'Response': 'Antwort',
'Send' : 'Senden', 'Send': 'Senden',
'Send a Sample Request' : 'Eine Beispielanfrage senden', 'Send a Sample Request': 'Eine Beispielanfrage senden',
'show up to version:' : 'zeige bis zur Version:', 'show up to version:': 'zeige bis zur Version:',
'Size range:' : 'Größenbereich:', 'Size range:': 'Größenbereich:',
'Type' : 'Typ', 'Type': 'Typ',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
es: { es: {
'Allowed values:' : 'Valores permitidos:', 'Allowed values:': 'Valores permitidos:',
'Compare all with predecessor': 'Comparar todo con versión anterior', 'Compare all with predecessor': 'Comparar todo con versión anterior',
'compare changes to:' : 'comparar cambios con:', 'compare changes to:': 'comparar cambios con:',
'compared to' : 'comparado con', 'compared to': 'comparado con',
'Default value:' : 'Valor por defecto:', 'Default value:': 'Valor por defecto:',
'Description' : 'Descripción', 'Description': 'Descripción',
'Field' : 'Campo', 'Field': 'Campo',
'General' : 'General', 'General': 'General',
'Generated with' : 'Generado con', 'Generated with': 'Generado con',
'Name' : 'Nombre', 'Name': 'Nombre',
'No response values.' : 'Sin valores en la respuesta.', 'No response values.': 'Sin valores en la respuesta.',
'optional' : 'opcional', 'optional': 'opcional',
'Parameter' : 'Parámetro', 'Parameter': 'Parámetro',
'Permission:' : 'Permisos:', 'Permission:': 'Permisos:',
'Response' : 'Respuesta', 'Response': 'Respuesta',
'Send' : 'Enviar', 'Send': 'Enviar',
'Send a Sample Request' : 'Enviar una petición de ejemplo', 'Send a Sample Request': 'Enviar una petición de ejemplo',
'show up to version:' : 'mostrar a versión:', 'show up to version:': 'mostrar a versión:',
'Size range:' : 'Tamaño de rango:', 'Size range:': 'Tamaño de rango:',
'Type' : 'Tipo', 'Type': 'Tipo',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
fr: { fr: {
'Allowed values:' : 'Valeurs autorisées :', 'Allowed values:': 'Valeurs autorisées :',
'Compare all with predecessor': 'Tout comparer avec ...', 'Compare all with predecessor': 'Tout comparer avec ...',
'compare changes to:' : 'comparer les changements à :', 'compare changes to:': 'comparer les changements à :',
'compared to' : 'comparer à', 'compared to': 'comparer à',
'Default value:' : 'Valeur par défaut :', 'Default value:': 'Valeur par défaut :',
'Description' : 'Description', 'Description': 'Description',
'Field' : 'Champ', 'Field': 'Champ',
'General' : 'Général', 'General': 'Général',
'Generated with' : 'Généré avec', 'Generated with': 'Généré avec',
'Name' : 'Nom', 'Name': 'Nom',
'No response values.' : 'Aucune valeur de réponse.', 'No response values.': 'Aucune valeur de réponse.',
'optional' : 'optionnel', 'optional': 'optionnel',
'Parameter' : 'Paramètre', 'Parameter': 'Paramètre',
'Permission:' : 'Permission :', 'Permission:': 'Permission :',
'Response' : 'Réponse', 'Response': 'Réponse',
'Send' : 'Envoyer', 'Send': 'Envoyer',
'Send a Sample Request' : 'Envoyer une requête représentative', 'Send a Sample Request': 'Envoyer une requête représentative',
'show up to version:' : 'Montrer à partir de la version :', 'show up to version:': 'Montrer à partir de la version :',
'Size range:' : 'Ordre de grandeur :', 'Size range:': 'Ordre de grandeur :',
'Type' : 'Type', 'Type': 'Type',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
it: { it: {
'Allowed values:' : 'Valori permessi:', 'Allowed values:': 'Valori permessi:',
'Compare all with predecessor': 'Confronta tutto con versioni precedenti', 'Compare all with predecessor': 'Confronta tutto con versioni precedenti',
'compare changes to:' : 'confronta modifiche con:', 'compare changes to:': 'confronta modifiche con:',
'compared to' : 'confrontato con', 'compared to': 'confrontato con',
'Default value:' : 'Valore predefinito:', 'Default value:': 'Valore predefinito:',
'Description' : 'Descrizione', 'Description': 'Descrizione',
'Field' : 'Campo', 'Field': 'Campo',
'General' : 'Generale', 'General': 'Generale',
'Generated with' : 'Creato con', 'Generated with': 'Creato con',
'Name' : 'Nome', 'Name': 'Nome',
'No response values.' : 'Nessun valore di risposta.', 'No response values.': 'Nessun valore di risposta.',
'optional' : 'opzionale', 'optional': 'opzionale',
'Parameter' : 'Parametro', 'Parameter': 'Parametro',
'Permission:' : 'Permessi:', 'Permission:': 'Permessi:',
'Response' : 'Risposta', 'Response': 'Risposta',
'Send' : 'Invia', 'Send': 'Invia',
'Send a Sample Request' : 'Invia una richiesta di esempio', 'Send a Sample Request': 'Invia una richiesta di esempio',
'show up to version:' : 'mostra alla versione:', 'show up to version:': 'mostra alla versione:',
'Size range:' : 'Intervallo dimensione:', 'Size range:': 'Intervallo dimensione:',
'Type' : 'Tipo', 'Type': 'Tipo',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,50 +1,50 @@
define([ define([
'./locales/ca.js', './locales/ca.js',
'./locales/de.js', './locales/de.js',
'./locales/es.js', './locales/es.js',
'./locales/fr.js', './locales/fr.js',
'./locales/it.js', './locales/it.js',
'./locales/nl.js', './locales/nl.js',
'./locales/pl.js', './locales/pl.js',
'./locales/pt_br.js', './locales/pt_br.js',
'./locales/ro.js', './locales/ro.js',
'./locales/ru.js', './locales/ru.js',
'./locales/tr.js', './locales/tr.js',
'./locales/vi.js', './locales/vi.js',
'./locales/zh.js', './locales/zh.js',
'./locales/zh_cn.js' './locales/zh_cn.js'
], function() { ], function () {
var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_');
var language = langId.substr(0, 2); var language = langId.substr(0, 2);
var locales = {}; var locales = {};
for (index in arguments) { for (index in arguments) {
for (property in arguments[index]) for (property in arguments[index])
locales[property] = arguments[index][property]; locales[property] = arguments[index][property];
} }
if ( ! locales['en']) if (!locales['en'])
locales['en'] = {}; locales['en'] = {};
if ( ! locales[langId] && ! locales[language]) if (!locales[langId] && !locales[language])
language = 'en'; language = 'en';
var locale = (locales[langId] ? locales[langId] : locales[language]); var locale = (locales[langId] ? locales[langId] : locales[language]);
function __(text) { function __(text) {
var index = locale[text]; var index = locale[text];
if (index === undefined) if (index === undefined)
return text; return text;
return index; return index;
}; };
function setLanguage(language) { function setLanguage(language) {
locale = locales[language]; locale = locales[language];
} }
return { return {
__ : __, __: __,
locales : locales, locales: locales,
locale : locale, locale: locale,
setLanguage: setLanguage setLanguage: setLanguage
}; };
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
nl: { nl: {
'Allowed values:' : 'Toegestane waarden:', 'Allowed values:': 'Toegestane waarden:',
'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie',
'compare changes to:' : 'vergelijk veranderingen met:', 'compare changes to:': 'vergelijk veranderingen met:',
'compared to' : 'vergelijk met', 'compared to': 'vergelijk met',
'Default value:' : 'Standaard waarde:', 'Default value:': 'Standaard waarde:',
'Description' : 'Omschrijving', 'Description': 'Omschrijving',
'Field' : 'Veld', 'Field': 'Veld',
'General' : 'Algemeen', 'General': 'Algemeen',
'Generated with' : 'Gegenereerd met', 'Generated with': 'Gegenereerd met',
'Name' : 'Naam', 'Name': 'Naam',
'No response values.' : 'Geen response waardes.', 'No response values.': 'Geen response waardes.',
'optional' : 'optioneel', 'optional': 'optioneel',
'Parameter' : 'Parameter', 'Parameter': 'Parameter',
'Permission:' : 'Permissie:', 'Permission:': 'Permissie:',
'Response' : 'Antwoorden', 'Response': 'Antwoorden',
'Send' : 'Sturen', 'Send': 'Sturen',
'Send a Sample Request' : 'Stuur een sample aanvragen', 'Send a Sample Request': 'Stuur een sample aanvragen',
'show up to version:' : 'toon tot en met versie:', 'show up to version:': 'toon tot en met versie:',
'Size range:' : 'Maatbereik:', 'Size range:': 'Maatbereik:',
'Type' : 'Type', 'Type': 'Type',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
pl: { pl: {
'Allowed values:' : 'Dozwolone wartości:', 'Allowed values:': 'Dozwolone wartości:',
'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami',
'compare changes to:' : 'porównaj zmiany do:', 'compare changes to:': 'porównaj zmiany do:',
'compared to' : 'porównaj do:', 'compared to': 'porównaj do:',
'Default value:' : 'Wartość domyślna:', 'Default value:': 'Wartość domyślna:',
'Description' : 'Opis', 'Description': 'Opis',
'Field' : 'Pole', 'Field': 'Pole',
'General' : 'Generalnie', 'General': 'Generalnie',
'Generated with' : 'Wygenerowano z', 'Generated with': 'Wygenerowano z',
'Name' : 'Nazwa', 'Name': 'Nazwa',
'No response values.' : 'Brak odpowiedzi.', 'No response values.': 'Brak odpowiedzi.',
'optional' : 'opcjonalny', 'optional': 'opcjonalny',
'Parameter' : 'Parametr', 'Parameter': 'Parametr',
'Permission:' : 'Uprawnienia:', 'Permission:': 'Uprawnienia:',
'Response' : 'Odpowiedź', 'Response': 'Odpowiedź',
'Send' : 'Wyślij', 'Send': 'Wyślij',
'Send a Sample Request' : 'Wyślij przykładowe żądanie', 'Send a Sample Request': 'Wyślij przykładowe żądanie',
'show up to version:' : 'pokaż do wersji:', 'show up to version:': 'pokaż do wersji:',
'Size range:' : 'Zakres rozmiaru:', 'Size range:': 'Zakres rozmiaru:',
'Type' : 'Typ', 'Type': 'Typ',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
'pt_br': { 'pt_br': {
'Allowed values:' : 'Valores permitidos:', 'Allowed values:': 'Valores permitidos:',
'Compare all with predecessor': 'Compare todos com antecessores', 'Compare all with predecessor': 'Compare todos com antecessores',
'compare changes to:' : 'comparar alterações com:', 'compare changes to:': 'comparar alterações com:',
'compared to' : 'comparado com', 'compared to': 'comparado com',
'Default value:' : 'Valor padrão:', 'Default value:': 'Valor padrão:',
'Description' : 'Descrição', 'Description': 'Descrição',
'Field' : 'Campo', 'Field': 'Campo',
'General' : 'Geral', 'General': 'Geral',
'Generated with' : 'Gerado com', 'Generated with': 'Gerado com',
'Name' : 'Nome', 'Name': 'Nome',
'No response values.' : 'Sem valores de resposta.', 'No response values.': 'Sem valores de resposta.',
'optional' : 'opcional', 'optional': 'opcional',
'Parameter' : 'Parâmetro', 'Parameter': 'Parâmetro',
'Permission:' : 'Permissão:', 'Permission:': 'Permissão:',
'Response' : 'Resposta', 'Response': 'Resposta',
'Send' : 'Enviar', 'Send': 'Enviar',
'Send a Sample Request' : 'Enviar um Exemplo de Pedido', 'Send a Sample Request': 'Enviar um Exemplo de Pedido',
'show up to version:' : 'aparecer para a versão:', 'show up to version:': 'aparecer para a versão:',
'Size range:' : 'Faixa de tamanho:', 'Size range:': 'Faixa de tamanho:',
'Type' : 'Tipo', 'Type': 'Tipo',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
ro: { ro: {
'Allowed values:' : 'Valori permise:', 'Allowed values:': 'Valori permise:',
'Compare all with predecessor': 'Compară toate cu versiunea precedentă', 'Compare all with predecessor': 'Compară toate cu versiunea precedentă',
'compare changes to:' : 'compară cu versiunea:', 'compare changes to:': 'compară cu versiunea:',
'compared to' : 'comparat cu', 'compared to': 'comparat cu',
'Default value:' : 'Valoare implicită:', 'Default value:': 'Valoare implicită:',
'Description' : 'Descriere', 'Description': 'Descriere',
'Field' : 'Câmp', 'Field': 'Câmp',
'General' : 'General', 'General': 'General',
'Generated with' : 'Generat cu', 'Generated with': 'Generat cu',
'Name' : 'Nume', 'Name': 'Nume',
'No response values.' : 'Nici o valoare returnată.', 'No response values.': 'Nici o valoare returnată.',
'optional' : 'opțional', 'optional': 'opțional',
'Parameter' : 'Parametru', 'Parameter': 'Parametru',
'Permission:' : 'Permisiune:', 'Permission:': 'Permisiune:',
'Response' : 'Răspuns', 'Response': 'Răspuns',
'Send' : 'Trimite', 'Send': 'Trimite',
'Send a Sample Request' : 'Trimite o cerere de probă', 'Send a Sample Request': 'Trimite o cerere de probă',
'show up to version:' : 'arată până la versiunea:', 'show up to version:': 'arată până la versiunea:',
'Size range:' : 'Interval permis:', 'Size range:': 'Interval permis:',
'Type' : 'Tip', 'Type': 'Tip',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
ru: { ru: {
'Allowed values:' : 'Допустимые значения:', 'Allowed values:': 'Допустимые значения:',
'Compare all with predecessor': 'Сравнить с предыдущей версией', 'Compare all with predecessor': 'Сравнить с предыдущей версией',
'compare changes to:' : 'сравнить с:', 'compare changes to:': 'сравнить с:',
'compared to' : 'в сравнении с', 'compared to': 'в сравнении с',
'Default value:' : 'По умолчанию:', 'Default value:': 'По умолчанию:',
'Description' : 'Описание', 'Description': 'Описание',
'Field' : 'Название', 'Field': 'Название',
'General' : 'Общая информация', 'General': 'Общая информация',
'Generated with' : 'Сгенерировано с помощью', 'Generated with': 'Сгенерировано с помощью',
'Name' : 'Название', 'Name': 'Название',
'No response values.' : 'Нет значений для ответа.', 'No response values.': 'Нет значений для ответа.',
'optional' : 'необязательный', 'optional': 'необязательный',
'Parameter' : 'Параметр', 'Parameter': 'Параметр',
'Permission:' : 'Разрешено:', 'Permission:': 'Разрешено:',
'Response' : 'Ответ', 'Response': 'Ответ',
'Send' : 'Отправить', 'Send': 'Отправить',
'Send a Sample Request' : 'Отправить тестовый запрос', 'Send a Sample Request': 'Отправить тестовый запрос',
'show up to version:' : 'показать версию:', 'show up to version:': 'показать версию:',
'Size range:' : 'Ограничения:', 'Size range:': 'Ограничения:',
'Type' : 'Тип', 'Type': 'Тип',
'url' : 'URL' 'url': 'URL'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
tr: { tr: {
'Allowed values:' : 'İzin verilen değerler:', 'Allowed values:': 'İzin verilen değerler:',
'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır', 'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır',
'compare changes to:' : 'değişiklikleri karşılaştır:', 'compare changes to:': 'değişiklikleri karşılaştır:',
'compared to' : 'karşılaştır', 'compared to': 'karşılaştır',
'Default value:' : 'Varsayılan değer:', 'Default value:': 'Varsayılan değer:',
'Description' : 'Açıklama', 'Description': 'Açıklama',
'Field' : 'Alan', 'Field': 'Alan',
'General' : 'Genel', 'General': 'Genel',
'Generated with' : 'Oluşturan', 'Generated with': 'Oluşturan',
'Name' : 'İsim', 'Name': 'İsim',
'No response values.' : 'Dönüş verisi yok.', 'No response values.': 'Dönüş verisi yok.',
'optional' : 'opsiyonel', 'optional': 'opsiyonel',
'Parameter' : 'Parametre', 'Parameter': 'Parametre',
'Permission:' : 'İzin:', 'Permission:': 'İzin:',
'Response' : 'Dönüş', 'Response': 'Dönüş',
'Send' : 'Gönder', 'Send': 'Gönder',
'Send a Sample Request' : 'Örnek istek gönder', 'Send a Sample Request': 'Örnek istek gönder',
'show up to version:' : 'bu versiyona kadar göster:', 'show up to version:': 'bu versiyona kadar göster:',
'Size range:' : 'Boyut aralığı:', 'Size range:': 'Boyut aralığı:',
'Type' : 'Tip', 'Type': 'Tip',
'url' : 'url' 'url': 'url'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
vi: { vi: {
'Allowed values:' : 'Giá trị chấp nhận:', 'Allowed values:': 'Giá trị chấp nhận:',
'Compare all with predecessor': 'So sánh với tất cả phiên bản trước', 'Compare all with predecessor': 'So sánh với tất cả phiên bản trước',
'compare changes to:' : 'so sánh sự thay đổi với:', 'compare changes to:': 'so sánh sự thay đổi với:',
'compared to' : 'so sánh với', 'compared to': 'so sánh với',
'Default value:' : 'Giá trị mặc định:', 'Default value:': 'Giá trị mặc định:',
'Description' : 'Chú thích', 'Description': 'Chú thích',
'Field' : 'Trường dữ liệu', 'Field': 'Trường dữ liệu',
'General' : 'Tổng quan', 'General': 'Tổng quan',
'Generated with' : 'Được tạo bởi', 'Generated with': 'Được tạo bởi',
'Name' : 'Tên', 'Name': 'Tên',
'No response values.' : 'Không có kết quả trả về.', 'No response values.': 'Không có kết quả trả về.',
'optional' : 'Tùy chọn', 'optional': 'Tùy chọn',
'Parameter' : 'Tham số', 'Parameter': 'Tham số',
'Permission:' : 'Quyền hạn:', 'Permission:': 'Quyền hạn:',
'Response' : 'Kết quả', 'Response': 'Kết quả',
'Send' : 'Gửi', 'Send': 'Gửi',
'Send a Sample Request' : 'Gửi một yêu cầu mẫu', 'Send a Sample Request': 'Gửi một yêu cầu mẫu',
'show up to version:' : 'hiển thị phiên bản:', 'show up to version:': 'hiển thị phiên bản:',
'Size range:' : 'Kích cỡ:', 'Size range:': 'Kích cỡ:',
'Type' : 'Kiểu', 'Type': 'Kiểu',
'url' : 'liên kết' 'url': 'liên kết'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
zh: { zh: {
'Allowed values:' : '允許值:', 'Allowed values:': '允許值:',
'Compare all with predecessor': '預先比較所有', 'Compare all with predecessor': '預先比較所有',
'compare changes to:' : '比較變更:', 'compare changes to:': '比較變更:',
'compared to' : '對比', 'compared to': '對比',
'Default value:' : '默認值:', 'Default value:': '默認值:',
'Description' : '描述', 'Description': '描述',
'Field' : '字段', 'Field': '字段',
'General' : '概括', 'General': '概括',
'Generated with' : '生成工具', 'Generated with': '生成工具',
'Name' : '名稱', 'Name': '名稱',
'No response values.' : '無對應資料.', 'No response values.': '無對應資料.',
'optional' : '選項', 'optional': '選項',
'Parameter' : '參數', 'Parameter': '參數',
'Permission:' : '允許:', 'Permission:': '允許:',
'Response' : '回應', 'Response': '回應',
'Send' : '發送', 'Send': '發送',
'Send a Sample Request' : '發送試用需求', 'Send a Sample Request': '發送試用需求',
'show up to version:' : '顯示到版本:', 'show up to version:': '顯示到版本:',
'Size range:' : '尺寸範圍:', 'Size range:': '尺寸範圍:',
'Type' : '類型', 'Type': '類型',
'url' : '網址' 'url': '網址'
} }
}); });

Voir le fichier

@ -1,25 +1,25 @@
define({ define({
'zh_cn': { 'zh_cn': {
'Allowed values:' : '允许值:', 'Allowed values:': '允许值:',
'Compare all with predecessor': '与所有较早的比较', 'Compare all with predecessor': '与所有较早的比较',
'compare changes to:' : '将当前版本与指定版本比较:', 'compare changes to:': '将当前版本与指定版本比较:',
'compared to' : '相比于', 'compared to': '相比于',
'Default value:' : '默认值:', 'Default value:': '默认值:',
'Description' : '描述', 'Description': '描述',
'Field' : '字段', 'Field': '字段',
'General' : '概要', 'General': '概要',
'Generated with' : '基于', 'Generated with': '基于',
'Name' : '名称', 'Name': '名称',
'No response values.' : '无返回值.', 'No response values.': '无返回值.',
'optional' : '可选', 'optional': '可选',
'Parameter' : '参数', 'Parameter': '参数',
'Permission:' : '权限:', 'Permission:': '权限:',
'Response' : '返回', 'Response': '返回',
'Send' : '发送', 'Send': '发送',
'Send a Sample Request' : '发送示例请求', 'Send a Sample Request': '发送示例请求',
'show up to version:' : '显示到指定版本:', 'show up to version:': '显示到指定版本:',
'Size range:' : '取值范围:', 'Size range:': '取值范围:',
'Type' : '类型', 'Type': '类型',
'url' : '网址' 'url': '网址'
} }
}); });

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -13,8 +13,11 @@ import (
var config *Config var config *Config
var once sync.Once var once sync.Once
// Configpaths default configuration file paths
var Configpaths = []string{"config/config.yml", "config/default_config.yml"} var Configpaths = []string{"config/config.yml", "config/default_config.yml"}
// Get config variable
func Get() *Config { func Get() *Config {
once.Do(func() { once.Do(func() {
config = &Config{} config = &Config{}

Voir le fichier

@ -2,4 +2,4 @@
# Please, do not change default_config, create your own config.yml # Please, do not change default_config, create your own config.yml
# You do not have to change every values, just set here what you want to edit # You do not have to change every values, just set here what you want to edit
# For example, if you just want to change the port, just write: # For example, if you just want to change the port, just write:
#port: 9998 #port: 9998

Voir le fichier

@ -58,4 +58,4 @@
* } * }
* *
* @apiUse NotFoundError * @apiUse NotFoundError
*/ */

Voir le fichier

@ -54,7 +54,7 @@ func getTorrentList(c *gin.Context) (torrents []models.Torrent, createdAsTime ti
} }
if userID != "" { if userID != "" {
userIDnum := 0 var userIDnum int
userIDnum, err = strconv.Atoi(html.EscapeString(userID)) userIDnum, err = strconv.Atoi(html.EscapeString(userID))
// Should we have a feed for anonymous uploads? // Should we have a feed for anonymous uploads?
if err != nil || userIDnum == 0 { if err != nil || userIDnum == 0 {

Voir le fichier

@ -17,7 +17,7 @@ import (
// RSSTorznabHandler : Controller for displaying rss feed, accepting common search arguments // RSSTorznabHandler : Controller for displaying rss feed, accepting common search arguments
func RSSTorznabHandler(c *gin.Context) { func RSSTorznabHandler(c *gin.Context) {
t := c.Query("t") t := c.Query("t")
rss := "" var rss string
title := "Nyaa Pantsu" title := "Nyaa Pantsu"
if config.IsSukebei() { if config.IsSukebei() {
title = "Sukebei Pantsu" title = "Sukebei Pantsu"

Voir le fichier

@ -11,7 +11,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
// Middleware for managing errors on status // ErrorMiddleware for managing errors on status
func ErrorMiddleware() gin.HandlerFunc { func ErrorMiddleware() gin.HandlerFunc {
return func(c *gin.Context) { return func(c *gin.Context) {
c.Next() c.Next()

Voir le fichier

@ -113,7 +113,7 @@ func torrentManyAction(c *gin.Context) {
} }
/* Changes are done, we save */ /* Changes are done, we save */
_, err := torrent.UpdateUnscope() _, err = torrent.UpdateUnscope()
if err == nil { if err == nil {
if torrent.Uploader == nil { if torrent.Uploader == nil {
torrent.Uploader = &models.User{} torrent.Uploader = &models.User{}

Voir le fichier

@ -14,7 +14,7 @@ func TorrentReassignModPanel(c *gin.Context) {
templates.Form(c, "admin/reassign.jet.html", torrentValidator.ReassignForm{}) templates.Form(c, "admin/reassign.jet.html", torrentValidator.ReassignForm{})
} }
// ExecuteAction : Function for applying the changes from ReassignForm // ExecuteReassign : Function for applying the changes from ReassignForm
func ExecuteReassign(f *torrentValidator.ReassignForm) (int, error) { func ExecuteReassign(f *torrentValidator.ReassignForm) (int, error) {
var toBeChanged []uint var toBeChanged []uint
var err error var err error

Voir le fichier

@ -17,13 +17,13 @@ import (
func SeePublicSettingsHandler(c *gin.Context) { func SeePublicSettingsHandler(c *gin.Context) {
_, Tlang := publicSettings.GetTfuncAndLanguageFromRequest(c) _, Tlang := publicSettings.GetTfuncAndLanguageFromRequest(c)
availableLanguages := publicSettings.GetAvailableLanguages() availableLanguages := publicSettings.GetAvailableLanguages()
languagesJson := templates.LanguagesJSONResponse{Tlang.Tag, availableLanguages} languagesJSON := templates.LanguagesJSONResponse{Tlang.Tag, availableLanguages}
contentType := c.Request.Header.Get("Content-Type") contentType := c.Request.Header.Get("Content-Type")
if contentType == "application/json" { if contentType == "application/json" {
c.Header("Content-Type", "application/json") c.Header("Content-Type", "application/json")
c.JSON(http.StatusOK, languagesJson) c.JSON(http.StatusOK, languagesJSON)
} else { } else {
templates.Form(c, "site/user/public/settings.jet.html", languagesJson) templates.Form(c, "site/user/public/settings.jet.html", languagesJSON)
} }
} }

Voir le fichier

@ -4,4 +4,4 @@ You can use this API without being logged or any token API
## Except for Upload ## Except for Upload
When you upload, you have to provide your username and api token! When you upload, you have to provide your username and API token!

Voir le fichier

@ -579,7 +579,7 @@
"id": "moderation", "id": "moderation",
"translation": "Moderation" "translation": "Moderation"
}, },
{ {
"id": "who_is_renchon", "id": "who_is_renchon",
"translation": "Wer zum Teufel ist <span lang=\"ja\">れんちょん</span>?" "translation": "Wer zum Teufel ist <span lang=\"ja\">れんちょん</span>?"
}, },

Voir le fichier

@ -1440,16 +1440,16 @@
"translation": "%s must be less than the current Date & Time" "translation": "%s must be less than the current Date & Time"
}, },
{ {
"id":"error_less_array", "id": "error_less_array",
"translation":"%s must contain less than %s items" "translation": "%s must contain less than %s items"
}, },
{ {
"id": "error_less_length", "id": "error_less_length",
"translation": "%s must be less than %s in length" "translation": "%s must be less than %s in length"
}, },
{ {
"id":"error_less_number", "id": "error_less_number",
"translation":"%s must be less than %s" "translation": "%s must be less than %s"
}, },
{ {
"id": "error_less_equal_date", "id": "error_less_equal_date",
@ -1476,35 +1476,35 @@
"translation": "%s must be equal or less to %s" "translation": "%s must be equal or less to %s"
}, },
{ {
"id":"error_max_length", "id": "error_max_length",
"translation":"Maximal length of %s required for the input: %s" "translation": "Maximal length of %s required for the input: %s"
}, },
{ {
"id":"error_max_number", "id": "error_max_number",
"translation":"%s must be %s or less" "translation": "%s must be %s or less"
}, },
{ {
"id":"error_max_array", "id": "error_max_array",
"translation":"%s must contain at maximum %s items" "translation": "%s must contain at maximum %s items"
}, },
{ {
"id":"error_length", "id": "error_length",
"translation":"Length of %s required for the input: %s" "translation": "Length of %s required for the input: %s"
}, },
{ {
"id":"error_equal", "id": "error_equal",
"translation": "%s is not equal to %s" "translation": "%s is not equal to %s"
}, },
{ {
"id":"error_same_value", "id": "error_same_value",
"translation": "Field '%s' must have the same value as the field '%s'" "translation": "Field '%s' must have the same value as the field '%s'"
}, },
{ {
"id":"error_field", "id": "error_field",
"translation": "Unexpected error on field: %s" "translation": "Unexpected error on field: %s"
}, },
{ {
"id":"error_not_equal", "id": "error_not_equal",
"translation": "%s should not be equal to %s" "translation": "%s should not be equal to %s"
}, },
{ {
@ -1680,7 +1680,7 @@
"translation": "No username/password entered" "translation": "No username/password entered"
}, },
{ {
"id":"account_banned", "id": "account_banned",
"translation": "Account banned" "translation": "Account banned"
}, },
{ {

Voir le fichier

@ -1,4 +1,4 @@
[ [
{ {
"id": "rules", "id": "rules",
"translation": "Règlement" "translation": "Règlement"
@ -1437,7 +1437,7 @@
}, },
{ {
"id": "error_less_array", "id": "error_less_array",
"translation":"%s doit contenir moins de %s items" "translation": "%s doit contenir moins de %s items"
}, },
{ {
"id": "error_less_length", "id": "error_less_length",
@ -1445,7 +1445,7 @@
}, },
{ {
"id": "error_less_number", "id": "error_less_number",
"translation":"%s doit être inférieur à %s" "translation": "%s doit être inférieur à %s"
}, },
{ {
"id": "error_less_equal_date", "id": "error_less_equal_date",

Voir le fichier

@ -1364,11 +1364,11 @@
"translation": "Minimal length of %s required for the input: %s" "translation": "Minimal length of %s required for the input: %s"
}, },
{ {
"id":"error_max_length", "id": "error_max_length",
"translation":"Maximal length of %s required for the input: %s" "translation": "Maximal length of %s required for the input: %s"
}, },
{ {
"id":"error_same_value", "id": "error_same_value",
"translation": "Must be same %s" "translation": "Must be same %s"
}, },
{ {

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -548,7 +548,7 @@
"translation": "Real Life" "translation": "Real Life"
}, },
{ {
"id": "real_life_photobooks_and_pictures", "id": "real_life_photobooks_and_pictures",
"translation": "Real Life - Fotoboeken en Afbeeldingen" "translation": "Real Life - Fotoboeken en Afbeeldingen"
}, },
{ {

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Fichier diff supprimé car celui-ci est trop grand Voir la Diff

Voir le fichier

@ -339,7 +339,7 @@
"id": "all_categories", "id": "all_categories",
"translation": "ทุกหมวดหมู่" "translation": "ทุกหมวดหมู่"
}, },
{ {
"id": "select_a_torrent_category", "id": "select_a_torrent_category",
"translation": "เลือกหมวดหมู่ทอร์เรนท์" "translation": "เลือกหมวดหมู่ทอร์เรนท์"
}, },
@ -651,7 +651,7 @@
"id": "delete", "id": "delete",
"translation": "ลบ" "translation": "ลบ"
}, },
{ {
"id": "website_link", "id": "website_link",
"translation": "ลิงค์เว็บ" "translation": "ลิงค์เว็บ"
}, },
@ -726,7 +726,7 @@
{ {
"id": "server_status_link", "id": "server_status_link",
"translation": "สามารถดูสถานะของเซิร์ฟเวอร์ได้ที่นี่" "translation": "สามารถดูสถานะของเซิร์ฟเวอร์ได้ที่นี่"
}, },
{ {
"id": "no_database_dumps_available", "id": "no_database_dumps_available",
"translation": "ยังไม่มีไฟล์ดัมพ์ฐานข้อมูลในขณะนี้" "translation": "ยังไม่มีไฟล์ดัมพ์ฐานข้อมูลในขณะนี้"

Voir le fichier

@ -6,6 +6,7 @@ import (
"github.com/patrickmn/go-cache" "github.com/patrickmn/go-cache"
) )
// C global cache variable
var C *cache.Cache var C *cache.Cache
func init() { func init() {

Voir le fichier

@ -12,10 +12,12 @@ type Category struct {
Name string Name string
} }
// Cateogories is a struct defining an array of categories // Categories is a struct defining an array of categories
type Categories []Category type Categories []Category
var categories Categories var categories Categories
// Index variable
var Index map[string]int var Index map[string]int
// InitCategories init the categories and index variables. Exported for tests // InitCategories init the categories and index variables. Exported for tests

Voir le fichier

@ -159,7 +159,7 @@ func setUserToContext(c *gin.Context, val *models.User) {
context.Set(c.Request, UserContextKey, val) context.Set(c.Request, UserContextKey, val)
} }
// RetrieveUser retrieves a user. // RetrieveUserFromRequest retrieves a user.
func RetrieveUserFromRequest(c *gin.Context, id uint) (*models.User, bool, uint, int, error) { func RetrieveUserFromRequest(c *gin.Context, id uint) (*models.User, bool, uint, int, error) {
var user models.User var user models.User
var currentUserID uint var currentUserID uint

Voir le fichier

@ -13,7 +13,7 @@ import (
"github.com/gorilla/feeds" "github.com/gorilla/feeds"
) )
// private wrapper around the RssFeed which gives us the <rss>..</rss> xml // rssFeedXML private wrapper around the RssFeed which gives us the <rss>..</rss> xml
type rssFeedXML struct { type rssFeedXML struct {
XMLName xml.Name `xml:"rss"` XMLName xml.Name `xml:"rss"`
Xmlns string `xml:"xmlns:torznab,attr,omitempty"` Xmlns string `xml:"xmlns:torznab,attr,omitempty"`
@ -23,6 +23,7 @@ type rssFeedXML struct {
Caps *RssCaps `xml:"caps,omitempty"` Caps *RssCaps `xml:"caps,omitempty"`
} }
// RssImage RSS image struct
type RssImage struct { type RssImage struct {
XMLName xml.Name `xml:"image"` XMLName xml.Name `xml:"image"`
URL string `xml:"url"` URL string `xml:"url"`
@ -32,6 +33,7 @@ type RssImage struct {
Height int `xml:"height,omitempty"` Height int `xml:"height,omitempty"`
} }
// RssTextInput RSS text struct
type RssTextInput struct { type RssTextInput struct {
XMLName xml.Name `xml:"textInput"` XMLName xml.Name `xml:"textInput"`
Title string `xml:"title"` Title string `xml:"title"`
@ -40,11 +42,13 @@ type RssTextInput struct {
Link string `xml:"link"` Link string `xml:"link"`
} }
// RssMagnetLink RSS struct for magnet links
type RssMagnetLink struct { type RssMagnetLink struct {
XMLName xml.Name `xml:"link"` XMLName xml.Name `xml:"link"`
Text string `xml:",cdata"` Text string `xml:",cdata"`
} }
// RssFeed RSS feed struct
type RssFeed struct { type RssFeed struct {
XMLName xml.Name `xml:"channel"` XMLName xml.Name `xml:"channel"`
Xmlns string `xml:"-"` Xmlns string `xml:"-"`
@ -70,6 +74,7 @@ type RssFeed struct {
Items []*RssItem Items []*RssItem
} }
// RssItem struct for rss feed items
type RssItem struct { type RssItem struct {
XMLName xml.Name `xml:"item"` XMLName xml.Name `xml:"item"`
Title string `xml:"title"` // required Title string `xml:"title"` // required
@ -86,6 +91,7 @@ type RssItem struct {
Torznab []*RssTorznab Torznab []*RssTorznab
} }
// RssCaps xml struct for torznab caps
type RssCaps struct { type RssCaps struct {
XMLName xml.Name `xml:"caps"` XMLName xml.Name `xml:"caps"`
Server *RssServer `xml:"server,omitempty"` Server *RssServer `xml:"server,omitempty"`
@ -95,6 +101,7 @@ type RssCaps struct {
Categories *RssCategories `xml:"categories,omitempty"` Categories *RssCategories `xml:"categories,omitempty"`
} }
// RssServer basic server information
type RssServer struct { type RssServer struct {
XMLName xml.Name `xml:"server"` XMLName xml.Name `xml:"server"`
Xmlns string `xml:"xmlns,attr"` Xmlns string `xml:"xmlns,attr"`
@ -106,18 +113,21 @@ type RssServer struct {
Image string `xml:"image,attr"` Image string `xml:"image,attr"`
} }
// RssLimits struct for max results
type RssLimits struct { type RssLimits struct {
XMLName xml.Name `xml:"limits"` XMLName xml.Name `xml:"limits"`
Max string `xml:"max,attr"` Max string `xml:"max,attr"`
Default string `xml:"default,attr"` Default string `xml:"default,attr"`
} }
// RssRegistration torznab registration information
type RssRegistration struct { type RssRegistration struct {
XMLName xml.Name `xml:"registration"` XMLName xml.Name `xml:"registration"`
Available string `xml:"available,attr"` Available string `xml:"available,attr"`
Open string `xml:"open,attr"` Open string `xml:"open,attr"`
} }
// RssSearching struct for supported search types
type RssSearching struct { type RssSearching struct {
XMLName xml.Name `xml:"searching"` XMLName xml.Name `xml:"searching"`
Search *RssSearch `xml:"search,omitempty"` Search *RssSearch `xml:"search,omitempty"`
@ -125,16 +135,19 @@ type RssSearching struct {
MovieSearch *RssSearch `xml:"movie-search,omitempty"` MovieSearch *RssSearch `xml:"movie-search,omitempty"`
} }
// RssSearch struct for supported searching params
type RssSearch struct { type RssSearch struct {
Available string `xml:"available,attr"` Available string `xml:"available,attr"`
SupportedParams string `xml:"supportedParams,attr,omitempty"` SupportedParams string `xml:"supportedParams,attr,omitempty"`
} }
// RssCategories categories for rss
type RssCategories struct { type RssCategories struct {
XMLName xml.Name `xml:"categories"` XMLName xml.Name `xml:"categories"`
Category []*RssCategoryTorznab Category []*RssCategoryTorznab
} }
// RssCategoryTorznab categories for torznab
type RssCategoryTorznab struct { type RssCategoryTorznab struct {
XMLName xml.Name `xml:"category"` XMLName xml.Name `xml:"category"`
ID string `xml:"id,attr"` ID string `xml:"id,attr"`
@ -143,6 +156,7 @@ type RssCategoryTorznab struct {
Description string `xml:"description,attr,omitempty"` Description string `xml:"description,attr,omitempty"`
} }
// RssSubCat sub category
type RssSubCat struct { type RssSubCat struct {
XMLName xml.Name `xml:"subcat"` XMLName xml.Name `xml:"subcat"`
ID string `xml:"id,attr"` ID string `xml:"id,attr"`
@ -150,6 +164,7 @@ type RssSubCat struct {
Description string `xml:"description,attr,omitempty"` Description string `xml:"description,attr,omitempty"`
} }
// RssTorrent item for torrents
type RssTorrent struct { type RssTorrent struct {
XMLName xml.Name `xml:"torrent"` XMLName xml.Name `xml:"torrent"`
Xmlns string `xml:"xmlns,attr"` Xmlns string `xml:"xmlns,attr"`
@ -159,6 +174,7 @@ type RssTorrent struct {
MagnetURI string `xml:"magnetUri,omitempty"` MagnetURI string `xml:"magnetUri,omitempty"`
} }
// RssTorznab feed for torznab
type RssTorznab struct { type RssTorznab struct {
XMLName xml.Name `xml:"torznab:attr,omitempty"` XMLName xml.Name `xml:"torznab:attr,omitempty"`
Name string `xml:"name,attr,omitempty"` Name string `xml:"name,attr,omitempty"`
@ -171,6 +187,7 @@ type RssCategory struct {
Domain string `xml:"domain"` Domain string `xml:"domain"`
} }
// RssEnclosure enclosure for downloads
type RssEnclosure struct { type RssEnclosure struct {
//RSS 2.0 <enclosure url="http://example.com/file.mp3" length="123456789" type="audio/mpeg" /> //RSS 2.0 <enclosure url="http://example.com/file.mp3" length="123456789" type="audio/mpeg" />
XMLName xml.Name `xml:"enclosure"` XMLName xml.Name `xml:"enclosure"`
@ -179,6 +196,7 @@ type RssEnclosure struct {
Type string `xml:"type,attr"` Type string `xml:"type,attr"`
} }
// Rss struct
type Rss struct { type Rss struct {
*feeds.Feed *feeds.Feed
} }
@ -241,22 +259,22 @@ func (r *Rss) RssFeed() *RssFeed {
return channel return channel
} }
// FeedXml : return an XML-Ready object for an Rss object // FeedXML : return an XML-Ready object for an Rss object
func (r *Rss) FeedXml() interface{} { func (r *Rss) FeedXML() interface{} {
// only generate version 2.0 feeds for now // only generate version 2.0 feeds for now
return r.RssFeed().FeedXml() return r.RssFeed().FeedXML()
} }
// FeedXml : return an XML-ready object for an RssFeed object // FeedXML : return an XML-ready object for an RssFeed object
func (r *RssFeed) FeedXml() interface{} { func (r *RssFeed) FeedXML() interface{} {
if r.Xmlns != "" { if r.Xmlns != "" {
return &rssFeedXML{Version: "2.0", Encoding: "UTF-8", Channel: r, Xmlns: r.Xmlns} return &rssFeedXML{Version: "2.0", Encoding: "UTF-8", Channel: r, Xmlns: r.Xmlns}
} }
return &rssFeedXML{Version: "2.0", Encoding: "UTF-8", Channel: r} return &rssFeedXML{Version: "2.0", Encoding: "UTF-8", Channel: r}
} }
// FeedXml : return an XML-ready object for an RssFeed object // FeedXML : return an XML-ready object for an RssFeed object
func (r *RssCaps) FeedXml() interface{} { func (r *RssCaps) FeedXML() interface{} {
return r return r
} }

Voir le fichier

@ -29,10 +29,11 @@ var htmlFlags = 0 |
md.HTML_HREF_TARGET_BLANK md.HTML_HREF_TARGET_BLANK
func init() { func init() {
HtmlMdRenderer = md.HtmlRenderer(htmlFlags, "", "") HTMLMdRenderer = md.HtmlRenderer(htmlFlags, "", "")
} }
var HtmlMdRenderer md.Renderer // HTMLMdRenderer render for markdown to html
var HTMLMdRenderer md.Renderer
// MarkdownToHTML : convert markdown to html // MarkdownToHTML : convert markdown to html
// TODO: restrict certain types of markdown // TODO: restrict certain types of markdown
@ -41,7 +42,7 @@ func MarkdownToHTML(markdown string) template.HTML {
markdown = ">" + markdown[4:] markdown = ">" + markdown[4:]
} }
markdown = strings.Replace(markdown, "\n&gt;", "\n>", -1) markdown = strings.Replace(markdown, "\n&gt;", "\n>", -1)
unsafe := md.MarkdownOptions([]byte(markdown), HtmlMdRenderer, md.Options{Extensions: mdOptions}) unsafe := md.MarkdownOptions([]byte(markdown), HTMLMdRenderer, md.Options{Extensions: mdOptions})
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
return template.HTML(html) return template.HTML(html)
} }

Voir le fichier

@ -2,6 +2,7 @@ package structs
import "github.com/NyaaPantsu/nyaa/models" import "github.com/NyaaPantsu/nyaa/models"
// TorrentCache torrent cache struct
type TorrentCache struct { type TorrentCache struct {
Torrents []models.Torrent Torrents []models.Torrent
Count int Count int

Voir le fichier

@ -17,19 +17,34 @@ import (
) )
const ( const (
ShowAll Status = 0 // ShowAll by default show all torrents
FilterRemakes = 2 ShowAll Status = 0
Trusted = 3 // FilterRemakes filter torrent remakes
APlus = 4 FilterRemakes = 2
// Trusted trusted torrents
Trusted = 3
// APlus torrents not used anymore
APlus = 4
) )
// Status torrent status
type Status uint8 type Status uint8
// SortMode selected sort mode
type SortMode uint8 type SortMode uint8
// Category torrent categories
type Category struct { type Category struct {
Main, Sub uint8 Main, Sub uint8
} }
// SizeBytes size in bytes
type SizeBytes uint64 type SizeBytes uint64
// DateFilter date to filter for
type DateFilter string type DateFilter string
// Categories multiple torrent categories
type Categories []*Category type Categories []*Category
// TorrentParam defines all parameters that can be provided when searching for a torrent // TorrentParam defines all parameters that can be provided when searching for a torrent

Voir le fichier

@ -13,6 +13,7 @@ var intEvents struct {
funcs []func() funcs []func()
} }
// OnInterrupt handles signal interupts
func OnInterrupt(fn func()) { func OnInterrupt(fn func()) {
intEvents.lock.Lock() intEvents.lock.Lock()
intEvents.funcs = append(intEvents.funcs, fn) intEvents.funcs = append(intEvents.funcs, fn)

Voir le fichier

@ -8,6 +8,7 @@ import (
"syscall" "syscall"
) )
// Handle handles unix interupts
func Handle() { func Handle() {
chnl := make(chan os.Signal) chnl := make(chan os.Signal)
signal.Notify(chnl, syscall.SIGHUP, os.Interrupt) signal.Notify(chnl, syscall.SIGHUP, os.Interrupt)

Voir le fichier

@ -139,6 +139,7 @@ func IsUTFLetterNumericValidator(fl validator.FieldLevel) bool {
return IsUTFLetterNumeric(value) return IsUTFLetterNumeric(value)
} }
// DefaultValidator default validator
func DefaultValidator(fl validator.FieldLevel) bool { func DefaultValidator(fl validator.FieldLevel) bool {
switch fl.Field().Kind() { switch fl.Field().Kind() {
case reflect.String: case reflect.String: