diff options
author | James Taylor <user234683@users.noreply.github.com> | 2020-09-09 18:53:11 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2020-09-09 18:53:11 -0700 |
commit | c2ca47c5d3f452f94003d48c661a55685be649d0 (patch) | |
tree | f0cfb3ed3ad0609355dd5712ff01983d5f638c67 /youtube | |
parent | 75171b7bd5e8a482702c2eb7b132af75b690b2cc (diff) | |
download | yt-local-c2ca47c5d3f452f94003d48c661a55685be649d0.tar.lz yt-local-c2ca47c5d3f452f94003d48c661a55685be649d0.tar.xz yt-local-c2ca47c5d3f452f94003d48c661a55685be649d0.zip |
Add setting to enable/disable video hotkeys
Diffstat (limited to 'youtube')
-rw-r--r-- | youtube/templates/watch.html | 15 | ||||
-rw-r--r-- | youtube/watch.py | 4 |
2 files changed, 9 insertions, 10 deletions
diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html index f0dcb8d..74b9887 100644 --- a/youtube/templates/watch.html +++ b/youtube/templates/watch.html @@ -48,7 +48,7 @@ width: 150px; } - {% if theater_mode %} + {% if settings.theater_mode %} video{ grid-column: 1 / span 5; justify-self: center; @@ -582,8 +582,8 @@ Reload without invidious (for usage of new identity button).</a> </div> {% endif %} - {% if related_videos_mode != 0 %} - <details class="related-videos-outer" {{'open' if related_videos_mode == 1 else ''}}> + {% if settings.related_videos_mode != 0 %} + <details class="related-videos-outer" {{'open' if settings.related_videos_mode == 1 else ''}}> <summary>Related Videos</summary> <nav class="related-videos-inner"> {% for info in related %} @@ -594,11 +594,11 @@ Reload without invidious (for usage of new identity button).</a> {% endif %} </div> - {% if comments_mode != 0 %} + {% if settings.comments_mode != 0 %} {% if comments_disabled %} <div class="comments-area-outer comments-disabled">Comments disabled</div> {% else %} - <details class="comments-area-outer" {{'open' if comments_mode == 1 else ''}}> + <details class="comments-area-outer" {{'open' if settings.comments_mode == 1 else ''}}> <summary>{{ comment_count|commatize }} comment{{'s' if comment_count != 1 else ''}}</summary> <section class="comments-area-inner comments-area"> {% if comments_info %} @@ -608,6 +608,7 @@ Reload without invidious (for usage of new identity button).</a> </details> {% endif %} {% endif %} - - <script src="/youtube.com/static/js/hotkeys.js"></script> + {% if settings.use_video_hotkeys %} + <script src="/youtube.com/static/js/hotkeys.js"></script> + {% endif %} {% endblock main %} diff --git a/youtube/watch.py b/youtube/watch.py index d102457..c1f5e1e 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -499,9 +499,7 @@ def get_watch_page(video_id=None): comment_count = info['comment_count'], comments_disabled = info['comments_disabled'], - theater_mode = settings.theater_mode, - related_videos_mode = settings.related_videos_mode, - comments_mode = settings.comments_mode, + settings = settings, video_height = video_height, theater_video_target_width = theater_video_target_width, |