[video] Fix youtube redirects

This commit is contained in:
2025-01-21 22:49:15 -05:00
parent c109ed79eb
commit a9499f0463
3 changed files with 9 additions and 3 deletions

View File

@ -680,6 +680,12 @@ class Scrobble(TimeStampedModel):
logger.info(f"Redirecting to {self.media_obj.url}")
redirect_url = self.media_obj.get_read_url()
if (
self.media_type == self.MediaType.VIDEO
and self.media_obj.youtube_id
):
redirect_url = self.media_obj.youtube_link
return redirect_url
@property

View File

@ -263,7 +263,7 @@ class Video(ScrobblableMixin):
@property
def youtube_link(self) -> str:
if self.youtube_id:
return YOUTUBE_BASE_URL + self.youtube_id
return f"https://www.youtube.com/watch?v={self.youtube_id}"
return ""
@property

View File

@ -29,8 +29,8 @@ class SeriesDetailView(LoginRequiredMixin, generic.DetailView):
user_id
).next_imdb_id
if self.object.is_episode_playing(user_id):
next_episode_id = None
context_data["next_episode_id"] = next_episode_id
next_episode_id = ""
context_data["next_episode_id"] = "tt" + next_episode_id
return context_data