@@ -64,7 +64,7 @@ public function __construct()
64
64
* @param int $minSize
65
65
* @return Collection|mixed
66
66
*/
67
- public function getBrowseRange ($ page , $ cat , $ start , $ num , $ orderBy , int $ maxAge = -1 , array $ excludedCats = [], int |string $ groupName = -1 , int $ minSize = 0 , array $ tags = [])
67
+ public function getBrowseRange ($ page , $ cat , $ start , $ num , $ orderBy , int $ maxAge = -1 , array $ excludedCats = [], int |string $ groupName = -1 , int $ minSize = 0 , array $ tags = []): mixed
68
68
{
69
69
$ orderBy = $ this ->getBrowseOrder ($ orderBy );
70
70
@@ -161,7 +161,7 @@ public function getBrowseCount(array $cat, int $maxAge = -1, array $excludedCats
161
161
/**
162
162
* @return string
163
163
*/
164
- public function showPasswords ()
164
+ public function showPasswords (): string
165
165
{
166
166
$ show = (int ) Settings::settingValue ('..showpasswordedrelease ' );
167
167
$ setting = $ show ?? 0 ;
@@ -217,13 +217,10 @@ public function getBrowseOrdering(): array
217
217
}
218
218
219
219
/**
220
- * Get list of releases available for export.
221
- *
222
- *
223
220
* @param string $postFrom
224
221
* @param string $postTo
225
222
* @param string $groupID
226
- * @return Collection |\Illuminate\Support\ Collection|static[]
223
+ * @return \App\Models\Release[] |\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\ Collection|\Illuminate\Database\Query\Builder[]|\Illuminate\Support\Collection
227
224
*/
228
225
public function getForExport (string $ postFrom = '' , string $ postTo = '' , string $ groupID = '' )
229
226
{
@@ -257,40 +254,27 @@ public function getForExport(string $postFrom = '', string $postTo = '', string
257
254
}
258
255
259
256
/**
260
- * Get date in this format : 01/01/2014 of the oldest release.
261
- *
262
- * @note Used for exporting NZBs.
263
- *
264
- * @return mixed
257
+ * @return mixed|string
265
258
*/
266
- public function getEarliestUsenetPostDate ()
259
+ public function getEarliestUsenetPostDate (): mixed
267
260
{
268
261
$ row = self ::query ()->selectRaw ("DATE_FORMAT(min(postdate), '%d/%m/%Y') AS postdate " )->first ();
269
262
270
263
return $ row === null ? '01/01/2014 ' : $ row ['postdate ' ];
271
264
}
272
265
273
266
/**
274
- * Get date in this format : 01/01/2014 of the newest release.
275
- *
276
- * @note Used for exporting NZBs.
277
- *
278
- * @return mixed
267
+ * @return mixed|string
279
268
*/
280
- public function getLatestUsenetPostDate ()
269
+ public function getLatestUsenetPostDate (): mixed
281
270
{
282
271
$ row = self ::query ()->selectRaw ("DATE_FORMAT(max(postdate), '%d/%m/%Y') AS postdate " )->first ();
283
272
284
273
return $ row === null ? '01/01/2014 ' : $ row ['postdate ' ];
285
274
}
286
275
287
276
/**
288
- * Gets all groups for drop down selection on NZB-Export web page.
289
- *
290
277
* @param bool $blnIncludeAll
291
- *
292
- * @note Used for exporting NZBs.
293
- *
294
278
* @return array
295
279
*/
296
280
public function getReleasedGroupsForSelect (bool $ blnIncludeAll = true ): array
@@ -313,16 +297,13 @@ public function getReleasedGroupsForSelect(bool $blnIncludeAll = true): array
313
297
}
314
298
315
299
/**
316
- * Get TV for My Shows page.
317
- *
318
- *
319
300
* @param $userShows
320
301
* @param $offset
321
302
* @param $limit
322
303
* @param $orderBy
323
304
* @param int $maxAge
324
305
* @param array $excludedCats
325
- * @return Collection|mixed
306
+ * @return \Illuminate\Cache\|\Illuminate\Database\Eloquent\ Collection|mixed
326
307
*/
327
308
public function getShowsRange ($ userShows , $ offset , $ limit , $ orderBy , int $ maxAge = -1 , array $ excludedCats = [])
328
309
{
@@ -363,9 +344,7 @@ public function getShowsRange($userShows, $offset, $limit, $orderBy, int $maxAge
363
344
}
364
345
365
346
/**
366
- * Get count for my shows page pagination.
367
- *
368
- * @param $userShows
347
+ * @param $userShows
369
348
* @param int $maxAge
370
349
* @param array $excludedCats
371
350
* @return int
@@ -393,9 +372,8 @@ public function getShowsCount($userShows, int $maxAge = -1, array $excludedCats
393
372
}
394
373
395
374
/**
396
- * Delete multiple releases, or a single by ID.
397
- *
398
- * @param int|array|string $list Array of GUID or ID of releases to delete.
375
+ * @param int|array|string $list
376
+ * @return void
399
377
*
400
378
* @throws \Exception
401
379
*/
@@ -540,7 +518,7 @@ public function uSQL(Collection|array $userQuery, string $type): string
540
518
* @throws \Foolz\SphinxQL\Exception\DatabaseException
541
519
* @throws \Foolz\SphinxQL\Exception\SphinxQLException
542
520
*/
543
- public function search (array $ searchArr , $ groupName , $ sizeFrom , $ sizeTo , $ daysNew , $ daysOld , int $ offset = 0 , int $ limit = 1000 , array |string $ orderBy = '' , int $ maxAge = -1 , array $ excludedCats = [], string $ type = 'basic ' , array $ cat = [-1 ], int $ minSize = 0 , array $ tags = [])
521
+ public function search (array $ searchArr , $ groupName , $ sizeFrom , $ sizeTo , $ daysNew , $ daysOld , int $ offset = 0 , int $ limit = 1000 , array |string $ orderBy = '' , int $ maxAge = -1 , array $ excludedCats = [], string $ type = 'basic ' , array $ cat = [-1 ], int $ minSize = 0 , array $ tags = []): mixed
544
522
{
545
523
$ sizeRange = [
546
524
1 => 1 ,
@@ -816,7 +794,7 @@ public function tvSearch(array $siteIdArr = [], string $series = '', string $epi
816
794
if (! empty ($ name ) && $ showSql === '' ) {
817
795
if (! empty ($ series ) && (int ) $ series < 1900 ) {
818
796
$ name .= sprintf (' S%s ' , str_pad ($ series , 2 , '0 ' , STR_PAD_LEFT ));
819
- if (! empty ($ episode ) && strpos ($ episode , '/ ' ) === false ) {
797
+ if (! empty ($ episode ) && ! str_contains ($ episode , '/ ' )) {
820
798
$ name .= sprintf ('E%s ' , str_pad ($ episode , 2 , '0 ' , STR_PAD_LEFT ));
821
799
}
822
800
} elseif (! empty ($ airDate )) {
@@ -917,7 +895,7 @@ public function tvSearch(array $siteIdArr = [], string $series = '', string $epi
917
895
* @throws \Foolz\SphinxQL\Exception\DatabaseException
918
896
* @throws \Foolz\SphinxQL\Exception\SphinxQLException
919
897
*/
920
- public function apiTvSearch (array $ siteIdArr = [], string $ series = '' , string $ episode = '' , string $ airDate = '' , int $ offset = 0 , int $ limit = 100 , string $ name = '' , array $ cat = [-1 ], int $ maxAge = -1 , int $ minSize = 0 , array $ excludedCategories = [], array $ tags = [])
898
+ public function apiTvSearch (array $ siteIdArr = [], string $ series = '' , string $ episode = '' , string $ airDate = '' , int $ offset = 0 , int $ limit = 100 , string $ name = '' , array $ cat = [-1 ], int $ maxAge = -1 , int $ minSize = 0 , array $ excludedCategories = [], array $ tags = []): mixed
921
899
{
922
900
$ siteSQL = [];
923
901
$ showSql = '' ;
@@ -945,7 +923,7 @@ public function apiTvSearch(array $siteIdArr = [], string $series = '', string $
945
923
);
946
924
$ show = self ::fromQuery ($ showQry );
947
925
if ($ show ->isNotEmpty ()) {
948
- if ((! empty ($ series ) || ! empty ($ episode ) || ! empty ($ airDate )) && $ show [0 ]->episodes != '' ) {
926
+ if ((! empty ($ series ) || ! empty ($ episode ) || ! empty ($ airDate )) && $ show [0 ]->episodes !== '' ) {
949
927
$ showSql = sprintf ('AND r.tv_episodes_id IN (%s) ' , $ show [0 ]->episodes );
950
928
} elseif ((int ) $ show [0 ]->video > 0 ) {
951
929
$ showSql = 'AND r.videos_id = ' .$ show [0 ]->video ;
@@ -1056,7 +1034,7 @@ public function apiTvSearch(array $siteIdArr = [], string $series = '', string $
1056
1034
* @throws \Foolz\SphinxQL\Exception\DatabaseException
1057
1035
* @throws \Foolz\SphinxQL\Exception\SphinxQLException
1058
1036
*/
1059
- public function animeSearch ($ aniDbID , int $ offset = 0 , int $ limit = 100 , string $ name = '' , array $ cat = [-1 ], int $ maxAge = -1 , array $ excludedCategories = [])
1037
+ public function animeSearch ($ aniDbID , int $ offset = 0 , int $ limit = 100 , string $ name = '' , array $ cat = [-1 ], int $ maxAge = -1 , array $ excludedCategories = []): mixed
1060
1038
{
1061
1039
if (! empty ($ name )) {
1062
1040
if (config ('nntmux.elasticsearch_enabled ' ) === true ) {
@@ -1140,7 +1118,7 @@ public function animeSearch($aniDbID, int $offset = 0, int $limit = 100, string
1140
1118
* @throws \Foolz\SphinxQL\Exception\DatabaseException
1141
1119
* @throws \Foolz\SphinxQL\Exception\SphinxQLException
1142
1120
*/
1143
- public function moviesSearch (int $ imDbId = -1 , int $ tmDbId = -1 , int $ traktId = -1 , int $ offset = 0 , int $ limit = 100 , string $ name = '' , array $ cat = [-1 ], int $ maxAge = -1 , int $ minSize = 0 , array $ excludedCategories = [], array $ tags = [])
1121
+ public function moviesSearch (int $ imDbId = -1 , int $ tmDbId = -1 , int $ traktId = -1 , int $ offset = 0 , int $ limit = 100 , string $ name = '' , array $ cat = [-1 ], int $ maxAge = -1 , int $ minSize = 0 , array $ excludedCategories = [], array $ tags = []): mixed
1144
1122
{
1145
1123
if (! empty ($ name )) {
1146
1124
if (config ('nntmux.elasticsearch_enabled ' ) === true ) {
@@ -1219,7 +1197,7 @@ public function moviesSearch(int $imDbId = -1, int $tmDbId = -1, int $traktId =
1219
1197
* @throws \Foolz\SphinxQL\Exception\DatabaseException
1220
1198
* @throws \Foolz\SphinxQL\Exception\SphinxQLException
1221
1199
*/
1222
- public function searchSimilar ($ currentID , $ name , array $ excludedCats = [])
1200
+ public function searchSimilar ($ currentID , $ name , array $ excludedCats = []): bool | array
1223
1201
{
1224
1202
// Get the category for the parent of this release.
1225
1203
$ ret = false ;
0 commit comments