From b2d93b261a319e05c1c55f82fbe7ff2febd03384 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 6 Oct 2025 00:42:49 +0200 Subject: [PATCH] Fix rss feed --- app/Http/Controllers/RssController.php | 46 ++--- resources/views/rss/rssdesc.blade.php | 263 +++++++++++++++++++++++++ 2 files changed, 279 insertions(+), 30 deletions(-) create mode 100644 resources/views/rss/rssdesc.blade.php diff --git a/app/Http/Controllers/RssController.php b/app/Http/Controllers/RssController.php index f23a00488..5d2a27919 100644 --- a/app/Http/Controllers/RssController.php +++ b/app/Http/Controllers/RssController.php @@ -91,51 +91,37 @@ class RssController extends BasePageController /** * @throws \Exception */ - public function showRssDesc(): void + public function showRssDesc() { $this->setPreferences(); $rss = new RSS; - $title = 'Rss Info'; - $meta_title = 'Rss Nzb Info'; - $meta_keywords = 'view,nzb,description,details,rss,atom'; - $meta_description = 'View information about NNTmux RSS Feeds.'; - $firstShow = $rss->getFirstInstance('videos_id', 'releases', 'id'); $firstAni = $rss->getFirstInstance('anidbid', 'releases', 'id'); - if ($firstShow !== null) { - $this->smarty->assign('show', $firstShow->videos_id); - } else { - $this->smarty->assign('show', 1); - } - - if ($firstAni !== null) { - $this->smarty->assign('anidb', $firstAni->anidbid); - } else { - $this->smarty->assign('anidb', 1); - } + $show = ($firstShow !== null) ? $firstShow->videos_id : 1; + $anidb = ($firstAni !== null) ? $firstAni->anidbid : 1; $catExclusions = $this->userdata->categoryexclusions ?? []; - $this->smarty->assign( - [ - 'categorylist' => Category::getCategories(true, $catExclusions), - 'parentcategorylist' => Category::getForMenu($catExclusions), - ] - ); + $this->viewData = array_merge($this->viewData, [ + 'show' => $show, + 'anidb' => $anidb, + 'categorylist' => Category::getCategories(true, $catExclusions), + 'parentcategorylist' => Category::getForMenu($catExclusions), + 'title' => 'Rss Info', + 'meta_title' => 'Rss Nzb Info', + 'meta_keywords' => 'view,nzb,description,details,rss,atom', + 'meta_description' => 'View information about NNTmux RSS Feeds.', + ]); - $content = $this->smarty->fetch('rssdesc.tpl'); - $this->smarty->assign( - compact('content', 'title', 'meta_title', 'meta_keywords', 'meta_description') - ); - $this->pagerender(); + return view('rss.rssdesc', $this->viewData); } /** * @throws \Throwable */ - public function cartRss(Request $request): JsonResponse|array + public function cartRss(Request $request) { $rss = new RSS; $offset = 0; @@ -161,7 +147,7 @@ class RssController extends BasePageController /** * @throws \Throwable */ - public function categoryFeedRss(Request $request): JsonResponse|array + public function categoryFeedRss(Request $request) { $rss = new RSS; $offset = 0; diff --git a/resources/views/rss/rssdesc.blade.php b/resources/views/rss/rssdesc.blade.php new file mode 100644 index 000000000..50b2a8b39 --- /dev/null +++ b/resources/views/rss/rssdesc.blade.php @@ -0,0 +1,263 @@ +@extends('layouts.main') + +@section('content') +
+
+

{{ $title }}

+
+
+

+ Here you can find RSS feeds for various categories and content types. These feeds provide either descriptions or + direct NZB downloads based on your preferences. +

+ + @if($loggedin ?? false) +
+

Your API Token

+
+ + +
+
+ @endif + +

RSS Configuration Options

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescriptionExample
api_tokenAdd this to your feed URL to allow NZB downloads without logging in&api_token={{ $userdata->api_token ?? 'YOUR_TOKEN' }}
del=1Remove NZB from your cart after download&del=1
dl=1Change the default link to download an NZB&dl=1
num=50Change the number of results returned (default: 25, max: 100)&num=50
airdate=20Return TV shows only aired in the last x days (default: all)&airdate=20
+
+ +
+ + Most NZB clients which support NZB RSS feeds will appreciate the full URL, with download link and your user token. + The feeds include additional attributes to help provide better filtering in your NZB client, such as size, group, + and categorization. +
+ +
+ + Pro Tip: If you want to chain multiple categories together or do more advanced searching, use the + API, which returns its data in an RSS-compatible format. +
+ +

Available Feeds

+ + +
+
+
General Feeds
+
+
+
+
+
+ Full Site Feed + + Open Feed + +
+
+ + +
+ You can define limit and num parameters, which will decide how many items to show and what offset to use (default values: limit 100 and offset 0). +
+ +
+
+ My Cart Feed + + Open Feed + +
+
+ + +
+
+ +
+
+ My Shows Feed + + Open Feed + +
+
+ + +
+
+ +
+
+ My Movies Feed + + Open Feed + +
+
+ + +
+
+
+
+
+ + +
+
+
+
+
Parent Categories
+
+
+
+ @foreach($parentcategorylist ?? [] as $category) +
+
+ {{ $category['title'] }} + + Open Feed + +
+
+ + +
+
+ @endforeach +
+
+
+
+ +
+
+
+
Sub Categories
+
+
+
+ @foreach($categorylist ?? [] as $category) + @if(!empty($category['title'])) +
+
+ {{ $category['title'] }} + + Open Feed + +
+
+ + +
+
+ @endif + @endforeach +
+
+
+
+
+
+
+ +@push('scripts') + +@endpush +@endsection +