summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2023-09-05 08:29:40 -0400
committermorpheus65535 <[email protected]>2023-09-05 08:29:40 -0400
commit77283e406371c8049f6bc3c92a4fe2ac02b4db25 (patch)
treed62c68219d96d144959e2417c2e355d55cf7c926
parent8895dd68a8e155550a5362ffea96966aebce5221 (diff)
downloadbazarr-77283e406371c8049f6bc3c92a4fe2ac02b4db25.tar.gz
bazarr-77283e406371c8049f6bc3c92a4fe2ac02b4db25.zip
Fixed improper http status code returned that prevented proper cache management on browser side.
-rw-r--r--bazarr/api/episodes/blacklist.py4
-rw-r--r--bazarr/api/episodes/episodes_subtitles.py12
-rw-r--r--bazarr/api/movies/blacklist.py4
-rw-r--r--bazarr/api/movies/movies.py4
-rw-r--r--bazarr/api/movies/movies_subtitles.py12
-rw-r--r--bazarr/api/providers/providers_episodes.py4
-rw-r--r--bazarr/api/providers/providers_movies.py4
-rw-r--r--bazarr/api/series/series.py4
-rw-r--r--bazarr/api/subtitles/subtitles.py4
9 files changed, 26 insertions, 26 deletions
diff --git a/bazarr/api/episodes/blacklist.py b/bazarr/api/episodes/blacklist.py
index 25d7478a0..8c5ffc0c0 100644
--- a/bazarr/api/episodes/blacklist.py
+++ b/bazarr/api/episodes/blacklist.py
@@ -87,7 +87,7 @@ class EpisodesBlacklist(Resource):
@api_ns_episodes_blacklist.response(200, 'Success')
@api_ns_episodes_blacklist.response(401, 'Not Authenticated')
@api_ns_episodes_blacklist.response(404, 'Episode not found')
- @api_ns_episodes_blacklist.response(410, 'Subtitles file not found or permission issue.')
+ @api_ns_episodes_blacklist.response(500, 'Subtitles file not found or permission issue.')
def post(self):
"""Add an episodes subtitles to blacklist"""
args = self.post_request_parser.parse_args()
@@ -125,7 +125,7 @@ class EpisodesBlacklist(Resource):
event_stream(type='episode-history')
return '', 200
else:
- return 'Subtitles file not found or permission issue.', 410
+ return 'Subtitles file not found or permission issue.', 500
delete_request_parser = reqparse.RequestParser()
delete_request_parser.add_argument('all', type=str, required=False, help='Empty episodes subtitles blacklist')
diff --git a/bazarr/api/episodes/episodes_subtitles.py b/bazarr/api/episodes/episodes_subtitles.py
index 520a809a6..2c25bb6de 100644
--- a/bazarr/api/episodes/episodes_subtitles.py
+++ b/bazarr/api/episodes/episodes_subtitles.py
@@ -38,7 +38,7 @@ class EpisodesSubtitles(Resource):
@api_ns_episodes_subtitles.response(401, 'Not Authenticated')
@api_ns_episodes_subtitles.response(404, 'Episode not found')
@api_ns_episodes_subtitles.response(409, 'Unable to save subtitles file. Permission or path mapping issue?')
- @api_ns_episodes_subtitles.response(410, 'Episode file not found. Path mapping issue?')
+ @api_ns_episodes_subtitles.response(500, 'Episode file not found. Path mapping issue?')
def patch(self):
"""Download an episode subtitles"""
args = self.patch_request_parser.parse_args()
@@ -60,7 +60,7 @@ class EpisodesSubtitles(Resource):
episodePath = path_mappings.path_replace(episodeInfo.path)
if not os.path.exists(episodePath):
- return 'Episode file not found. Path mapping issue?', 410
+ return 'Episode file not found. Path mapping issue?', 500
sceneName = episodeInfo.sceneName or "None"
@@ -106,7 +106,7 @@ class EpisodesSubtitles(Resource):
@api_ns_episodes_subtitles.response(401, 'Not Authenticated')
@api_ns_episodes_subtitles.response(404, 'Episode not found')
@api_ns_episodes_subtitles.response(409, 'Unable to save subtitles file. Permission or path mapping issue?')
- @api_ns_episodes_subtitles.response(410, 'Episode file not found. Path mapping issue?')
+ @api_ns_episodes_subtitles.response(500, 'Episode file not found. Path mapping issue?')
def post(self):
"""Upload an episode subtitles"""
args = self.post_request_parser.parse_args()
@@ -124,7 +124,7 @@ class EpisodesSubtitles(Resource):
episodePath = path_mappings.path_replace(episodeInfo.path)
if not os.path.exists(episodePath):
- return 'Episode file not found. Path mapping issue?', 410
+ return 'Episode file not found. Path mapping issue?', 500
audio_language = get_audio_profile_languages(episodeInfo.audio_language)
if len(audio_language) and isinstance(audio_language[0], dict):
@@ -178,7 +178,7 @@ class EpisodesSubtitles(Resource):
@api_ns_episodes_subtitles.response(204, 'Success')
@api_ns_episodes_subtitles.response(401, 'Not Authenticated')
@api_ns_episodes_subtitles.response(404, 'Episode not found')
- @api_ns_episodes_subtitles.response(410, 'Subtitles file not found or permission issue.')
+ @api_ns_episodes_subtitles.response(500, 'Subtitles file not found or permission issue.')
def delete(self):
"""Delete an episode subtitles"""
args = self.delete_request_parser.parse_args()
@@ -211,4 +211,4 @@ class EpisodesSubtitles(Resource):
sonarr_episode_id=sonarrEpisodeId):
return '', 204
else:
- return 'Subtitles file not found or permission issue.', 410
+ return 'Subtitles file not found or permission issue.', 500
diff --git a/bazarr/api/movies/blacklist.py b/bazarr/api/movies/blacklist.py
index 6e679ffae..60c069597 100644
--- a/bazarr/api/movies/blacklist.py
+++ b/bazarr/api/movies/blacklist.py
@@ -80,7 +80,7 @@ class MoviesBlacklist(Resource):
@api_ns_movies_blacklist.response(200, 'Success')
@api_ns_movies_blacklist.response(401, 'Not Authenticated')
@api_ns_movies_blacklist.response(404, 'Movie not found')
- @api_ns_movies_blacklist.response(410, 'Subtitles file not found or permission issue.')
+ @api_ns_movies_blacklist.response(500, 'Subtitles file not found or permission issue.')
def post(self):
"""Add a movies subtitles to blacklist"""
args = self.post_request_parser.parse_args()
@@ -118,7 +118,7 @@ class MoviesBlacklist(Resource):
event_stream(type='movie-history')
return '', 200
else:
- return 'Subtitles file not found or permission issue.', 410
+ return 'Subtitles file not found or permission issue.', 500
delete_request_parser = reqparse.RequestParser()
delete_request_parser.add_argument('all', type=str, required=False, help='Empty movies subtitles blacklist')
diff --git a/bazarr/api/movies/movies.py b/bazarr/api/movies/movies.py
index 7cd77d71f..022769d9d 100644
--- a/bazarr/api/movies/movies.py
+++ b/bazarr/api/movies/movies.py
@@ -165,7 +165,7 @@ class Movies(Resource):
@api_ns_movies.response(204, 'Success')
@api_ns_movies.response(400, 'Unknown action')
@api_ns_movies.response(401, 'Not Authenticated')
- @api_ns_movies.response(410, 'Movie file not found. Path mapping issue?')
+ @api_ns_movies.response(500, 'Movie file not found. Path mapping issue?')
def patch(self):
"""Run actions on specific movies"""
args = self.patch_request_parser.parse_args()
@@ -178,7 +178,7 @@ class Movies(Resource):
try:
movies_download_subtitles(radarrid)
except OSError:
- return 'Movie file not found. Path mapping issue?', 410
+ return 'Movie file not found. Path mapping issue?', 500
else:
return '', 204
elif action == "search-wanted":
diff --git a/bazarr/api/movies/movies_subtitles.py b/bazarr/api/movies/movies_subtitles.py
index 38fd4a428..98c359cdc 100644
--- a/bazarr/api/movies/movies_subtitles.py
+++ b/bazarr/api/movies/movies_subtitles.py
@@ -37,7 +37,7 @@ class MoviesSubtitles(Resource):
@api_ns_movies_subtitles.response(401, 'Not Authenticated')
@api_ns_movies_subtitles.response(404, 'Movie not found')
@api_ns_movies_subtitles.response(409, 'Unable to save subtitles file. Permission or path mapping issue?')
- @api_ns_movies_subtitles.response(410, 'Movie file not found. Path mapping issue?')
+ @api_ns_movies_subtitles.response(500, 'Movie file not found. Path mapping issue?')
def patch(self):
"""Download a movie subtitles"""
args = self.patch_request_parser.parse_args()
@@ -58,7 +58,7 @@ class MoviesSubtitles(Resource):
moviePath = path_mappings.path_replace_movie(movieInfo.path)
if not os.path.exists(moviePath):
- return 'Movie file not found. Path mapping issue?', 410
+ return 'Movie file not found. Path mapping issue?', 500
sceneName = movieInfo.sceneName or 'None'
@@ -103,7 +103,7 @@ class MoviesSubtitles(Resource):
@api_ns_movies_subtitles.response(401, 'Not Authenticated')
@api_ns_movies_subtitles.response(404, 'Movie not found')
@api_ns_movies_subtitles.response(409, 'Unable to save subtitles file. Permission or path mapping issue?')
- @api_ns_movies_subtitles.response(410, 'Movie file not found. Path mapping issue?')
+ @api_ns_movies_subtitles.response(500, 'Movie file not found. Path mapping issue?')
def post(self):
"""Upload a movie subtitles"""
# TODO: Support Multiply Upload
@@ -120,7 +120,7 @@ class MoviesSubtitles(Resource):
moviePath = path_mappings.path_replace_movie(movieInfo.path)
if not os.path.exists(moviePath):
- return 'Movie file not found. Path mapping issue?', 410
+ return 'Movie file not found. Path mapping issue?', 500
audio_language = get_audio_profile_languages(movieInfo.audio_language)
if len(audio_language) and isinstance(audio_language[0], dict):
@@ -174,7 +174,7 @@ class MoviesSubtitles(Resource):
@api_ns_movies_subtitles.response(204, 'Success')
@api_ns_movies_subtitles.response(401, 'Not Authenticated')
@api_ns_movies_subtitles.response(404, 'Movie not found')
- @api_ns_movies_subtitles.response(410, 'Subtitles file not found or permission issue.')
+ @api_ns_movies_subtitles.response(500, 'Subtitles file not found or permission issue.')
def delete(self):
"""Delete a movie subtitles"""
args = self.delete_request_parser.parse_args()
@@ -205,4 +205,4 @@ class MoviesSubtitles(Resource):
radarr_id=radarrId):
return '', 204
else:
- return 'Subtitles file not found or permission issue.', 410
+ return 'Subtitles file not found or permission issue.', 500
diff --git a/bazarr/api/providers/providers_episodes.py b/bazarr/api/providers/providers_episodes.py
index 1192de4c1..9d819dc59 100644
--- a/bazarr/api/providers/providers_episodes.py
+++ b/bazarr/api/providers/providers_episodes.py
@@ -43,7 +43,7 @@ class ProviderEpisodes(Resource):
@authenticate
@api_ns_providers_episodes.response(401, 'Not Authenticated')
@api_ns_providers_episodes.response(404, 'Episode not found')
- @api_ns_providers_episodes.response(410, 'Episode file not found. Path mapping issue?')
+ @api_ns_providers_episodes.response(500, 'Episode file not found. Path mapping issue?')
@api_ns_providers_episodes.doc(parser=get_request_parser)
def get(self):
"""Search manually for an episode subtitles"""
@@ -66,7 +66,7 @@ class ProviderEpisodes(Resource):
episodePath = path_mappings.path_replace(episodeInfo.path)
if not os.path.exists(episodePath):
- return 'Episode file not found. Path mapping issue?', 410
+ return 'Episode file not found. Path mapping issue?', 500
sceneName = episodeInfo.sceneName or "None"
profileId = episodeInfo.profileId
diff --git a/bazarr/api/providers/providers_movies.py b/bazarr/api/providers/providers_movies.py
index 3d84e102e..af3b55358 100644
--- a/bazarr/api/providers/providers_movies.py
+++ b/bazarr/api/providers/providers_movies.py
@@ -44,7 +44,7 @@ class ProviderMovies(Resource):
@authenticate
@api_ns_providers_movies.response(401, 'Not Authenticated')
@api_ns_providers_movies.response(404, 'Movie not found')
- @api_ns_providers_movies.response(410, 'Movie file not found. Path mapping issue?')
+ @api_ns_providers_movies.response(500, 'Movie file not found. Path mapping issue?')
@api_ns_providers_movies.doc(parser=get_request_parser)
def get(self):
"""Search manually for a movie subtitles"""
@@ -65,7 +65,7 @@ class ProviderMovies(Resource):
moviePath = path_mappings.path_replace_movie(movieInfo.path)
if not os.path.exists(moviePath):
- return 'Movie file not found. Path mapping issue?', 410
+ return 'Movie file not found. Path mapping issue?', 500
sceneName = movieInfo.sceneName or "None"
profileId = movieInfo.profileId
diff --git a/bazarr/api/series/series.py b/bazarr/api/series/series.py
index 2e366c561..13bda6f0d 100644
--- a/bazarr/api/series/series.py
+++ b/bazarr/api/series/series.py
@@ -198,7 +198,7 @@ class Series(Resource):
@api_ns_series.response(204, 'Success')
@api_ns_series.response(400, 'Unknown action')
@api_ns_series.response(401, 'Not Authenticated')
- @api_ns_series.response(410, 'Series directory not found. Path mapping issue?')
+ @api_ns_series.response(500, 'Series directory not found. Path mapping issue?')
def patch(self):
"""Run actions on specific series"""
args = self.patch_request_parser.parse_args()
@@ -211,7 +211,7 @@ class Series(Resource):
try:
series_download_subtitles(seriesid)
except OSError:
- return 'Series directory not found. Path mapping issue?', 410
+ return 'Series directory not found. Path mapping issue?', 500
else:
return '', 204
elif action == "search-wanted":
diff --git a/bazarr/api/subtitles/subtitles.py b/bazarr/api/subtitles/subtitles.py
index bf655099a..4822ae644 100644
--- a/bazarr/api/subtitles/subtitles.py
+++ b/bazarr/api/subtitles/subtitles.py
@@ -43,7 +43,7 @@ class Subtitles(Resource):
@api_ns_subtitles.response(401, 'Not Authenticated')
@api_ns_subtitles.response(404, 'Episode/movie not found')
@api_ns_subtitles.response(409, 'Unable to edit subtitles file. Check logs.')
- @api_ns_subtitles.response(410, 'Subtitles file not found. Path mapping issue?')
+ @api_ns_subtitles.response(500, 'Subtitles file not found. Path mapping issue?')
def patch(self):
"""Apply mods/tools on external subtitles"""
args = self.patch_request_parser.parse_args()
@@ -55,7 +55,7 @@ class Subtitles(Resource):
id = args.get('id')
if not os.path.exists(subtitles_path):
- return 'Subtitles file not found. Path mapping issue?', 410
+ return 'Subtitles file not found. Path mapping issue?', 500
if media_type == 'episode':
metadata = database.execute(