Skip to content

Commit

Permalink
Update Youtube to extend from Abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jan 1, 2025
1 parent bc72f4c commit f48fecb
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions plextraktsync/plex/guid/provider/Youtube.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
from __future__ import annotations

from typing import TYPE_CHECKING
from functools import cached_property

if TYPE_CHECKING:
from plextraktsync.plex.guid.PlexGuid import PlexGuid
from .Abstract import Abstract


class Youtube:
def __init__(self, guid: PlexGuid):
self.guid = guid

class Youtube(Abstract):
@property
def id(self):
return self.guid.id.split("|")[1]

@property
@cached_property
def link(self):
return f"https://www.youtube.com/watch?v={self.id}"

@property
@cached_property
def title(self):
return f"{self.guid.provider}:{self.guid.type}:{self.id}"

0 comments on commit f48fecb

Please sign in to comment.