Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0
Graphe des révisions

111 Révisions

Auteur SHA1 Message Date
kilo d5c2c6b676 Upload to nyaa.si, anidex & TokyoTosho [done] (#1633)
* Update upload.go

* Update helpers.go

* Update template_test.go

* Update upload_multiple.jet.html

* change variable names

* wrong copypaste

* change variable name

* ditto

* Fix travis

* Update main.css

* Update upload.go

* Update upload.jet.html

* Update main.css

* Update upload.go

* More compact form

* CSS changes to go along

* Update main.css

* Update upload.jet.html

* Slightly lower bottom margin

* Update upload_multiple.jet.html

* tomorrow color adjustements

* small css adjustements

* Update upload.go

* Update default_config.yml

* Update default_config.yml

* Update structs.go

* Update user.go

* Update structs.go

* Update upload.go

* Update default_config.yml

* Update upload_multiple.jet.html

* Update upload.go

* Update upload.jet.html

* Update template_test.go

* this one is optional for anidex

* Update default_config.yml

* Possible improvement
As mentionned in my comment, it seems that having a checkbox already checked and disabled for logged in user + having the input text for apikey is a bit tedious.
Moreover, asking to check and fill the input text to upload in anidex when you are not logged is doing things twice. If you don't want to upload to anidex, don't fill the input.

So this commit push a new behaviour:
* If you are logged in and you have filled your anidex/nyaasi api key : the form should only show the checkbox asking if you want to upload to nyaasi.
* If you're not logged in or you don't have filled your api key in your profile settings: you only show the input text for the api key and not the checkbox. If someone wants to upload to nyaasi/anidex, he will just need to fill the input.

* This adds back the support of anonymous upload when logged in or not.
This works simply by checking if the user wants to upload as anon (when he checks the checkbox "upload as anonymous") or by checking the emptyness of apikey.
+ reverts the condition statements since it was needed to have apikey empty

* Forgot to save this file

* This commit adds the go routines for each upload service (anidex, nyaasi, tosho).
New controller and url to check the upload status (/upload/status/:id).
If you add ?json at the end, it outputs a json format of the multi upload status.
To prevent memory overload, we only keep in memory the multiupload status for 5 minutes.
Moved multipleform struct from templates to upload utils.

* fix form display on classic theme

* This commit adds:
* Javascript refreshing of the upload status
* Localization of the pages
* Fixed some bugs

This works, only need to get torrent file now.

* Added a new function to get the Path to the torrent file.

* Added a function to check that a torrent file exists and if not generate it on multiupload

* Enabled file upload through http post request to anidex

* Fixed bugs

* Modified the behaviour to generate torrent preivously. It is a synchrone function now. So we need to make it asynchronous in download.go

Now torrents file are always generated at upload time in a background processus with the correct trackers (needed ones + the ones provided by the user).
I made the anidex tracker as a needed one to allow multiupload even if the user hasn't included in his torrent file/magnet url.

* Moving deadtrackers list to default config
Support torrent file creation when upload without scraping
* Fix possible bug where no one is seeding a torrent yet (first time upload)
Add primary tracker in torrent file

* Fixing issue with boolean pointer for private torrent

* fixing index out of range for announcelist filtering
Fixing anidex tracker not found

* Fixing lang id error

* Anidex upload works

* Fix for multiupload with magnet

* This adds TokyoTosho support. Since TokyoTosho API only support upload by URL (and not torrent file upload). We need to make the download url available without ddos protection.

Also TokyoTosho doesn't need a category select. Since it does have limited option, we can automatically convert our categories to the tokyotosho one.

* Removing the folder tosho and put categories.go directly in upload package.
Added category conversion for nyaasi too.
Added tests on category conversion.

* This should add nyaasi support.
Is not tested though.

* Updated defaut config with new nyaa.si behaviour?

* Forgot to commit this file
2018-01-03 18:21:07 +10:00
kilo 0a765b5589 Things (#1740)
* Add new followers directly to user.Followers

* Update user.go

* Remove useless condition

* Query an update of user followers if at 0 when looking at his profile

* Fix comment not appearing until you refreshed the torrent page

* call ViewHandler so that comments visually update properly

* Remove now useless imports

* Add "uploader" userstatus in comment

* GetLikings() & GetFollowers() now return count too

* Don't update follower count here

* Update follower count directly here

* show liking count

* Update user.go

* Update profile.jet.html

* Update torrentParam.go

* Fix locked torrents that were shown even when they should not

* Update torrentParam_test.go

* remove inline styling

* Update main.css

* Update upload.jet.html

* Update main.css

* Update tomorrow.css

* Update classic.css

* Update classic_colors.css

* Update index_site.jet.html

* Make announcements support markdown

* Add markdown form to announcement creation

* fix "report" text position

* Add exclude search option to exclude words

* Make sure the "NameLike" value is the search query because we edit it during a search

* Show search content in page title for /feed too

* rollback

* Add "Search" variable that shows exactly what is being searched

* Use "Search.Search" variable here instead of NameLike because NameLike is edited

* Update torrentParam_test.go

* Update torrentParam.go

* remove redundant spaces from NameLike

* Update torrentParam.go

* Update torrentParam.go

* Update torrentParam.go

* Update torrentParam.go

* turn date input into type date

* bigger date inputs

* add support for YYYY-MM-DD dates

* rollback this change

* rollback

* Update search.jet.html

* Update helpers.go

* Update template_functions.go

* Update torrentParam.go

* only uploader & staff can comment on locked torrents

* Add "Upload to Nyaa/Sukebei" button for mods

* Update torrentlist.jet.html

* Update view.jet.html

* Update view.jet.html

* fix wrong page title for notifications page
2017-11-20 11:13:00 +10:00
kilo 5dcd30676f
Janitor (#1728)
* Fix "torrent is being generated" message showing up even when the torrent couldn't be generated

* Add janitor user status

* Remove usage of deprecated HasAdmin() function

* Give Janitors access to mod panel

* Stop using deprecated HasAdmin() function

* Stop using deprecated HasAdmin() function

* Update edit.go

* Update profile.go

* Rollback bad changes, remove redundant email check and stop using deprecated function

* Show every userstatus (member, janitor, banned, mod) in comments

* Return empty status if anonymous

* Show no userstatus for anonymous profile

* Show moderation link to janitors too

* Stop using deprecated HasAdmin() function

* Stop using deprecated HasAdmin() function

* Stop using deprecated HasAdmin() function

* Add Janitor to userstatus select in user edit

* "Janitor" translation string

* didnt mean to commit this change

* rollback wrongfully comitted changes

* rollback commit

* Update CHANGELOG.md

* Fix wrong id for translation

* remove deprecated HasAdmin() function again

* change name of variable used in comment loop for clarity purposes

* visual cue for locked torrents in torrent listing for admins

* add visual cues for hidden torrents in admin torrent listing

* Dont show delete buttons for janitors

* janitor cannot delete torrents

* show block/unblock button in torrent list for janitors instead of delete button

* fix function that didnt get executed

* add ban buttons on userlist & visual cue for banned users

* Fix "user successfully deleted" message showing even if user wasnt deleted

* Add "ban" button, no "delete" button for jantiors

* add "unban" and "ban" translation strings

* add "unban" and "ban" translation strings

* different <form> for ban button

* Update index.jet.html

* add userprofile ban route

* add toggleBan() function, janitors dont need captcha either

* fix panic error when deleting an anonymous comment

* add user_banned_by and user_unbanned_by

* add user_banned_by and user_unbanned_by

* Make ToggleBan() return whether or not the user is now banned

* Add handler for /ban route

* change log filter

* hide locked torrents from regular users

* hide locked torrents from regular users

* hide locked torrent from api search for regular users

* change function to CurrentOrJanitor

* change function to currentorjanitor

* change function to currentorjanitor

* add CurrentOrJanitor function

* fix extra (

* fix extra ) and wrong variable name

* Fix wrong value for janitor user status

* Fix user edit that did not work because of "unique constraint user.emails" error

* only immediately visually update user if user has been updated successfully

* use FindAllForAdminsOrderBy in order to preload users

* create FindAllForAdminsOrderBy that preloads users

* Show username instead of ID in Uploader column in admin panel

* Fix userprofile buttons overflowing at some specific resolutions

* Mods can set users as janitors

* Show ban/unban buttons on userprofile for janitors

* Identical styling for usermenu links and buttons

* dont show ban buttons on other staff

* add ban message through get parameter

* make toggleBan() trigger user update

* Add "user_banned" and "user_unbanned"

* add "user_banned" and "user_unbanned"

* Visual cue for banned user

* banned users can still log in

* visual cue for banned user in  badgemenu

* locked status if banned user on upload

* banned users cannot comment

* Put "banned" text between ()

* add GetCategoryName() to template_test

* add GetCategoryName() that returns full category name from full category string

* Show search content in page title if it exists, or search category if it exists, otherwise shows "Home"

* error message when user uploads an torrent & is banned

* add torrent_uploaded_locked

* add torrent_uploaded_locked

* fix delete definitely button that never appeared

* Show delete definitely button on admin panel index

* admins can undelete a torrent by editing it's status

* Trigger ViewHandler() directly instead of redirecting

* Render the template directly instead of triggering torrent view handler

* bigger usermenu buttons once responsive design kicks in

* make btn-* class non-bold

* Responsive notification page

* visual cue for locked torrents in torrent listing

* Update search.go

* Update search.go

* Update api.go

* Update helpers.go

* Update template.go

* Update torrentParam.go

* remove "hidden" class

* Update search.go

* fix an html error

* Add files via upload

* Update admin.jet.html

* Update index.go

* Update index.go

* Update router.go

* Update torrentParam_test.go

* Update torrentParam_test.go

* fix extra "

* fix bad copypaste

* Update CHANGELOG.md

* Update guidelines.jet.html

* Update CHANGELOG.md

* add Guidelines and Moderation Guidelines

* fix missing commas

* Update torrentlist.jet.html

* Update find.go

* Update stats.go

* Update view.jet.html

* Update index.jet.html
2017-11-14 09:39:39 +01:00
kilo 213780f0eb
Small fixes (#1715)
* Update main.css

* saving settings now clear old cookies of current domain

* Update main.js

* Update classic.css

* Update settings.go

* Update main.css

* Update commentlist.jet.html

* Update generate.go

* Update default_config.yml

* Update structs.go

* Update default_config.yml

* Update find.go

* Update find.go

* Update stats.go

* Update interaction.go
2017-11-08 09:32:06 +01:00
kilo ca271e2ac6
Username search for admin comment list, inputs for userid & username search in said comment list (#1713)
* Update comments.go

* Update commentlist.jet.html

* Update comments.go

When you search a username and you have a userid in the url, the conditions string doesn't have "AND" in it. I made the username search a priority and if there is not username provided, it falls back to userid in url.
2017-11-06 09:17:14 +01:00
kilo cc4e0fe5c0
Fix JS for torrent/user deletion that would delete even if you refused to confirm (#1711)
* Update torrentlist.jet.html

* Update index_admin.jet.html
2017-11-04 07:23:10 +01:00
kilo 30570e2fb9
Fix torrent deletion from report list (#1705)
* Update torrent_report.jet.html

* change of color for "delete report" button
2017-11-03 09:09:04 +01:00
kilo 65545d2386
Update announcement_form.jet.html 2017-11-02 04:24:33 +01:00
kilo e14983f56a
Update announcement_form.jet.html 2017-11-02 04:07:44 +01:00
kilo cd6028a0bc
fix travis 2017-10-31 06:45:45 +01:00
kilo 37e1fac280
Update torrent_report.jet.html 2017-10-31 06:24:30 +01:00
kilo 165d7a70ff
Update torrentlist.jet.html 2017-10-31 02:10:21 +01:00
kilo 9618f4f929
Update torrentlist.jet.html 2017-10-31 02:04:54 +01:00
kilo 9e53472cc2
Add files via upload 2017-10-31 00:47:11 +01:00
kilo 0b893ba8c8
Update index.jet.html 2017-10-29 05:04:30 +01:00
kilo 190cd1d113
Update torrent_report.jet.html 2017-10-29 05:01:45 +01:00
akuma06 d3e50b8ffd Fix User delete button (#1662)
* Fix User delete button

Fix #1652
This bug comes from the fact that @kiloutre edited how the form behave and instead of a GET request, do a POST one. However every POST request not in /api or /mod need a CSRF Token to work.

* Update userlist.jet.html

* Update index.jet.html
2017-10-15 01:34:45 +02:00
kilo 3c06b0fc5c Small design fixes (#1657)
* Update main.css

* Update main.css

* fix inline display of delete button

* Update main.css

* Update torrentlist.jet.html

* Update torrent_report.jet.html

* Update torrentlist.jet.html

* Update announcements.jet.html

* Update announcements.jet.html

* Update user.go

* Update tomorrow.css

* Update tomorrow.css
2017-10-12 21:13:04 +02:00
kilo bde8ff4f49 Fix invalid comment date when JS is enabled, wrong url in an admin torrent list link, malformed pubDate for RSS feed (#1654)
* Fix invalid comment date when JS is enabled

* fix travis

* fix wrong url in admin torrent list

* Fix wrong pubDate for /feed

* Different function name

* same changes as rss for magnet rss

* travis test

* fix delete button on torrent view

* Update edit.jet.html

* Update index.jet.html

* Update userlist.jet.html

* Update torrentlist.jet.html
2017-10-12 17:53:04 +02:00
kilo 941aceb9b0 Small changes (#1653)
* Update tomorrow.css

* Update main.css

* Update main.css

* fix invalid date of torrents in user profile

* modify fancy js to work with new form

* enhance fancy JS to adapt to every form

* Update index.jet.html

* Update index_admin.jet.html

* Update torrentlist.jet.html

* what the fuck

* ditto

* forgot to remove the debug alert
2017-10-12 12:22:44 +10:00
kilo 83540ad31c Fix a condition that didn't behave as intended (#1651)
* Update profile.go

* Update router.go

* Update torrents.go

* Update router.go

* Update announcements.go

* Update comments.go

* Update oauth.go

* Update reports.go

* Update router.go

* Update index.jet.html

* Update torrentlist.jet.html

* Update commentlist.jet.html

* Update announcements.jet.html

* Update clientlist.jet.html

* Update torrent_report.jet.html

* Update userlist.jet.html

* Update userlist.jet.html

* Update userlist.jet.html

* Update edit.jet.html

* Update delete.go

* Update edit.jet.html

* Update index.jet.html

* Update profile.go

* Update router.go

* Update profile.go

* Update edit.jet.html

* Update userlist.jet.html

* Update index.jet.html

* remove hotfix that didn't even hit live
2017-10-12 02:54:01 +02:00
kilo c7869fd4fc fancy JS to delete comments faster (#1649) 2017-10-11 19:18:00 +02:00
kilo 4e361ccce0 Prettier tags on upload (#1420)
* HTML changes to have tags in one div

* Add form-input class to tags inputs in upload

to have them look like regular inputs

* CSS changes to make tags inline

* Add changes to torrent edit

* Add changes to admin torrent edit

* attempt at fixing travis

* rollback admin edit in an attempt to fix travis

* Fix tags being visually broken in one very specific resolution

* fuck this shit
2017-08-28 11:42:38 +10:00
akuma06 b3e3ec6083 Fix Navigation Admin Panel (#1398)
* Fix Navigation Admin Panel

* Fix broken html on reassign page

* fix user link in comment list

* Fix Unknown bytes

* Fix switch file upload/magnet

* fix modtools background white + width

* fix /mod/ redirection url

* Fix last torrents on modpanel

* empty torrent file input

* Add hidden class to h3
2017-08-26 12:15:28 +10:00
akuma06 2b4731d16c Dbidlinks (#1396)
* Add Anidb, Vndb, Vgmdb links

* Anidb, Vndb, Vgmdb and Dlsite links into tag design
* Add external links to Anidb, Vndb, Vgmdb and dlsite

* Add filter links to tags

* Filter string translation already exists

* Fix display tags

* Update translation changelog

* Do not display tag type when default
2017-08-26 11:42:12 +10:00
akuma06 c6168be8b1 Tag Search + Tests + Search slight refactor [DONE] (#1342)
* Tag Search + Tests + Search slight refactor

First commit improving search. Different struct have their own file with their tests. This way of separating struct by files is inspired by the go packages I've seen so far.

Added new behaviour as discussed in #1334

* fix fallback to ES

* Added some comments to explain PG fallback + log err moved

* Refactored search

Nearly fully covered
WhereParams struct has disappeared for Query struct instead
In DB model, we use an interface implementing Query struct methods

* 1rst Refactor of Tags (WTF already?!)

Prepare Tags for the refactored system. Now there will be descriptive tags for a particular release (ecchi, BDSM, ....) and typed tags.
Typed tags are tags relevant to all torrents and can be limited to some input value. For example, video quality is a typed tag limited to some values (hd, full hd, sd, ...). In the same way, anidbid is also a typed tag but doesn't have default values.

Furthermore, the location storage of tags have changed, now accepted descriptive tags are stored in the torrents table in the column "tags" and they are separated by commas.
In the opposite, accepted typed tags can have have their own column in the torrents table. For example, anidbid, vndbid will populate the column DbID when accepted. On the other hand, videoquality will populate the same way as descriptive tags.

This behaviour depends on the callbackOnType function in tag/helpers.go

* fix for modtools :')

* Added anidb, vndb, dlsite & vmdb id fields in torrent model.
Tags don't have an accepted field anymore.
Accepted Tags are in torrent.AcceptedTags and non-accepted ones in torrrent.Tags.

New Helper + New Changelog for translation string.

* New upload/edit form for torrent tags.
Now the inputs are dynamically generated by the helper tag_form.
No more modal window in those form, only inputs.
Support of tags in API
New translation string for the  link to the modal on torrent view.
More comments in the functions for tags

* Improving how config for tags work. Adding a test on them with understandable messages.
Config for tags have now a Field attribute which is linked to the Torrent model. For example anidbid tag type has now a AnidbID field in config which is the name of the field in torrent model (AnidbID). Every new tag type need to have a field attribute with its counterpart in torrent Model.
Fixing some errors

* Fix compile error + Tests Errors

* Improve performance by caching the list of tags with an index
Adding/removing tags works/tested
New translation strings

TODO: test/fix adding tag on upload/edit

* Mini fix to display video quality
+ tags works/tested on modo edit

* Fix editing tags on modpanel

* Edit tags works

* Add translation string

* Add search backend for tags.
?tags=xxx,eee,ddd
?anidb=21
?vndb=23
?vgmdb=24
?vq=full_hd

* Fix Ajax tag Removal&Add

* Added form for descriptive tags

* Forgot to add the link between database and form for descriptive tags.

* Adding the increase/decrease pantsu for descriptive tags

* Fix #1370

* When you actually forgot to commit files after having forgotten commits
2017-08-22 11:48:10 +10:00
akuma06 a7a670041a Fixing issues on id when create announcement 2017-08-03 03:54:33 +02:00
akuma06 1dbfe1b3b4 Added moderation part + tests 2017-08-03 03:38:07 +02:00
akuma06 d0a647bf8e fix travis error 2017-08-02 18:04:44 +02:00
akuma06 0db143d685 Possibility to add tags from edit panel + upload 2017-08-01 23:38:13 +02:00
akuma06 03ea72595d OAuth API [done] (#1275)
* Initial Commit for OAuth API

This builds and run and return the right error.
Need to test it and then adding all users as possible client

* Added mising dependency

* just compile already...

* Fixing template test

* Imrpovements

Moved db stuff in models
Added some tests
Added form in modpanel to add/update a client
Added controllers for add/update of client

* Added Forms + speed improvements

Controller oauth client listing + html
Controller oauth client delete + messages
Messages on comment delete
New ES config that disable ES if set to false. Improve load speed on local development
Fix a load config bug
Fix index admin & translation string sign_out broken by @ewhal

* Sanitize empty strig in form array + css

Multiple empty array of strings are sanitized for the oauth client create form
Added some css for the form display

* Upload and Create form works

* Fix splitting response types

* Removing required on secret when updating

* fix travis error

* Fix travis template test

* Update dependency

* Moved to jinzhu instead of azhao

* randomizen secret on creation

* Final touch on oath api

improved display name
fix grant form csrf
fix login csrf on oauth

* Fix gorm test

* fix template test

* Fixing deleted dependency issue

* Make travis faster

* Fix typo

* Fix csrf for api calls

* This shouldn't be exempt

* Removing hard coded hash

@ewhal Don't forget to replace the hash in tokens.go with another one

* Added an example on how to use OAuth middleware

* Renamed fosite utils to oauth2 utils
2017-07-28 13:46:40 +10:00
PantsuDev af94485dfa Fix travis 2017-07-26 11:59:18 +10:00
kilo 6444636467 fix url parse bug (#1279)
* fix url parse bug

* Update site.jet.html

* Update torrentlist.jet.html
2017-07-25 08:27:42 +10:00
PantsuDev cdabd79c03 Fix more style issues 2017-07-24 15:03:43 +10:00
akuma06 d6b018e029 Forgot to commit this file a while ago. This fix torrents not deleted link 2017-07-20 02:25:54 +02:00
akuma06 6bbb2e9801 Preload User on find. Should fix the edit not showing up for anonymous.
Fix issue with hidden checkbox and remake one on chrome.
Refactor flag list on edit/upload form. Now a helper function in flags helper.
2017-07-14 17:53:37 +02:00
akuma06 5be870e21b Add commit from kipukun on simplemde 2017-07-13 13:57:19 +02:00
akuma06 21767877b1 Fixing call to flag method 2017-07-12 12:04:20 +10:00
akuma06 e1d6e7df20 Changing to the new behaviour of package languages 2017-07-12 12:04:20 +10:00
akuma06 f8de340265 Added search refine on every pages + fixed kilo.js 2017-07-10 15:24:52 +02:00
akuma06 6534d02977 Fxing flags checkboxes without flags next to them 2017-07-06 22:42:55 +02:00
akuma06 03ded2e027 Changing catSelect Behavior
Return now Categories object instead of map[string]string.
Remove some debug log
2017-07-06 22:19:44 +02:00
akuma06 c3b3542bad Changed Mark as Hidden
Strings need to be retranslated
2017-07-04 02:57:47 +02:00
akuma06 d4c245e256 Fixing torrent edit for user&admin 2017-07-04 02:40:54 +02:00
akuma06 330ab06597 Adding upload of multi lang full support 2017-07-04 02:07:25 +02:00
akuma06 f3a323d7b8 Fixing html flags rendering 2017-07-03 01:30:06 +02:00
akuma06 b10d5e32b5 Merge branch 'refactor' into second-batch 2017-07-03 00:44:50 +02:00
akuma06 b11c02e54e Fixed templates with new functions 2017-07-03 00:34:18 +02:00
kilo fae254c404 <kilo> u want me to re-make the PR but on the refactor branch, right? (#1087)
* margin-top removal

* flag-other background: none

* torrent language on other - upload.htl

* torrent language edit.html

* torrent language admin edit
2017-06-29 22:16:21 +10:00
akuma06 5991a21818 First batch of changes for the refactor (#1078)
* First batch of changes for the refactor

Added the support of gin in routes and other services/utils
Begining implementation of JetHTML

* Remove os folder

* Move scrapers to own repo

* Second batch of changes

All .jet.html are the working templates.
You can now test this PR, the index Page and upload works. If you want to complete the other html templates, you're welcome

* Move captcha to util

* Move uploadService to utils

* Use govalidator instead of regex

* Third batch of changes

All the front end should as previously.
I also fixed some minor things unrelated to the refactor (mostly style issues on static pages)
Now errors can be accessed by importing the "errors" helpers and using the `yield errors(name="xxx")` command in templates.
Same for infos.
Templates are now more hierarchized with a base template "base.jet.html" which is extended depending on the context in "index_site" or "index_admin" layouts. Those layouts are extended than in every pages.
Other helpers are captcha to render a captcha `yield captcha(captchaid="xxx")`
And also csrf, with the command `yield csrf_field()`
To translate, you don't have anymore to do `call $.T "xxx"`, you just have to do `T("xxx")`.

Pages for the website part are in folders in the folder "templates/site". Pages for the admin part are in "templates/admin". Layouts are separated in "templates/layouts". Helpers and menu are in "templates/layouts/helpers" and "templates/layouts/menu". Error pages should be put in "templates/errors"

* Added test on templates

When adding a new template, you have to tell to template_test.go, the context of the new template (if it doesn't use the common context)

* Panel admin works

Now the templating part should work. The PR can now be fully tested.

I think we should push the templating PR  and do the routes/controllers/removal of services in another branch. So we know that this one is functional

* Updated dependencies

* Fixed test for modelhelper

* Fix testing for commentlist

* Fix travis :')

* Just renamed router and removed network

* Applying same SEO fix

* Update form_validator.go

* Added back regexp package
2017-06-28 21:42:38 +10:00