diff --git a/app/Http/Controllers/API/TorrentController.php b/app/Http/Controllers/API/TorrentController.php index 043f21976c..3ab744c705 100644 --- a/app/Http/Controllers/API/TorrentController.php +++ b/app/Http/Controllers/API/TorrentController.php @@ -113,13 +113,14 @@ public function store(Request $request, Torrent $torrent) $torrent->size = $meta['size']; $torrent->nfo = ($request->hasFile('nfo')) ? TorrentTools::getNfo($request->file('nfo')) : ''; $torrent->category_id = $category->id; + $torrent->type_id = $request->input('type_id'); + $torrent->resolution_id = $request->input('resolution_id'); $torrent->user_id = $user->id; $torrent->imdb = $request->input('imdb'); $torrent->tvdb = $request->input('tvdb'); $torrent->tmdb = $request->input('tmdb'); $torrent->mal = $request->input('mal'); $torrent->igdb = $request->input('igdb'); - $torrent->type_id = $request->input('type_id'); $torrent->anon = $request->input('anonymous'); $torrent->stream = $request->input('stream'); $torrent->sd = $request->input('sd'); @@ -133,30 +134,31 @@ public function store(Request $request, Torrent $torrent) // Validation $v = validator($torrent->toArray(), [ - 'name' => 'required|unique:torrents', - 'slug' => 'required', - 'description' => 'required', - 'info_hash' => 'required|unique:torrents', - 'file_name' => 'required', - 'num_file' => 'required|numeric', - 'announce' => 'required', - 'size' => 'required', - 'category_id' => 'required', - 'user_id' => 'required', - 'imdb' => 'required|numeric', - 'tvdb' => 'required|numeric', - 'tmdb' => 'required|numeric', - 'mal' => 'required|numeric', - 'igdb' => 'required|numeric', - 'type_id' => 'required', - 'anon' => 'required', - 'stream' => 'required', - 'sd' => 'required', - 'internal' => 'required', - 'featured' => 'required', - 'free' => 'required', - 'doubleup' => 'required', - 'sticky' => 'required', + 'name' => 'required|unique:torrents', + 'slug' => 'required', + 'description' => 'required', + 'info_hash' => 'required|unique:torrents', + 'file_name' => 'required', + 'num_file' => 'required|numeric', + 'announce' => 'required', + 'size' => 'required', + 'category_id' => 'required|exists:categories,id', + 'type_id' => 'required|exists:types,id', + 'resolution_id' => 'exists:resolutions,id', + 'user_id' => 'required|exists:users,id', + 'imdb' => 'required|numeric', + 'tvdb' => 'required|numeric', + 'tmdb' => 'required|numeric', + 'mal' => 'required|numeric', + 'igdb' => 'required|numeric', + 'anon' => 'required', + 'stream' => 'required', + 'sd' => 'required', + 'internal' => 'required', + 'featured' => 'required', + 'free' => 'required', + 'doubleup' => 'required', + 'sticky' => 'required', ]); if ($v->fails()) { @@ -328,6 +330,7 @@ public function filter(Request $request, Torrent $torrent) $end_year = $request->input('end_year'); $categories = $request->input('categories'); $types = $request->input('types'); + $resolutions = $request->input('resolutions'); $genres = $request->input('genres'); $freeleech = $request->input('freeleech'); $doubleupload = $request->input('doubleupload'); @@ -426,6 +429,10 @@ public function filter(Request $request, Torrent $torrent) $torrent->whereIn('torrents.type_id', $types); } + if ($request->has('resolutions') && $request->input('resolutions') != null) { + $torrent->whereIn('torrents.resolution_id', $resolutions); + } + if ($request->has('genres') && $request->input('genres') != null) { $genreID = TagTorrent::select(['torrent_id'])->distinct()->whereIn('tag_name', $genres)->get(); $torrent->whereIn('torrents.id', $genreID); diff --git a/app/Http/Controllers/RequestController.php b/app/Http/Controllers/RequestController.php index 14d53b6d9b..ee1fc85913 100644 --- a/app/Http/Controllers/RequestController.php +++ b/app/Http/Controllers/RequestController.php @@ -19,6 +19,7 @@ use App\Achievements\UserFilled75Requests; use App\Models\BonTransactions; use App\Models\Category; +use App\Models\Resolution; use App\Models\Torrent; use App\Models\TorrentRequest; use App\Models\TorrentRequestBounty; @@ -119,6 +120,7 @@ public function faceted(Request $request, TorrentRequest $torrentRequest) $igdb = $request->input('igdb'); $categories = $request->input('categories'); $types = $request->input('types'); + $resolutions = $request->input('resolutions'); $myrequests = $request->input('myrequests'); $terms = explode(' ', $search); @@ -161,6 +163,10 @@ public function faceted(Request $request, TorrentRequest $torrentRequest) $torrentRequest->whereIn('type_id', $types); } + if ($request->has('resolutions') && $request->input('resolutions') != null) { + $torrentRequest->whereIn('resolution_id', $resolutions); + } + if ($request->has('unfilled') && $request->input('unfilled') != null) { $torrentRequest->where('filled_hash', '=', null); } @@ -280,12 +286,13 @@ public function addRequestForm(Request $request, $title = '', $imdb = 0, $tmdb = $user = $request->user(); return view('requests.add_request', [ - 'categories' => Category::all()->sortBy('position'), - 'types' => Type::all()->sortBy('position'), - 'user' => $user, - 'title' => $title, - 'imdb' => str_replace('tt', '', $imdb), - 'tmdb' => $tmdb, + 'categories' => Category::all()->sortBy('position'), + 'types' => Type::all()->sortBy('position'), + 'resolutions' => Resolution::all()->sortBy('position'), + 'user' => $user, + 'title' => $title, + 'imdb' => str_replace('tt', '', $imdb), + 'tmdb' => $tmdb, ]); } @@ -312,22 +319,24 @@ public function addrequest(Request $request) $tr->mal = $request->input('mal'); $tr->igdb = $request->input('igdb'); $tr->type_id = $request->input('type_id'); + $tr->resolution_id = $request->input('resolution_id'); $tr->bounty = $request->input('bounty'); $tr->votes = 1; $tr->anon = $request->input('anon'); $v = validator($tr->toArray(), [ - 'name' => 'required|max:180', - 'imdb' => 'required|numeric', - 'tvdb' => 'required|numeric', - 'tmdb' => 'required|numeric', - 'mal' => 'required|numeric', - 'igdb' => 'required|numeric', - 'category_id' => 'required|exists:categories,id', - 'type_id' => 'required|exists:types,id', - 'description' => 'required|string', - 'bounty' => sprintf('required|numeric|min:0|max:%s', $user->seedbonus), - 'anon' => 'required', + 'name' => 'required|max:180', + 'imdb' => 'required|numeric', + 'tvdb' => 'required|numeric', + 'tmdb' => 'required|numeric', + 'mal' => 'required|numeric', + 'igdb' => 'required|numeric', + 'category_id' => 'required|exists:categories,id', + 'type_id' => 'required|exists:types,id', + 'resolution_id' => 'required|exists:resolutions,id', + 'description' => 'required|string', + 'bounty' => sprintf('required|numeric|min:0|max:%s', $user->seedbonus), + 'anon' => 'required', ]); if ($v->fails()) { @@ -384,6 +393,7 @@ public function editRequestForm(Request $request, $id) return view('requests.edit_request', [ 'categories' => Category::all()->sortBy('position'), 'types' => Type::all()->sortBy('position'), + 'resolutions' => Resolution::all()->sortBy('position'), 'user' => $user, 'torrentRequest' => $torrentRequest, ]); } @@ -411,6 +421,7 @@ public function editrequest(Request $request, $id) $igdb = $request->input('igdb'); $category = $request->input('category_id'); $type = $request->input('type_id'); + $resolution = $request->input('resolution_id'); $description = $request->input('description'); $anon = $request->input('anon'); @@ -422,20 +433,22 @@ public function editrequest(Request $request, $id) $torrentRequest->igdb = $igdb; $torrentRequest->category_id = $category; $torrentRequest->type_id = $type; + $torrentRequest->resolution_id = $resolution; $torrentRequest->description = $description; $torrentRequest->anon = $anon; $v = validator($torrentRequest->toArray(), [ - 'name' => 'required|max:180', - 'imdb' => 'required|numeric', - 'tvdb' => 'required|numeric', - 'tmdb' => 'required|numeric', - 'mal' => 'required|numeric', - 'igdb' => 'required|numeric', - 'category_id' => 'required|exists:categories,id', - 'type_id' => 'required|exists:types,id', - 'description' => 'required|string', - 'anon' => 'required', + 'name' => 'required|max:180', + 'imdb' => 'required|numeric', + 'tvdb' => 'required|numeric', + 'tmdb' => 'required|numeric', + 'mal' => 'required|numeric', + 'igdb' => 'required|numeric', + 'category_id' => 'required|exists:categories,id', + 'type_id' => 'required|exists:types,id', + 'resolution_id' => 'required|exists:resolutions,id', + 'description' => 'required|string', + 'anon' => 'required', ]); if ($v->fails()) { @@ -680,6 +693,8 @@ public function rejectRequest(Request $request, $id) * @param \Illuminate\Http\Request $request * @param \App\Models\TorrentRequest $id * + * @throws \Exception + * * @return \Illuminate\Http\RedirectResponse */ public function deleteRequest(Request $request, $id) @@ -743,6 +758,8 @@ public function claimRequest(Request $request, $id) * @param \Illuminate\Http\Request $request * @param \App\Models\TorrentRequest $id * + * @throws \Exception + * * @return \Illuminate\Http\RedirectResponse */ public function unclaimRequest(Request $request, $id) diff --git a/app/Http/Controllers/RssController.php b/app/Http/Controllers/RssController.php index d3e298beb1..f2e9e015bc 100644 --- a/app/Http/Controllers/RssController.php +++ b/app/Http/Controllers/RssController.php @@ -15,6 +15,7 @@ use App\Models\Category; use App\Models\Group; +use App\Models\Resolution; use App\Models\Rss; use App\Models\TagTorrent; use App\Models\Torrent; @@ -46,7 +47,7 @@ public function __construct(TorrentFacetedRepository $torrent_faceted) * @param \Illuminate\Http\Request $request * @param string $hash * - * @return \Illuminate\Http\Response + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index(Request $request, $hash = null) { @@ -68,7 +69,7 @@ public function index(Request $request, $hash = null) * * @param \Illuminate\Http\Request $request * - * @return \Illuminate\Http\Response + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function create(Request $request) { @@ -79,6 +80,7 @@ public function create(Request $request) 'torrent_repository' => $torrent_repository, 'categories' => Category::all()->sortBy('position'), 'types' => Type::all()->sortBy('position'), + 'resolutions' => Resolution::all()->sortBy('position'), 'user' => $user, ]); } @@ -101,12 +103,13 @@ public function store(Request $request) 'uploader' => 'max:255', 'categories' => 'sometimes|array|max:999', 'types' => 'sometimes|array|max:999', + 'resolutions' => 'sometimes|array|max:999', 'genres' => 'sometimes|array|max:999', 'position' => 'sometimes|integer|max:9999', ]); $params = $request->only(['name', 'search', 'description', 'uploader', 'imdb', 'tvdb', 'tmdb', 'mal', 'categories', - 'types', 'genres', 'freeleech', 'doubleupload', 'featured', 'stream', 'highspeed', 'sd', 'internal', 'alive', 'dying', 'dead', ]); + 'types', 'resolutions', 'genres', 'freeleech', 'doubleupload', 'featured', 'stream', 'highspeed', 'sd', 'internal', 'alive', 'dying', 'dead', ]); $error = null; $success = null; @@ -141,7 +144,7 @@ public function store(Request $request) * @param int $id * @param string $rsskey * - * @throws \Exception + * @throws \Psr\SimpleCache\InvalidArgumentException * * @return \Illuminate\Http\Response */ @@ -176,6 +179,7 @@ public function show($id, $rsskey) $mal = $rss->object_torrent->mal; $categories = $rss->object_torrent->categories; $types = $rss->object_torrent->types; + $resolutions = $rss->object_torrent->resolutions; $genres = $rss->object_torrent->genres; $freeleech = $rss->object_torrent->freeleech; $doubleupload = $rss->object_torrent->doubleupload; @@ -252,6 +256,10 @@ public function show($id, $rsskey) $torrent->whereIn('type_id', $types); } + if ($rss->object_torrent->resolutions && is_array($rss->object_torrent->resolutions)) { + $torrent->whereIn('resolution_id', $resolutions); + } + if ($rss->object_torrent->genres && is_array($rss->object_torrent->genres)) { $genreID = TagTorrent::select(['torrent_id'])->distinct()->whereIn('tag_name', $genres)->get(); $torrent->whereIn('id', $genreID)->cursor(); @@ -313,7 +321,7 @@ public function show($id, $rsskey) * @param \Illuminate\Http\Request $request * @param int $id * - * @return \Illuminate\Http\Response + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function edit(Request $request, $id) { @@ -325,6 +333,7 @@ public function edit(Request $request, $id) 'torrent_repository' => $torrent_repository, 'categories' => Category::all()->sortBy('position'), 'types' => Type::all()->sortBy('position'), + 'resolutions' => Resolution::all()->sortBy('position'), 'user' => $user, 'rss' => $rss, ]); @@ -348,6 +357,7 @@ public function update(Request $request, $id) 'uploader' => 'max:255', 'categories' => 'sometimes|array|max:999', 'types' => 'sometimes|array|max:999', + 'resolutions' => 'sometimes|array|max:999', 'genres' => 'sometimes|array|max:999', 'position' => 'sometimes|integer|max:9999', ]); @@ -385,6 +395,8 @@ public function update(Request $request, $id) * * @param int $id * + * @throws \Exception + * * @return \Illuminate\Http\Response */ public function destroy($id) diff --git a/app/Http/Controllers/Staff/CategoryController.php b/app/Http/Controllers/Staff/CategoryController.php index 2515e6becf..865e81da6d 100644 --- a/app/Http/Controllers/Staff/CategoryController.php +++ b/app/Http/Controllers/Staff/CategoryController.php @@ -67,7 +67,7 @@ public function store(Request $request) $image = $request->file('image'); $filename = 'category-'.uniqid().'.'.$image->getClientOriginalExtension(); $path = public_path('/files/img/'.$filename); - Image::make($image->getRealPath())->fit(40, 40)->encode('png', 100)->save($path); + Image::make($image->getRealPath())->fit(60, 60)->encode('png', 100)->save($path); $category->image = $filename; } else { $category->image = null; @@ -134,7 +134,7 @@ public function update(Request $request, $id) $image = $request->file('image'); $filename = 'category-'.uniqid().'.'.$image->getClientOriginalExtension(); $path = public_path('/files/img/'.$filename); - Image::make($image->getRealPath())->fit(40, 40)->encode('png', 100)->save($path); + Image::make($image->getRealPath())->fit(60, 60)->encode('png', 100)->save($path); $category->image = $filename; } diff --git a/app/Http/Controllers/Staff/ResolutionController.php b/app/Http/Controllers/Staff/ResolutionController.php new file mode 100644 index 0000000000..cf57031e69 --- /dev/null +++ b/app/Http/Controllers/Staff/ResolutionController.php @@ -0,0 +1,137 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 + */ + +namespace App\Http\Controllers\Staff; + +use App\Http\Controllers\Controller; +use App\Models\Resolution; +use Illuminate\Http\Request; +use Illuminate\Support\Str; + +class ResolutionController extends Controller +{ + /** + * Display All Resolutions. + * + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function index() + { + $resolutions = Resolution::all()->sortBy('position'); + + return view('Staff.resolution.index', ['resolutions' => $resolutions]); + } + + /** + * Show Resolution Create Form. + * + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function create() + { + return view('Staff.resolution.create'); + } + + /** + * Store A New Resolution. + * + * @param \Illuminate\Http\Request $request + * + * @return \Illuminate\Http\RedirectResponse + */ + public function store(Request $request) + { + $resolution = new Resolution(); + $resolution->name = $request->input('name'); + $resolution->slug = Str::slug($resolution->name); + $resolution->position = $request->input('position'); + + $v = validator($resolution->toArray(), [ + 'name' => 'required', + 'slug' => 'required', + 'position' => 'required', + ]); + + if ($v->fails()) { + return redirect()->route('staff.resolutions.index') + ->withErrors($v->errors()); + } + $resolution->save(); + + return redirect()->route('staff.resolutions.index') + ->withSuccess('Resolution Successfully Added'); + } + + /** + * Resolution Edit Form. + * + * @param $id + * + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function edit($id) + { + $resolution = Resolution::findOrFail($id); + + return view('Staff.resolution.edit', ['resolution' => $resolution]); + } + + /** + * Edit A Resolution. + * + * @param \Illuminate\Http\Request $request + * @param $id + * + * @return Illuminate\Http\RedirectResponse + */ + public function update(Request $request, $id) + { + $resolution = Resolution::findOrFail($id); + $resolution->name = $request->input('name'); + $resolution->slug = Str::slug($resolution->name); + $resolution->position = $request->input('position'); + + $v = validator($resolution->toArray(), [ + 'name' => 'required', + 'slug' => 'required', + 'position' => 'required', + ]); + + if ($v->fails()) { + return redirect()->route('staff.resolutions.index') + ->withErrors($v->errors()); + } + $resolution->save(); + + return redirect()->route('staff.resolutions.index') + ->withSuccess('Resolution Successfully Modified'); + } + + /** + * Delete A Resolution. + * + * @param $id + * + * @throws \Exception + * + * @return Illuminate\Http\RedirectResponse + */ + public function destroy($id) + { + $resolution = Resolution::findOrFail($id); + $resolution->delete(); + + return redirect()->route('staff.resolutions.index') + ->withSuccess('Resolution Successfully Deleted'); + } +} diff --git a/app/Http/Controllers/Staff/RssController.php b/app/Http/Controllers/Staff/RssController.php index cbd5671bd6..4132e2f5a5 100644 --- a/app/Http/Controllers/Staff/RssController.php +++ b/app/Http/Controllers/Staff/RssController.php @@ -15,6 +15,7 @@ use App\Http\Controllers\Controller; use App\Models\Category; +use App\Models\Resolution; use App\Models\Rss; use App\Models\Type; use App\Repositories\TorrentFacetedRepository; @@ -59,7 +60,7 @@ public function index($hash = null) * * @param \Illuminate\Http\Request $request * - * @return \Illuminate\Http\Response + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function create(Request $request) { @@ -70,6 +71,7 @@ public function create(Request $request) 'torrent_repository' => $torrent_repository, 'categories' => Category::all()->sortBy('position'), 'types' => Type::all()->sortBy('position'), + 'resolutions' => Resolution::all()->sortBy('position'), 'user' => $user, ]); } @@ -91,12 +93,13 @@ public function store(Request $request) 'uploader' => 'max:255', 'categories' => 'sometimes|array|max:999', 'types' => 'sometimes|array|max:999', + 'resolutions' => 'sometimes|array|max:999', 'genres' => 'sometimes|array|max:999', 'position' => 'sometimes|integer|max:9999', ]); $params = $request->only(['type', 'name', 'position', 'search', 'description', 'uploader', 'imdb', 'tvdb', 'tmdb', 'mal', 'categories', - 'types', 'genres', 'freeleech', 'doubleupload', 'featured', 'stream', 'highspeed', 'sd', 'internal', 'alive', 'dying', 'dead', ]); + 'types', 'resolutions', 'genres', 'freeleech', 'doubleupload', 'featured', 'stream', 'highspeed', 'sd', 'internal', 'alive', 'dying', 'dead', ]); $error = null; $success = null; @@ -133,7 +136,7 @@ public function store(Request $request) * @param \Illuminate\Http\Request $request * @param int $id * - * @return \Illuminate\Http\Response + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function edit(Request $request, $id) { @@ -145,6 +148,7 @@ public function edit(Request $request, $id) 'torrent_repository' => $torrent_repository, 'categories' => Category::all()->sortBy('position'), 'types' => Type::all()->sortBy('position'), + 'resolutions' => Resolution::all()->sortBy('position'), 'user' => $user, 'rss' => $rss, ]); @@ -169,12 +173,13 @@ public function update(Request $request, $id) 'uploader' => 'max:255', 'categories' => 'sometimes|array|max:999', 'types' => 'sometimes|array|max:999', + 'resolutions' => 'sometimes|array|max:999', 'genres' => 'sometimes|array|max:999', 'position' => 'sometimes|integer|max:9999', ]); $params = $request->only(['type', 'position', 'search', 'description', 'uploader', 'imdb', 'tvdb', 'tmdb', 'mal', 'categories', - 'types', 'genres', 'freeleech', 'doubleupload', 'featured', 'stream', 'highspeed', 'sd', 'internal', 'alive', 'dying', 'dead', ]); + 'types', 'resolutions', 'genres', 'freeleech', 'doubleupload', 'featured', 'stream', 'highspeed', 'sd', 'internal', 'alive', 'dying', 'dead', ]); $error = null; $success = null; diff --git a/app/Http/Controllers/TorrentController.php b/app/Http/Controllers/TorrentController.php index 84669c1b05..936bd5715f 100644 --- a/app/Http/Controllers/TorrentController.php +++ b/app/Http/Controllers/TorrentController.php @@ -30,6 +30,7 @@ use App\Models\PersonalFreeleech; use App\Models\PlaylistTorrent; use App\Models\PrivateMessage; +use App\Models\Resolution; use App\Models\Subtitle; use App\Models\TagTorrent; use App\Models\Torrent; @@ -415,6 +416,7 @@ public function faceted(Request $request, Torrent $torrent) $end_year = $request->input('end_year'); $categories = $request->input('categories'); $types = $request->input('types'); + $resolutions = $request->input('resolutions'); $genres = $request->input('genres'); $freeleech = $request->input('freeleech'); $doubleupload = $request->input('doubleupload'); @@ -524,6 +526,10 @@ public function faceted(Request $request, Torrent $torrent) $torrent->whereIn('torrentsl.type_id', $types); } + if ($request->has('resolutions') && $request->input('resolutions') != null) { + $torrent->whereIn('torrentsl.resolution_id', $resolutions); + } + if ($request->has('genres') && $request->input('genres') != null) { $genreID = TagTorrent::select(['torrent_id'])->distinct()->whereIn('tag_name', $genres)->get(); $torrent->whereIn('torrentsl.id', $genreID); @@ -657,6 +663,10 @@ public function faceted(Request $request, Torrent $torrent) $torrent->whereIn('torrents.type_id', $types); } + if ($request->has('resolutions') && $request->input('resolutions') != null) { + $torrent->whereIn('torrents.resolution_id', $resolutions); + } + if ($request->has('genres') && $request->input('genres') != null) { $genreID = TagTorrent::select(['torrent_id'])->distinct()->whereIn('tag_name', $genres)->get(); $torrent->whereIn('torrents.id', $genreID); @@ -1016,9 +1026,10 @@ public function editForm(Request $request, $id) abort_unless($user->group->is_modo || $user->id == $torrent->user_id, 403); return view('torrent.edit_torrent', [ - 'categories' => Category::all()->sortBy('position'), - 'types' => Type::all()->sortBy('position'), - 'torrent' => $torrent, + 'categories' => Category::all()->sortBy('position'), + 'types' => Type::all()->sortBy('position'), + 'resolutions' => Resolution::all()->sortBy('position'), + 'torrent' => $torrent, ]); } @@ -1237,6 +1248,7 @@ public function uploadForm(Request $request, $category_id = 0, $title = '', $imd return view('torrent.upload', [ 'categories' => Category::all()->sortBy('position'), 'types' => Type::all()->sortBy('position'), + 'resolutions' => Resolution::all()->sortBy('position'), 'user' => $user, 'category_id' => $category_id, 'title' => $title, @@ -1305,13 +1317,14 @@ public function upload(Request $request) $torrent->size = $meta['size']; $torrent->nfo = ($request->hasFile('nfo')) ? TorrentTools::getNfo($request->file('nfo')) : ''; $torrent->category_id = $category->id; + $torrent->type_id = $request->input('type_id'); + $torrent->resolution_id = $request->input('resolution_id'); $torrent->user_id = $user->id; $torrent->imdb = $request->input('imdb'); $torrent->tvdb = $request->input('tvdb'); $torrent->tmdb = $request->input('tmdb'); $torrent->mal = $request->input('mal'); $torrent->igdb = $request->input('igdb'); - $torrent->type_id = $request->input('type_id'); $torrent->anon = $request->input('anonymous'); $torrent->stream = $request->input('stream'); $torrent->sd = $request->input('sd'); @@ -1322,25 +1335,26 @@ public function upload(Request $request) // Validation $v = validator($torrent->toArray(), [ - 'name' => 'required|unique:torrents', - 'slug' => 'required', - 'description' => 'required', - 'info_hash' => 'required|unique:torrents', - 'file_name' => 'required', - 'num_file' => 'required|numeric', - 'announce' => 'required', - 'size' => 'required', - 'category_id' => 'required', - 'user_id' => 'required', - 'imdb' => 'required|numeric', - 'tvdb' => 'required|numeric', - 'tmdb' => 'required|numeric', - 'mal' => 'required|numeric', - 'igdb' => 'required|numeric', - 'type_id' => 'required', - 'anon' => 'required', - 'stream' => 'required', - 'sd' => 'required', + 'name' => 'required|unique:torrents', + 'slug' => 'required', + 'description' => 'required', + 'info_hash' => 'required|unique:torrents', + 'file_name' => 'required', + 'num_file' => 'required|numeric', + 'announce' => 'required', + 'size' => 'required', + 'category_id' => 'required|exists:categories,id', + 'type_id' => 'required|exists:types,id', + 'resolution_id' => 'exists:resolutions,id', + 'user_id' => 'required|exists:users,id', + 'imdb' => 'required|numeric', + 'tvdb' => 'required|numeric', + 'tmdb' => 'required|numeric', + 'mal' => 'required|numeric', + 'igdb' => 'required|numeric', + 'anon' => 'required', + 'stream' => 'required', + 'sd' => 'required', ]); if ($v->fails()) { diff --git a/app/Http/Resources/TorrentResource.php b/app/Http/Resources/TorrentResource.php index c8119d4780..b226890b0a 100644 --- a/app/Http/Resources/TorrentResource.php +++ b/app/Http/Resources/TorrentResource.php @@ -34,6 +34,7 @@ public function toArray($request) 'release_year' => $this->release_year, 'category' => $this->category->name, 'type' => $this->type->name, + 'resolution' => $this->resolution->name, 'size' => $this->getSize(), 'freeleech' => $this->free ? 'Yes' : 'No', 'double_upload' => $this->doubleup ? 'Yes' : 'No', diff --git a/app/Models/Resolution.php b/app/Models/Resolution.php new file mode 100644 index 0000000000..4c0d5f633e --- /dev/null +++ b/app/Models/Resolution.php @@ -0,0 +1,71 @@ +hasMany(Torrent::class); + } + + /** + * Has Many Torrent Requests. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function requests() + { + return $this->hasMany(TorrentRequest::class); + } +} diff --git a/app/Models/Rss.php b/app/Models/Rss.php index d0470ae655..b8047181a7 100644 --- a/app/Models/Rss.php +++ b/app/Models/Rss.php @@ -135,9 +135,9 @@ public function getExpectedFieldsAttribute() { // Just Torrents for now... extendable to check on feed type in future. $expected_fields = ['search' => null, 'description' => null, 'uploader' => null, 'imdb' => null, - 'mal' => null, 'categories' => null, 'types' => null, 'genres' => null, 'freeleech' => null, - 'doubleupload' => null, 'featured' => null, 'stream' => null, 'highspeed' => null, 'internal' => null, - 'alive' => null, 'dying' => null, 'dead' => null, 'sd' => null, ]; + 'mal' => null, 'categories' => null, 'types' => null, 'resolutions' => null, 'genres' => null, + 'freeleech' => null, 'doubleupload' => null, 'featured' => null, 'stream' => null, 'highspeed' => null, + 'internal' => null, 'alive' => null, 'dying' => null, 'dead' => null, 'sd' => null, ]; return $expected_fields; } diff --git a/app/Models/Torrent.php b/app/Models/Torrent.php index 1681f1642f..515f10b93c 100644 --- a/app/Models/Torrent.php +++ b/app/Models/Torrent.php @@ -204,6 +204,16 @@ public function type() return $this->belongsTo(Type::class); } + /** + * Belongs To A Resolution. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function resolution() + { + return $this->belongsTo(Resolution::class); + } + /** * Torrent Has Been Moderated By. * diff --git a/app/Models/TorrentRequest.php b/app/Models/TorrentRequest.php index 372dff5b68..fa86176f31 100644 --- a/app/Models/TorrentRequest.php +++ b/app/Models/TorrentRequest.php @@ -167,6 +167,16 @@ public function type() return $this->belongsTo(Type::class); } + /** + * Belongs To A Resolution. + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function resolution() + { + return $this->belongsTo(Resolution::class); + } + /** * Belongs To A Torrent. * diff --git a/app/Repositories/RequestFacetedRepository.php b/app/Repositories/RequestFacetedRepository.php index b949fb3c3b..c6a52e3844 100644 --- a/app/Repositories/RequestFacetedRepository.php +++ b/app/Repositories/RequestFacetedRepository.php @@ -14,6 +14,7 @@ namespace App\Repositories; use App\Models\Category; +use App\Models\Resolution; use App\Models\Type; class RequestFacetedRepository @@ -38,6 +39,16 @@ public function types() return Type::all()->sortBy('position')->pluck('name', 'id'); } + /** + * Return a collection of Resolution Name from storage. + * + * @return \Illuminate\Support\Collection + */ + public function resolutions() + { + return Resolution::all()->sortBy('position')->pluck('name', 'id'); + } + /** * Options for sort the search result. * diff --git a/app/Repositories/TorrentFacetedRepository.php b/app/Repositories/TorrentFacetedRepository.php index 8875971e45..e92d6ef718 100644 --- a/app/Repositories/TorrentFacetedRepository.php +++ b/app/Repositories/TorrentFacetedRepository.php @@ -14,6 +14,7 @@ namespace App\Repositories; use App\Models\Category; +use App\Models\Resolution; use App\Models\Tag; use App\Models\Type; @@ -39,6 +40,16 @@ public function types() return Type::all()->sortBy('position')->pluck('name', 'id'); } + /** + * Return a collection of Resolution Name from storage. + * + * @return \Illuminate\Support\Collection + */ + public function resolutions() + { + return Resolution::all()->sortBy('position')->pluck('name', 'id'); + } + /** * Return a collection of Tag Name from storage. * diff --git a/config/secure-headers.php b/config/secure-headers.php index e928e41836..3f0735c1e1 100644 --- a/config/secure-headers.php +++ b/config/secure-headers.php @@ -569,6 +569,7 @@ 'allow' => [ 'https://'.parse_url(env('APP_URL'), PHP_URL_HOST).':8443/socket.io/', 'wss://'.parse_url(env('APP_URL'), PHP_URL_HOST).':8443/socket.io/', + 'https://api.themoviedb.org/', ], 'self' => true, ], diff --git a/database/factories/ResolutionFactory.php b/database/factories/ResolutionFactory.php new file mode 100644 index 0000000000..adaea5ef87 --- /dev/null +++ b/database/factories/ResolutionFactory.php @@ -0,0 +1,13 @@ +define(App\Models\Resolution::class, function (Faker $faker) { + return [ + 'name' => $faker->name, + 'slug' => $faker->slug, + 'position' => $faker->randomNumber(), + ]; +}); diff --git a/database/factories/TorrentFactory.php b/database/factories/TorrentFactory.php index a450d062d2..89597a35fa 100644 --- a/database/factories/TorrentFactory.php +++ b/database/factories/TorrentFactory.php @@ -33,6 +33,9 @@ 'type_id' => function () { return factory(App\Models\Type::class)->create()->id; }, + 'resolution_id' => function () { + return factory(App\Models\Resolution::class)->create()->id; + }, 'stream' => $faker->boolean, 'free' => $faker->boolean, 'doubleup' => $faker->boolean, diff --git a/database/factories/TorrentRequestFactory.php b/database/factories/TorrentRequestFactory.php index 56915f6222..df6dbc3b43 100644 --- a/database/factories/TorrentRequestFactory.php +++ b/database/factories/TorrentRequestFactory.php @@ -13,6 +13,9 @@ 'type_id' => function () { return factory(App\Models\Type::class)->create()->id; }, + 'resolution_id' => function () { + return factory(App\Models\Resolution::class)->create()->id; + }, 'imdb' => $faker->word, 'tvdb' => $faker->word, 'tmdb' => $faker->word, diff --git a/database/migrations/2020_06_06_185230_create_resolutions_table.php b/database/migrations/2020_06_06_185230_create_resolutions_table.php new file mode 100644 index 0000000000..4d25957055 --- /dev/null +++ b/database/migrations/2020_06_06_185230_create_resolutions_table.php @@ -0,0 +1,44 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 + */ + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class CreateResolutionsTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('resolutions', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->string('name'); + $table->string('slug'); + $table->integer('position'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('resolutions'); + } +} diff --git a/database/migrations/2020_06_07_023938_add_resolution_id_to_torrents_table.php b/database/migrations/2020_06_07_023938_add_resolution_id_to_torrents_table.php new file mode 100644 index 0000000000..fd3c02f535 --- /dev/null +++ b/database/migrations/2020_06_07_023938_add_resolution_id_to_torrents_table.php @@ -0,0 +1,57 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 + */ + +use App\Models\Resolution; +use App\Models\Torrent; +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class AddResolutionIdToTorrentsTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('torrents', function (Blueprint $table) { + $table->integer('resolution_id')->nullable()->index(); + }); + + if (Schema::hasColumn('torrents', 'resolution')) { + foreach (Torrent::all() as $torrent) { + $resolution_id = Resolution::where('name', '=', $torrent->resolution)->firstOrFail()->id; + $torrent->resolution_id = $resolution_id; + $torrent->save(); + } + + Schema::table('torrents', function (Blueprint $table) { + $table->dropColumn('resolution'); + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('torrents', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/2020_06_07_054632_add_resolution_id_to_requests_table.php b/database/migrations/2020_06_07_054632_add_resolution_id_to_requests_table.php new file mode 100644 index 0000000000..961778b263 --- /dev/null +++ b/database/migrations/2020_06_07_054632_add_resolution_id_to_requests_table.php @@ -0,0 +1,43 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 + */ + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class AddResolutionIdToRequestsTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('requests', function (Blueprint $table) { + $table->integer('resolution_id')->nullable()->index(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('requests', function (Blueprint $table) { + // + }); + } +} diff --git a/database/seeds/CategoriesTableSeeder.php b/database/seeds/CategoriesTableSeeder.php index 3a292ea214..7c35f4f770 100644 --- a/database/seeds/CategoriesTableSeeder.php +++ b/database/seeds/CategoriesTableSeeder.php @@ -67,6 +67,34 @@ public function run() 'music_meta' => 1, 'no_meta' => 0, ], + 3 => [ + 'id' => 4, + 'name' => 'Game', + 'slug' => 'game', + 'position' => 3, + 'icon' => config('other.font-awesome').' fa-gamepad', + 'num_torrent' => 0, + 'image' => null, + 'movie_meta' => 0, + 'tv_meta' => 0, + 'game_meta' => 1, + 'music_meta' => 0, + 'no_meta' => 0, + ], + 4 => [ + 'id' => 5, + 'name' => 'Application', + 'slug' => 'application', + 'position' => 4, + 'icon' => config('other.font-awesome').' fa-compact-disc', + 'num_torrent' => 0, + 'image' => null, + 'movie_meta' => 0, + 'tv_meta' => 0, + 'game_meta' => 0, + 'music_meta' => 0, + 'no_meta' => 1, + ], ]); } } diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 6e5e6a44b3..030a5b59a7 100755 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -37,5 +37,6 @@ public function run() $this->call(TagsTableSeeder::class); $this->call(BotsTableSeeder::class); $this->call(MediaLanguagesSeeder::class); + $this->call(ResolutionsTableSeeder::class); } } diff --git a/database/seeds/ResolutionsTableSeeder.php b/database/seeds/ResolutionsTableSeeder.php new file mode 100644 index 0000000000..82f92de872 --- /dev/null +++ b/database/seeds/ResolutionsTableSeeder.php @@ -0,0 +1,90 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 + */ + +use Illuminate\Database\Seeder; + +class ResolutionsTableSeeder extends Seeder +{ + /** + * Auto generated seed file. + * + * @return void + */ + public function run() + { + \DB::table('resolutions')->delete(); + + \DB::table('resolutions')->insert([ + 0 => [ + 'id' => 1, + 'name' => '4320p', + 'slug' => '4320p', + 'position' => 0, + ], + 1 => [ + 'id' => 2, + 'name' => '2160p', + 'slug' => '2160p', + 'position' => 1, + ], + 2 => [ + 'id' => 3, + 'name' => '1080p', + 'slug' => '1080p', + 'position' => 2, + ], + 3 => [ + 'id' => 4, + 'name' => '1080i', + 'slug' => '1080i', + 'position' => 4, + ], + 4 => [ + 'id' => 5, + 'name' => '720p', + 'slug' => '720p', + 'position' => 5, + ], + 5 => [ + 'id' => 6, + 'name' => '576p', + 'slug' => '576p', + 'position' => 6, + ], + 6 => [ + 'id' => 7, + 'name' => '576i', + 'slug' => '576i', + 'position' => 7, + ], + 7 => [ + 'id' => 8, + 'name' => '480p', + 'slug' => '480p', + 'position' => 8, + ], + 8 => [ + 'id' => 9, + 'name' => '480i', + 'slug' => '480i', + 'position' => 9, + ], + 9 => [ + 'id' => 10, + 'name' => 'Other', + 'slug' => 'other', + 'position' => 10, + ], + ]); + } +} diff --git a/database/seeds/TypesTableSeeder.php b/database/seeds/TypesTableSeeder.php index a8ab9fb40d..c4cb9f3673 100644 --- a/database/seeds/TypesTableSeeder.php +++ b/database/seeds/TypesTableSeeder.php @@ -61,6 +61,50 @@ public function run() 'slug' => 'hdtv', 'position' => 6, ], + + 6 => [ + 'id' => 7, + 'name' => 'FLAC', + 'slug' => 'flac', + 'position' => 7, + ], + 7 => [ + 'id' => 8, + 'name' => 'ALAC', + 'slug' => 'alac', + 'position' => 8, + ], + 8 => [ + 'id' => 9, + 'name' => 'AC3', + 'slug' => 'ac3', + 'position' => 9, + ], + 9 => [ + 'id' => 10, + 'name' => 'AAC', + 'slug' => 'aac', + 'position' => 10, + ], + 10 => [ + 'id' => 11, + 'name' => 'MP3', + 'slug' => 'mp3', + 'position' => 11, + ], + + 11 => [ + 'id' => 12, + 'name' => 'Mac', + 'slug' => 'mac', + 'position' => 12, + ], + 12 => [ + 'id' => 13, + 'name' => 'Windows', + 'slug' => 'windows', + 'position' => 13, + ], ]); } } diff --git a/resources/js/unit3d/helper.js b/resources/js/unit3d/helper.js index 22b4c4a126..db3baf3bd0 100644 --- a/resources/js/unit3d/helper.js +++ b/resources/js/unit3d/helper.js @@ -219,7 +219,7 @@ class uploadExtensionBuilder { } // Torrent Resolution - //$("#autores").val(release.resolution); + $("#autores").val(release.resolution); // Torrent TMDB ID if (release.type === "Movie") { @@ -651,6 +651,7 @@ class facetedSearchBuilder { var end_year = $("#end_year").val(); var categories = []; var types = []; + var resolutions = []; var genres = []; var qty = $("#qty").val(); var notdownloaded = (function () { @@ -734,6 +735,9 @@ class facetedSearchBuilder { $(".type:checked").each(function () { types.push($(this).val()); }); + $(".resolution:checked").each(function () { + resolutions.push($(this).val()); + }); $(".genre:checked").each(function () { genres.push($(this).val()); }); @@ -818,6 +822,7 @@ class facetedSearchBuilder { end_year: end_year, categories: categories, types: types, + resolutions: resolutions, genres: genres, freeleech: freeleech, doubleupload: doubleupload, diff --git a/resources/js/unit3d/parser.js b/resources/js/unit3d/parser.js index f61287daca..21fc7ceb27 100644 --- a/resources/js/unit3d/parser.js +++ b/resources/js/unit3d/parser.js @@ -135,40 +135,37 @@ const rules = }, "resolution": { - "4320p": [ + "1": [ "4320p", "8k" ], - "2160p": [ + "2": [ "2160p", "4k", "uhd" ], - "1080p": [ + "3": [ "1080p" ], - "1080i": [ + "4": [ "1080i" ], - "900p": [ - "900p" - ], - "720p": [ + "5": [ "720p" ], - "576p": [ + "6": [ "576p", "PAL", ], - "576i": [ + "7": [ "576i", "PAL", ], - "480p": [ + "8": [ "480p", "NTSC", ], - "480i": [ + "9": [ "480i", "NTSC", ], diff --git a/resources/lang/en/common.php b/resources/lang/en/common.php index 22c4dd9364..3d9691a8dc 100644 --- a/resources/lang/en/common.php +++ b/resources/lang/en/common.php @@ -167,6 +167,8 @@ 'remove' => 'Remove', 'report' => 'Report', 'resend' => 'Resend', + 'resolution' => 'Resolution', + 'resolutions' => 'Resolutions', 'reporter' => 'Reporter', 'required' => 'Required', 'results' => 'Results', diff --git a/resources/lang/en/staff.php b/resources/lang/en/staff.php index dd565c99d8..f6c0823df2 100644 --- a/resources/lang/en/staff.php +++ b/resources/lang/en/staff.php @@ -56,6 +56,7 @@ 'torrent-moderation' => 'Torrent Moderation', 'torrent-tools' => 'Torrent Tools', 'torrent-types' => 'Torrent Types', + 'torrent-resolutions' => 'Torrent Resolutions', 'torrents' => 'Torrents', 'user-gifting' => 'User Gifting', 'user-notes' => 'User Notes Log', diff --git a/resources/lang/en/torrent.php b/resources/lang/en/torrent.php index 72f1d63b1b..dc381b3bb4 100644 --- a/resources/lang/en/torrent.php +++ b/resources/lang/en/torrent.php @@ -153,6 +153,7 @@ 'request-reseed' => 'Request Reseed', 'requires-reseed' => 'Requires Reseed', 'resolution' => 'Resolution', + 'resolutions' => 'Resolutions', 'resurrections' => 'Resurrections', 'revoke' => 'Revoke', 'rss' => 'RSS', diff --git a/resources/views/Staff/moderation/index.blade.php b/resources/views/Staff/moderation/index.blade.php index 6cddeab358..96aa173f07 100644 --- a/resources/views/Staff/moderation/index.blade.php +++ b/resources/views/Staff/moderation/index.blade.php @@ -27,6 +27,7 @@ @lang('common.name') @lang('common.category') @lang('common.type') + @lang('common.resolution') @lang('torrent.size') @lang('torrent.uploader') @lang('common.moderation-approve') @@ -45,6 +46,7 @@ class="l-breadcrumb-item-link-title">{{ $p->name }} {{ $p->type->name }} + {{ $p->resolution->name }} {{ $p->getSize() }} {{ $post->type->name }} + {{ $post->resolution->name }} {{ $post->getSize() }} @lang('common.reason') @lang('common.name') @lang('common.category') @lang('common.type') + @lang('common.resolution') @lang('torrent.size') @lang('torrent.uploader') @lang('common.staff') @@ -314,6 +319,7 @@ class="l-breadcrumb-item-link-title">{{ $reject->name }} {{ $reject->type->name }} + {{ $reject->resolution->name }} {{ $reject->getSize() }} @if ($reject->user) + + +
  • + +
  • +
  • + +
  • +@endsection + +@section('content') +
    +

    Add A Torrent Resolution

    +
    + @csrf +
    + + +
    +
    + + +
    + + +
    +
    +@endsection diff --git a/resources/views/Staff/resolution/edit.blade.php b/resources/views/Staff/resolution/edit.blade.php new file mode 100644 index 0000000000..8e8e433cd0 --- /dev/null +++ b/resources/views/Staff/resolution/edit.blade.php @@ -0,0 +1,44 @@ +@extends('layout.default') + +@section('breadcrumb') +
  • + +
  • +
  • + +
  • +
  • + +
  • +@endsection + +@section('content') +
    +

    @lang('common.edit') A Torrent Resolution

    +
    + @method('PATCH') + @csrf +
    + + +
    + +
    + + +
    + + +
    +
    +@endsection diff --git a/resources/views/Staff/resolution/index.blade.php b/resources/views/Staff/resolution/index.blade.php new file mode 100644 index 0000000000..7dedb8239f --- /dev/null +++ b/resources/views/Staff/resolution/index.blade.php @@ -0,0 +1,56 @@ +@extends('layout.default') + +@section('breadcrumb') +
  • + +
  • +
  • + +
  • +@endsection + +@section('content') +
    +

    @lang('common.resolutions')

    + Add A Torrent Resolution + +
    + + + + + + + + + + @foreach ($resolutions as $resolution) + + + + + + @endforeach + +
    @lang('common.position')@lang('common.name')@lang('common.action')
    + {{ $resolution->position }} + + + {{ $resolution->name }} + + +
    + @csrf + @method('DELETE') + @lang('common.edit') + +
    +
    +
    +
    +@endsection diff --git a/resources/views/Staff/rss/create.blade.php b/resources/views/Staff/rss/create.blade.php index 8aeef6a007..32d63d5043 100644 --- a/resources/views/Staff/rss/create.blade.php +++ b/resources/views/Staff/rss/create.blade.php @@ -87,6 +87,19 @@ class="category"> {{ $category }} @endforeach +
    + +
    + @foreach ($torrent_repository->resolutions() as $id => $resolution) + + + + @endforeach +
    +
    diff --git a/resources/views/Staff/rss/edit.blade.php b/resources/views/Staff/rss/edit.blade.php index b1263d4efa..4a16e5edaa 100644 --- a/resources/views/Staff/rss/edit.blade.php +++ b/resources/views/Staff/rss/edit.blade.php @@ -102,6 +102,24 @@ class="category"> {{ $category }} @endforeach
    +
    + +
    + @foreach ($torrent_repository->resolutions() as $id => $resolution) + + + + @endforeach +
    +
    diff --git a/resources/views/Staff/rss/index.blade.php b/resources/views/Staff/rss/index.blade.php index f6e918429b..6315eafdb3 100644 --- a/resources/views/Staff/rss/index.blade.php +++ b/resources/views/Staff/rss/index.blade.php @@ -26,6 +26,7 @@ @lang('common.position') @lang('common.categories') @lang('common.types') + @lang('common.resolutions') @lang('common.genres') @lang('torrent.discounts') @lang('common.special') @@ -46,6 +47,9 @@ class="{{ config('other.font-awesome') }} fa-times text-red">@endif @if ($rss->object_torrent->types)@else@endif + @if ($rss->object_torrent->resolutions)@else@endif @if ($rss->object_torrent->genres)@else@endif diff --git a/resources/views/blocks/top_torrents.blade.php b/resources/views/blocks/top_torrents.blade.php index bea60c5896..df0a3da049 100644 --- a/resources/views/blocks/top_torrents.blade.php +++ b/resources/views/blocks/top_torrents.blade.php @@ -48,7 +48,8 @@ - + + @@ -60,31 +61,38 @@ @foreach ($newest as $new) - + +
    @lang('torrent.category')@lang('torrent.type')/@lang('torrent.resolution') @lang('torrent.name') @lang('torrent.age') @lang('torrent.size')
    + @if ($new->category->image != null)
    - {{ $new->category->name }} + {{ $new->category->name }}
    @else
    + data-original-title="{{ $new->category->name }} {{ strtolower(trans('torrent.torrent')) }}">
    @endif -
    +
    +
    + data-original-title="@lang('torrent.type')"> {{ $new->type->name }}
    +
    + + {{ $new->resolution->name }} + +
    @@ -303,7 +311,8 @@ class="torrentBookmark"> - + + @@ -315,31 +324,38 @@ class="torrentBookmark"> @foreach ($seeded as $seed) - + +
    @lang('torrent.category')@lang('torrent.type')/@lang('torrent.resolution') @lang('torrent.name') @lang('torrent.age') @lang('torrent.size')
    + @if ($seed->category->image != null)
    - {{ $seed->category->name }} + {{ $seed->category->name }}
    @else
    + data-original-title="{{ $seed->category->name }} {{ strtolower(trans('torrent.torrent')) }}">
    @endif -
    +
    +
    + data-original-title="@lang('torrent.type')"> {{ $seed->type->name }}
    +
    + + {{ $seed->resolution->name }} + +
    @@ -559,7 +575,8 @@ class="torrentBookmark"> - + + @@ -571,29 +588,36 @@ class="torrentBookmark"> @foreach ($leeched as $leech) - + + @@ -815,7 +839,8 @@ class="torrentBookmark">
    @lang('torrent.category')@lang('torrent.type')/@lang('torrent.resolution') @lang('torrent.name') @lang('torrent.age') @lang('torrent.size')
    + @if ($leech->category->image != null)
    - {{ $leech->category->name }} + {{ $leech->category->name }}
    @else
    + data-original-title="{{ $leech->category->name }} {{ strtolower(trans('torrent.torrent')) }}">
    @endif -
    +
    +
    + data-original-title="@lang('torrent.type')"> {{ $leech->type->name }} + +
    +
    + + {{ $leech->resolution->name }}
    - + + @@ -827,31 +852,39 @@ class="torrentBookmark"> @foreach ($dying as $d) - + +
    @lang('torrent.category')@lang('torrent.type')/@lang('torrent.resolution') @lang('torrent.name') @lang('torrent.age') @lang('torrent.size')
    + @if ($d->category->image != null)
    - {{ $d->category->name }} + {{ $d->category->name }}
    @else
    + data-original-title="{{ $d->category->name }} {{ strtolower(trans('torrent.torrent')) }}" + >
    @endif -
    +
    +
    + data-original-title="@lang('torrent.type')"> {{ $d->type->name }}
    +
    + + {{ $d->resolution->name }} + +
    @@ -1070,7 +1103,8 @@ class="torrentBookmark"> - + + @@ -1082,31 +1116,39 @@ class="torrentBookmark"> @foreach ($dead as $d) - + + @endif - + + @@ -108,29 +109,38 @@ class="torrent-poster-img-small show-poster" alt="@lang('torrent.poster')">
    @endif - - + + diff --git a/resources/views/partials/dashboardmenu.blade.php b/resources/views/partials/dashboardmenu.blade.php index 9592bebae9..16b5df8ccf 100644 --- a/resources/views/partials/dashboardmenu.blade.php +++ b/resources/views/partials/dashboardmenu.blade.php @@ -112,6 +112,11 @@ @lang('staff.torrent-types') +
  • + + @lang('staff.torrent-resolutions') + +
  • @lang('torrent.genre-tags') diff --git a/resources/views/requests/add_request.blade.php b/resources/views/requests/add_request.blade.php index b68e3593c3..03bf3ceaea 100644 --- a/resources/views/requests/add_request.blade.php +++ b/resources/views/requests/add_request.blade.php @@ -92,7 +92,7 @@ + +
    + + +
    diff --git a/resources/views/requests/edit_request.blade.php b/resources/views/requests/edit_request.blade.php index 37858faf26..2eebb2d556 100644 --- a/resources/views/requests/edit_request.blade.php +++ b/resources/views/requests/edit_request.blade.php @@ -106,6 +106,20 @@
    + +
    + + +
    diff --git a/resources/views/requests/request.blade.php b/resources/views/requests/request.blade.php index e71f68a312..ee74d92b43 100644 --- a/resources/views/requests/request.blade.php +++ b/resources/views/requests/request.blade.php @@ -102,6 +102,14 @@ class="{{ config('other.font-awesome') }} fa-trash"> {{ $torrentRequest->type->name }}
  • + + + +
    @lang('torrent.category')@lang('torrent.type')/@lang('torrent.resolution') @lang('torrent.name') @lang('torrent.age') @lang('torrent.size')
    + @if ($d->category->image != null)
    - {{ $d->category->name }} + {{ $d->category->name }}
    @else
    + data-original-title="{{ $d->category->name }} {{ strtolower(trans('torrent.torrent')) }}" + >
    @endif -
    +
    +
    + data-original-title="@lang('torrent.type')"> {{ $d->type->name }}
    +
    + + {{ $d->resolution->name }} + +
    diff --git a/resources/views/category/show.blade.php b/resources/views/category/show.blade.php index 8dd634dc7a..e562301cec 100755 --- a/resources/views/category/show.blade.php +++ b/resources/views/category/show.blade.php @@ -43,7 +43,8 @@ @else Category/Type@lang('torrent.category')@lang('torrent.type')/@lang('torrent.resolution') @lang('common.name') + + @if ($torrent->category->image != null)
    - {{ $torrent->category->name }} + {{ $torrent->category->name }}
    @else
    + data-original-title="{{ $torrent->category->name }} {{ strtolower(trans('torrent.torrent')) }}" + style="padding-top: 10px;">
    @endif -
    - - {{ $torrent->type->names }} +
    +
    + + {{ $torrent->type->name }} + +
    +
    + + {{ $torrent->resolution->name }}
    + @lang('torrent.resolution') + + {{ $torrentRequest->resolution->name }} +
    @lang('bon.bon') diff --git a/resources/views/requests/requests.blade.php b/resources/views/requests/requests.blade.php index 1e1cfb5183..e973c36ecf 100644 --- a/resources/views/requests/requests.blade.php +++ b/resources/views/requests/requests.blade.php @@ -69,7 +69,7 @@ class="form-horizontal form-condensed form-torrent-search form-bordered"> @foreach ($repository->categories() as $id => $category) @endforeach @@ -82,7 +82,20 @@ class="form-horizontal form-condensed form-torrent-search form-bordered"> @foreach ($repository->types() as $id => $type) + + @endforeach + + + +
    + +
    + @foreach ($repository->resolutions() as $id => $resolution) + + @endforeach @@ -227,6 +240,7 @@ function faceted(page) { var igdb = $("#igdb").val(); var categories = []; var types = []; + var resolutions = []; var sorting = $("#sorting").val(); var direction = $("#direction").val(); var qty = $("#qty").val(); @@ -276,6 +290,9 @@ function faceted(page) { $(".type:checked").each(function() { types.push($(this).val()); }); + $(".resolution:checked").each(function() { + resolutions.push($(this).val()); + }); if (xhr !== 'undefined') { xhr.abort(); @@ -293,6 +310,7 @@ function faceted(page) { igdb: igdb, categories: categories, types: types, + resolutions: resolutions, myrequests: myrequests, myclaims: myclaims, myvoted: myvoted, @@ -358,7 +376,7 @@ function faceted(page) {