[video] Fix youtube redirects
This commit is contained in:
@ -680,6 +680,12 @@ class Scrobble(TimeStampedModel):
|
|||||||
logger.info(f"Redirecting to {self.media_obj.url}")
|
logger.info(f"Redirecting to {self.media_obj.url}")
|
||||||
redirect_url = self.media_obj.get_read_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
|
return redirect_url
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@ -263,7 +263,7 @@ class Video(ScrobblableMixin):
|
|||||||
@property
|
@property
|
||||||
def youtube_link(self) -> str:
|
def youtube_link(self) -> str:
|
||||||
if self.youtube_id:
|
if self.youtube_id:
|
||||||
return YOUTUBE_BASE_URL + self.youtube_id
|
return f"https://www.youtube.com/watch?v={self.youtube_id}"
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@ -29,8 +29,8 @@ class SeriesDetailView(LoginRequiredMixin, generic.DetailView):
|
|||||||
user_id
|
user_id
|
||||||
).next_imdb_id
|
).next_imdb_id
|
||||||
if self.object.is_episode_playing(user_id):
|
if self.object.is_episode_playing(user_id):
|
||||||
next_episode_id = None
|
next_episode_id = ""
|
||||||
context_data["next_episode_id"] = next_episode_id
|
context_data["next_episode_id"] = "tt" + next_episode_id
|
||||||
return context_data
|
return context_data
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user