From 74c88dbfa8ba2bfa8f5aac9131ded0987e265f8f Mon Sep 17 00:00:00 2001 From: Ian Walton Date: Tue, 31 Mar 2020 02:55:35 -0400 Subject: [PATCH] Fix crash caused by anti-cache code. --- jellyfin_mpv_shim/webclient_view/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jellyfin_mpv_shim/webclient_view/__init__.py b/jellyfin_mpv_shim/webclient_view/__init__.py index e0fb7c3ea5..e8e56cf82d 100644 --- a/jellyfin_mpv_shim/webclient_view/__init__.py +++ b/jellyfin_mpv_shim/webclient_view/__init__.py @@ -34,8 +34,10 @@ def do_not_cache(response): response.cache_control.no_store = True - response.cache_control.max_age = None - response.cache_control.public = False + if response.cache_control.max_age: + response.cache_control.max_age = None + if response.cache_control.public: + response.cache_control.public = False # Based on https://stackoverflow.com/questions/15562446/ class Server(threading.Thread):