Fix error with get_movie and get_episode

This commit is contained in:
Matthew Welch 2021-08-01 11:49:56 -07:00
parent bd75ecc6ef
commit 51e75e9f0f

View File

@ -168,7 +168,7 @@ def get_movie(tmdb_id):
directors_cut = request.args.get("directors_cut", default=False, type=bool)
res_4k = request.args.get("res_4k", default=False, type=bool)
movie_data = database.db_get_movie_by_tmdb_id(tmdb_id, extended=extended, directors_cut=directors_cut)
filename = movie_data.path.replace(func.MOVIES_DIRECTORY, "")
filename = movie_data.path.replace(str(func.MOVIES_DIRECTORY), "")
if res_4k:
filename = filename.replace(f"({movie_data.year})", f"({movie_data.year})(4K)")
response = make_response(send_from_directory(func.MOVIES_DIRECTORY, filename))
@ -180,7 +180,7 @@ def get_movie(tmdb_id):
@login_required
def get_episode(tmdb_id):
episode_data = database.db_get_episode_by_tmdb_id(tmdb_id)
filename = episode_data.path.replace(func.TV_SHOWS_DIRECTORY, "")
filename = episode_data.path.replace(str(func.TV_SHOWS_DIRECTORY), "")
response = make_response(send_from_directory(func.TV_SHOWS_DIRECTORY, filename))
response.headers["content-type"] = "video/webm"
return response