mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-10-31 02:27:11 -04:00 
			
		
		
		
	Adding 404 to every related query
This commit is contained in:
		
							parent
							
								
									6950b6750a
								
							
						
					
					
						commit
						faa908de7b
					
				| @ -45,11 +45,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Show>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetCollection(id) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -77,11 +75,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Show>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetCollection(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -109,11 +105,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Library>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetCollection(id) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -141,11 +135,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Library>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetCollection(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
|  | ||||
| @ -87,11 +87,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Track>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetEpisode(episodeID) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -123,11 +121,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Track>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetEpisode(showID, seasonNumber, episodeNumber) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -158,11 +154,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Track>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetEpisode(showSlug, seasonNumber, episodeNumber) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
|  | ||||
| @ -49,10 +49,6 @@ namespace Kyoo.Api | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				return NotFound(); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| 				return BadRequest(new {Error = ex.Message}); | ||||
| @ -83,10 +79,6 @@ namespace Kyoo.Api | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				return NotFound(); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| 				return BadRequest(new {Error = ex.Message}); | ||||
|  | ||||
| @ -56,11 +56,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Show>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetLibrary(id) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -88,11 +86,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Show>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetLibrary(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -120,11 +116,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Collection>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetLibrary(id) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -152,11 +146,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Collection>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetLibrary(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -184,11 +176,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<LibraryItem>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetLibrary(id) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -216,11 +206,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<LibraryItem>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetLibrary(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
|  | ||||
| @ -45,11 +45,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Episode>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetSeason(seasonID) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -79,11 +77,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Episode>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetSeason(showSlug, seasonNumber) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -112,11 +108,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Episode>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetSeason(showID, seasonNumber) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
|  | ||||
| @ -45,11 +45,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Season>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(showID) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -77,11 +75,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Season>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -109,11 +105,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Episode>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(showID) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -141,11 +135,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Episode>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -172,11 +164,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<PeopleRole>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(showID) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -203,11 +193,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<PeopleRole>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -235,11 +223,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Genre>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(showID) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -267,11 +253,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Genre>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -327,11 +311,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Library>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(showID) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -359,11 +341,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Library>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -391,11 +371,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Collection>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(showID) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| @ -423,11 +401,9 @@ namespace Kyoo.Api | ||||
| 					new Sort<Collection>(sortBy), | ||||
| 					new Pagination(limit, afterID)); | ||||
| 
 | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				if (!resources.Any() && await _libraryManager.GetShow(slug) == null) | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
|  | ||||
| @ -49,10 +49,6 @@ namespace Kyoo.Api | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				return NotFound(); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| 				return BadRequest(new {Error = ex.Message}); | ||||
| @ -83,10 +79,6 @@ namespace Kyoo.Api | ||||
| 					return NotFound(); | ||||
| 				return Page(resources, limit); | ||||
| 			} | ||||
| 			catch (ItemNotFound) | ||||
| 			{ | ||||
| 				return NotFound(); | ||||
| 			} | ||||
| 			catch (ArgumentException ex) | ||||
| 			{ | ||||
| 				return BadRequest(new {Error = ex.Message}); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user