home · contact · privacy
Fix broken redir_target passing. master
authorChristian Heller <c.heller@plomlompom.de>
Thu, 5 Dec 2024 03:21:06 +0000 (04:21 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 5 Dec 2024 03:21:06 +0000 (04:21 +0100)
src/templates/file_data.tmpl
src/templates/playlist.tmpl
src/ytplom/http.py

index 4ae310ea904e046355d363c842d423525f8ec225..8df4bf01cd13f1f44660f96f8ae6b5902a5d87d7 100644 (file)
@@ -10,5 +10,5 @@ td.tag_checkboxes { width: 1em; }
 
 {% block body %}
 {{ macros.nav_head(page_names) }}
 
 {% block body %}
 {{ macros.nav_head(page_names) }}
-{{ macros.file_data_form(file, unused_tags, page_names, redir_target="/{{page_names.file}}/{{file.digest.b64}}", flag_names) }}
+{{ macros.file_data_form(file, unused_tags, page_names, redir_target, flag_names) }}
 {% endblock %}
 {% endblock %}
index 21c9fd82f74c0c561cfecfa08e290b87b0d7ad09..63671f7a89af35a30d6aedb46cd2ddd9cabb5196 100644 (file)
@@ -61,7 +61,7 @@ filter tags: <input name="filter_tags" value="{{filter_tags}}" />
 <tr>
 <td class="screen_half">
 {% if current_file %}
 <tr>
 <td class="screen_half">
 {% if current_file %}
-{{ macros.file_data_form(current_file, unused_tags, page_names, redir_target="{{redir_target}}", playlist_view=true) }}
+{{ macros.file_data_form(current_file, unused_tags, page_names, redir_target, playlist_view=true) }}
 {% endif %}
 </td>
 <td class="screen_half">
 {% endif %}
 </td>
 <td class="screen_half">
index 696dd983a264182abb7dcdcb67e0d9787958ed76..6d7a085626623a5ceba42678d03490dac28a9292 100644 (file)
@@ -302,10 +302,13 @@ class _TaskHandler(BaseHTTPRequestHandler):
         with DbConn() as conn:
             file = VideoFile.get_one(conn, digest)
             unused_tags = file.unused_tags(conn)
         with DbConn() as conn:
             file = VideoFile.get_one(conn, digest)
             unused_tags = file.unused_tags(conn)
+        redir_target = Path('/').joinpath(PAGE_NAMES['file']).joinpath(
+                file.digest.b64)
         self._send_rendered_template(_NAME_TEMPLATE_FILE_DATA,
                                      {'file': file,
                                       'flag_names': list(FILE_FLAGS),
         self._send_rendered_template(_NAME_TEMPLATE_FILE_DATA,
                                      {'file': file,
                                       'flag_names': list(FILE_FLAGS),
-                                      'unused_tags': unused_tags})
+                                      'unused_tags': unused_tags,
+                                      'redir_target': redir_target})
 
     def _send_files_index(self, params: _ReqMap) -> None:
         filter_path = FilterStr(params.single_value('filter_path'))
 
     def _send_files_index(self, params: _ReqMap) -> None:
         filter_path = FilterStr(params.single_value('filter_path'))