Просмотр исходного кода

[videos] Fix next episode error

Colin Powell 2 недель назад
Родитель
Сommit
1275186d86
2 измененных файлов с 30 добавлено и 26 удалено
  1. 27 24
      PROJECT.org
  2. 3 2
      vrobbler/apps/videos/views.py

+ 27 - 24
PROJECT.org

@@ -428,7 +428,33 @@ https://app.todoist.com/app/task/add-a-csv-endpoint-for-users-book-reads-that-li
 :END:
 
 ** TODO [#A] Tasks from org-mode should properly update notes and leave them out of the body :vrobbler:bug:tasks:
-** TODO [#A] Fix views for TV series where next episode is now None :vrobbler:bug:personal:videos:
+** TODO [#A] Fix koreader scrobble imports to use DST properly :vrobbler:personal:bug:books:imports:
+
+- Note taken on [2025-09-25 Thu 10:37] \\
+
+  This may already be fixed ... need to check.
+
+- Note taken on [2025-02-25 12:34] \\
+
+  The page data has the canonical date something was read in it, but it seems
+  to be an hour off. I traced this back to being off during DST, so we just need
+  the importer to be aware of whether a user is using DST or not and roll back
+  an hour for part of the year. Also, we'd need to adjust any old scrobbles that
+  took place with DST off to roll them back by an hour.
+
+** TODO [#A] Allow scrobbling from the Food list page's start links :vrobbler:bug:food:scrobbling:personal:project:
+https://life.lab.unbl.ink/scrobble/e39779c8-62a5-46a6-bdef-fb7662810dc6/start/
+** TODO [#A] Puzzles (and all longplays) should have a "Completed?" column on their detail page :vrobbler:bug:puzzles:personal:project:
+** TODO [#A] Fix raw text webpage title not truncating to 254 chars :vrobbler:personal:bug:webpages:
+
+- Note taken on [2025-09-30 Tue 09:33]
+
+  This may have already been resolved ... need to just confirm it.
+** TODO [#A] Find page numbers for comic books from ComicVine :vrobbler:feature:books:personal:project:
+** STRT [#A] Fix views for TV series where next episode is now None :vrobbler:bug:personal:videos:
+:PROPERTIES:
+:ID:       d7014ac4-cda6-0802-2cdf-8f66c6389fea
+:END:
 
 #+begin_src python
 ERROR    django.request:241 log_response Internal Server Error: /series/c24100d1-da45-4abe-86bf-27cfce9b1f89/
@@ -457,29 +483,6 @@ Traceback (most recent call last):
 TypeError: can only concatenate str (not "NoneType") to str
 #+end_src
 
-** TODO [#A] Fix koreader scrobble imports to use DST properly :vrobbler:personal:bug:books:imports:
-
-- Note taken on [2025-09-25 Thu 10:37] \\
-
-  This may already be fixed ... need to check.
-
-- Note taken on [2025-02-25 12:34] \\
-
-  The page data has the canonical date something was read in it, but it seems
-  to be an hour off. I traced this back to being off during DST, so we just need
-  the importer to be aware of whether a user is using DST or not and roll back
-  an hour for part of the year. Also, we'd need to adjust any old scrobbles that
-  took place with DST off to roll them back by an hour.
-
-** TODO [#A] Allow scrobbling from the Food list page's start links :vrobbler:bug:food:scrobbling:personal:project:
-https://life.lab.unbl.ink/scrobble/e39779c8-62a5-46a6-bdef-fb7662810dc6/start/
-** TODO [#A] Puzzles (and all longplays) should have a "Completed?" column on their detail page :vrobbler:bug:puzzles:personal:project:
-** TODO [#A] Fix raw text webpage title not truncating to 254 chars :vrobbler:personal:bug:webpages:
-
-- Note taken on [2025-09-30 Tue 09:33]
-
-  This may have already been resolved ... need to just confirm it.
-** TODO [#A] Find page numbers for comic books from ComicVine :vrobbler:feature:books:personal:project:
 ** DONE [#A] Emacs tasks are duplicating rather than updating :vrobbler:bug:tasks:emacs:personal:project:
 :PROPERTIES:
 :ID:       e93efc25-7ce9-8ef2-662e-0a19dd0b29c9

+ 3 - 2
vrobbler/apps/videos/views.py

@@ -27,10 +27,11 @@ class SeriesDetailView(LoginRequiredMixin, generic.DetailView):
         context_data["scrobbles"] = self.object.scrobbles_for_user(user_id)
         next_episode_id = self.object.last_scrobbled_episode(
             user_id
-        ).next_imdb_id
+        ).next_imdb_id or ""
         if self.object.is_episode_playing(user_id):
             next_episode_id = ""
-        context_data["next_episode_id"] = "tt" + next_episode_id
+        if next_episode_id:
+            context_data["next_episode_id"] = "tt" + next_episode_id
         return context_data