diff --git a/examples/history.py b/examples/history.py index 4978636..9f54ba7 100644 --- a/examples/history.py +++ b/examples/history.py @@ -6,8 +6,6 @@ You can also extend the abstract class VideoHistory to create your own custom video history storage. """ -from pathlib import Path - from pyngrok import ngrok from ytnoti import YouTubeNotifier, Video @@ -22,7 +20,7 @@ def main(): ngrok.set_auth_token("Your ngrok token here") # This will create a new folder called "videoHistory" in the current directory - video_history = FileVideoHistory(dir_path=Path("./videoHistory")) + video_history = FileVideoHistory(dir_path="./videoHistory") notifier = YouTubeNotifier(video_history=video_history) diff --git a/setup.py b/setup.py index 4ab9130..05f69a7 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="ytnoti", - version="1.1.0", + version="1.1.1", packages=find_packages(), author="SeoulSKY", author_email="contact@seoulsky.org", diff --git a/ytnoti/models/history.py b/ytnoti/models/history.py index 24eb977..7851157 100644 --- a/ytnoti/models/history.py +++ b/ytnoti/models/history.py @@ -5,6 +5,7 @@ import logging from abc import ABC, abstractmethod from collections import OrderedDict +from os import PathLike from pathlib import Path from threading import Lock @@ -92,7 +93,7 @@ class FileVideoHistory(VideoHistory): Represents a file-based history of videos. """ - def __init__(self, *, dir_path: Path, num_videos: int = 100) -> None: + def __init__(self, *, dir_path: str | PathLike[str], num_videos: int = 100) -> None: """ Create a new FileVideoHistory instance. @@ -102,7 +103,7 @@ def __init__(self, *, dir_path: Path, num_videos: int = 100) -> None: """ self._logger = logging.getLogger(self.__class__.__name__) - self._dir_path = dir_path + self._dir_path = Path(dir_path) self._num_videos = num_videos self._lock = Lock()