* [WIP] Torrent Generation on not found error
As asked in #1517, it allows on-the-fly torrent generation. Since it uses magnet links, it needs some time to connect to peers. So it can't be instant generation, we need the user to wait and try after a minute at least.
* Replace Fatal by simple error
* attempt at fixing travis
* del
* Add Anacrolyx dependency
* Add back difflib
* Remove .torrent suffix in the url example
* Add some explanations when file missing page shown
* Ignore downloads directory
* Either use cache (third-party site) or own download directory
* Wrong import
* If there is an error then it means we aren't generating a torrent file
May it be "torrent not found" or "We do not store torrent files" which are the two only existing errors for this page
* hash is never empty
* TorrentLink may be empty at times
So we add a /download/:hash link if it is
* Update README.md
* Made a mistake here, need to check if false
* Update en-us.all.json
* Update CHANGELOG.md
* Torrent file generation can be triggered by click on button if JS enabled
* Update download.go
* Update download.go
* Use c.JSON instead of text/template
* Return to default behavior if we don't generate the file
* Don't do the query if returned to default behavior
* Add "Could not generate torrent file" error
* Fix JS condition & lower delay until button updates
* Start download automatically once torrent file is generated
* Fix torrentFileExists() constantly returning false if external torrent download URL
* torrent-view-data is two tables instead of one
This allows the removal of useless things without any problem (e.g Website link), but also a better responsibe design since the previous one separated stats after a certain res looking very wonky
* CSS changes to go along
* Remove useless <b></b>
* Update main.css
* In torrentFileExists, check if filestorage path exists instead of looking at the domain in torrent link
When checking if the file is stored on another server i used to simply check if the domain name was inside the torrent link, but we can straight up check for filestorage length
* Fix JS of on-demand stat fetching
* ScrapeAge variable accessible through view.jet.html
Contains last scraped time in hours, is at -1 is torrent has never been scraped
Stats will get updated if it's either at -1 or above 1460 (2 months old)
* Refresh stats if older than two months OR unknown and older than 24h
Show last scraped date even if stats are unknown
* Add StatsObsolete variable to torrent
Indicating if:
- They can be shown
- They need to be updated
* Update scraped data even if Unknown, prevent users from trying to fetch stats every seconds
* Torrent file stored locally by default
* no need to do all of that if no filestorage
* fix filestorage path
* Fix torrent download button stuck on "Generating torrent file" at rare times
* fix some css rules that didn't work on IE
* Fix panic error
Seems like this error is a known bug from anacrolyx torrent https://github.com/anacrolix/torrent/issues/83
To prevent it, I'm creating a single client and modifying the socket.go to make it not raise a panic but a simple error log.
* Fix Api documetation
Fix#1682
* Remove unused SubCategory field from struct TorrentRequest
* Change `category` argument in documentation to correct `c` (same key as the one in Search)
* Apidoc generation
* Remove SubCategory from template_test's torrentValidator
* Update template_test.go
* Update view.jet.html
* reduce the time limit of how fast stats.go is supposed to be called
* Update router.go
* add subcategory display in old navigation
* css to go along
* remove useless variable
* Update oldNav.jet.html
* fix travis
* fix missing css line that had user search input & link way wider than they should've been
* "See more torrents from" now make use of user torrent search route
* remove useless variable
* use stat obsolete variable in listing instead of checking the date
* fix wrong translation string being used on user edit page for mods
* fix css rule that did not apply
* fix error in stats.go
* stats.go scrapes default trackers if torrent has no tracker
* remove useless thing
* change behavior of right arrow in page list (now goes to latest page)
* fix { too much
* Update view.jet.html
* Update view.jet.html
* pin user search input & link at the bottom of user page
* HTML to go along
* Different color for cookie warning on sukebei
* Copy paste improvement from another PR since it's going to take time until it's complete
* ditto
* ditto
* ditto
* Update main.css
* JS fallback for /settings page on mirrors
* Update main.js
* Update settings.jet.html
* 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
* bottom margin for comment avatar
* Resetting API key now redirects you back to edit page
* move important faq things up in the faq
* Add div as high as header instead of top margin for #content
* Fix modtools showing behind ad
* No margin-top for body
* add functions that will be used in the future to file.go
* Update create.go
* fix css rule that didn't apply
* Fix some JS of upload form that kept shitting out errors since i updated the upload form
* Update upload.jet.html
* fix duplicate id on a form
* Fix very very slightly misaligned input
* fix html error on filelist
* Add FullDate variable to torrents
* Create Go function that returns an user-friendly date when fed a go date
* akuma must hate me for butchering the template_functions_test file
* Make use of said function in view.jet.html
* Forgot to vars.set the function
* Remove useless title
* Make use of function in listing
* modify JS to fetch full date from title instead of innerText
* Fix title date & two functions looping on non-existing objects
* Show full dates in an AM/PM format like on live
* Torrent dates on UTC+0 by default
* lower top margin for comment usernames & avatar
* Update classic.css
* temporary workaround to hide quadrupled comments
* Update view.jet.html
* Add "search from user" input below user rss link, change styling of follow button to fit other links
* all into the same div
* Remove padding of usersearch input in panel, remove useless css rule
* min-width for user buttons, max-width for the input
* Don't show "search from this user" if it's your profile
* remove max-width when responsive userprofile kicks in
* remove useless css rule
* Update view.jet.html
* le fix
* optimize stats.go a bit and add comments
* Update stats.go
* Update template_functions_test.go
* Update template_functions.go
* Remove hardcoded theme list, generate dynamically
* ditto
* Add possibility of forcing a theme for everyone
* in the .yml config file
* Make it ignore both user settings and cookies
* add forced theme in default theme config struct
* Update publicSettings.go
* fix missing , & travis
* Update template_functions_test.go
* Update main.css
* fix travis
* Update template_functions_test.go
* travis
* Update view.jet.html
* Update router.go
* Create stats.go
* Update view.jet.html
* Update stats.go
* Update stats.go
* rollback
* returns -1 by default
* Update stats.go
* Update stats.go
* Import goscrape & torrent
* copypaste stats.go from scrapers
* travis
* Update stats.go
* Update stats.go
* Put fresh stats into a <span>
* Background-color for freshly fetched stats
* ditto but for tomorrow
* "Loading..." text in case it gets a bit too long
* Stat fetching in controller (missing DB update)
* Update last scraped date too
* update torrent.Scrape tho it doesn't do anything
* forgot to edit a name
* Update scrape.go
* Update stats.go
* Update stats.go
* flush cache to update stats in listing
* Change function name
* Update stats.go
* Update stats.go
* fix travis
* Update view.jet.html
* Update stats.go
* Update stats.go
* Update stats.go
* Update stats.go
* Update stats.go
* Fix JS theme toggler
* fix check
* Fix user search USERID parameter not working
* User search controller now calls UserSearchHandler
* rollback this
* Update search.go
* Lower amount of torrents shown in user profile
* Additional routes for user search
* Handler for user not found page
* User not found error page, with input to search username
* Move theme css in their own folder
* Delete g.css
* Delete classic.css
* Delete classic_colors.css
* Delete tomorrow.css
* Delete bg-body.png
* Delete bg-header-tile.png
* Delete s_bg-header-tile.png
* Change path used by stylesheet in html head
* Change theme path used by JS theme changers
* Update user_not_found.jet.html
* Update CHANGELOG.md
* Update en-us.all.json
* fix ad scrolling
* remove useless stuff
* fix travis & json file
* fix travis again
* remove duplicate
* Update CHANGELOG.md
* Writing an username instead of an userid in userprofile URL will no longer return the Anonymous profile
* redirect to username search instead of rendering a template without checking if username exists
* Styling for new "Search from user" input in profile
* new "Search from this user" input
* Add RSS link on user profile
* fix rss icon being misaligned
* start comment count at 1 instead of 0
* fix misalignement of category in refine in japanese
* Add new routes for user search
* Update torrents.jet.html
* add translation string
* Update en-us.all.json
* Update CHANGELOG.md
* remove margin-right of torrent button icon
* Add /username/XXX/Search route
* /username/XXX route doesn't redirect anymore
* alt attribute for ads images
* fix <tr> too much
* fix missing <tr> that created HTML error
* fix wrong translation string name
* ditto
* fix accepted tags not having background on classic
* Put tag table inside upload table
* Update classic.css
* Remove prefix of dlsite tag on view
* Update main.css
* 10px bigger website
* fix wrong css selector
* fix markdown scroll visually broken in classic.css
* Add magnet link on torrent file not found page
* don't show magnet <a> if empty
* Fetch magnet link in download.go and pass it on to torrent_file_missing
* add magnet in template_test
* Update view.jet.html
* Update en-us.all.json
* Update view.jet.html
* Update CHANGELOG.md
* fix travis
* Update classic.css
* Update view.jet.html
* Update main.css
* Update classic.css
* Update classic.css
* Update classic.css
* add link to user page & avatar in comment
* stylisation for avatar in main.css
* Update classic.css
* Fix wrongly placed ::before
* Add rule list to terms of service
* import rules on register
* fix refine-container-2's inputs
* Update base.jet.html
* Update en-us.all.json
* Update CHANGELOG.md
* GenNav changes to constantly put HTML for nav arrows regardless of page
* css changes for website nav etc etc
* add OldNav global variable
* Add OldNav to test.go
* Update publicSettings.go
* change OldNav's value type
* Old navigation in settings
* add OldNav in user variables
* add oldNav input handler in settings.go
* Change OldNav's default value into false
* Create OldNav.jet.html
* Update search.jet.html
* remove character that had nothing to do here
* fix wrong variable name
* fix worng variable name and travis
* Update classic.css
* Add sort order & type to old nav
* add toString() function in test
* add toString() function
* translation string for oldnav setting
* Use translation string in settings.jet.html
* fix few html errors
* ditto
* travis fix test
* remove useless charset
* remove useless things
* add spaces before attributes
* attempt at fixing travis 2
* fix wrong variable name
* Update classic.css
* fix travis plsss
* Update base.jet.html
* Remove inline styling, put whole thing into a div instead of center to be able to move it at other places at will
* Move inline styling in there & some adjustements that will need further tweaking
* Add GetAdsEnabledFromRequest() function
* Ads Enabled global var
* Need to add global var in test file for it to work properly
* AdEnabled handler in settings
* Create AdsEnabled var for users
* Check if user wants to hide ads
* change var name
* change var name
* change var name
* change var name
* var name changes
* Add ad enabled settings & put each indiviidual setting into a span
* add |raw
* add translation strings
* add ads to faq
* Remove <br> and add faq link
* Fix travis
* Fix wrong condition check
* exclude aldColors & hideAds cookie from deletion
* remove useless things
* Fix template_test.go
* No idea why that part got removed
* Forgot }}
* lower padding for ad container
* Fix search Status
Should fix#1428 ?s=2 and others. Reason: the sql query wasn't correct when filtering (status >= ? = ?)
* Fix adding tag form (nojs) + miscalleneous
* Fix#1423 by checking http method before finding the tags.
* Form is now like other tags form
* New Middleware LoggedInMiddleware to protect routes to logged user only
* Display of Non-Accepted tags in torrent view improved by translating tagtype values
* Update tag.jet.html
* Non-bold torrent name when using alternating background colors
* Add alternating colors for g.css
* Add alternating colors for classic.css
* Add alternating colors for tomorreuw
* Update classic.css
* Add alternating colors to settings page
* Add alt-colors class to tbody if enabled
* Add GetAltColorsFromRequest() function to get AltColors cookie value
* Create AltColors variable for usage in listing
* Make settings handle altColors input
* Add AltColors in user struct
* Returned the wrong variable here
* Turn function return value into bool
* Condition checks variable like a bool
* ditto
* better color for g.css
* even better color
* better
* Last change for g.css
* Improvement for tomorrow
* Update classic.css
* add alt-colors class to upload preview
* Add alt-colors to user profile
* more vivid color for g
* Fix typo
* Remove browser outline for refine when clicked on
* remove browser outline
* Fix rules that didn't apply and category icon being way too small on user profile thanks to usage of percentage
* Remove show-xs class for search inputs
* Turn refine button back into position: absolute to pin at very bottom of refine
* Alternating colors for g's trusted, remake & aplus
* Update tomorrow.css
* attempt at fixing travis
* test (will have to rollback that change)
* rollback
* will have to rollback
* will have to rollback
* will have to rollback
* will have to rollback
* add AltColors variable to template test
* rollback
* rollback
* rollback
* rollback
* Update search.go
* Update helpers.go
* Update search.jet.html
* Update search.jet.html
* Removing SortOrder and SortType from template's Search struct. Since we already have them in main torrentParam search struct and we don't need to overwrite them.
* Replaced old date search filter behaviour
* 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