# Path: fimfarchive/exceptions.py
# class StorySourceError(FimfarchiveError):
#     """
#     Story source is unusable.
#     """


from typing import TYPE_CHECKING, Any, Dict, Iterable, TypeVar
from fimfarchive.exceptions import StorySourceError
    from fimfarchive.fetchers import Fetcher
    from fimfarchive.flavors import Flavor

    @property
    def is_fetched(self) -> bool:
        """
        True if no more fetches are necessary.
        """
        return self.has_meta and self.has_data

    @property
    def has_meta(self) -> bool:
        """
        True if story meta has been fetched.
        """
        return self._meta is not None

    @property
    def meta(self) -> Dict[str, Any]:
        """
        Returns the story meta.

        Meta may be fetched if this story instance is lazy.

        Raises:
            InvalidStoryError: If a valid story is not found.
            StorySourceError: If source does not return any data.
        """
        if self._meta is None and self.fetcher:
            self._meta = self.fetcher.fetch_meta(self.key)

        if self._meta is None:

# Path: fimfarchive/exceptions.py
# class StorySourceError(FimfarchiveError):
#     """
#     Story source is unusable.
#     """


# Path: fimfarchive/stories.py
from typing import TYPE_CHECKING, Any, Dict, Iterable, TypeVar
from fimfarchive.exceptions import StorySourceError
    from fimfarchive.fetchers import Fetcher
    from fimfarchive.flavors import Flavor


    @property
    def is_fetched(self) -> bool:
        """
        True if no more fetches are necessary.
        """
        return self.has_meta and self.has_data

    @property
    def has_meta(self) -> bool:
        """
        True if story meta has been fetched.
        """
        return self._meta is not None

    @property
    def meta(self) -> Dict[str, Any]:
        """
        Returns the story meta.

        Meta may be fetched if this story instance is lazy.

        Raises:
            InvalidStoryError: If a valid story is not found.
            StorySourceError: If source does not return any data.
        """
        if self._meta is None and self.fetcher:
            self._meta = self.fetcher.fetch_meta(self.key)

        if self._meta is None:

            raise StorySourceError("Meta is missing.")