# Path: subdownloader/identification.py
# class MovieMatch(Enum):
#     Equal = True
#     NonEqual = False
#     Unknown = None
# 
#     def __and__(self, other):
#         if type(self) != type(other):
#             return MovieMatch.Unknown
# 
#         sv = self.value
#         ov = other.value
# 
#         if sv == MovieMatch.NonEqual or ov == MovieMatch.NonEqual:
#             return MovieMatch.NonEqual
# 
#         if sv == MovieMatch.Equal or ov == MovieMatch.Equal:
#             return MovieMatch.Equal
# 
#         return MovieMatch.Unknown
# 
# Path: subdownloader/languages/language.py
# class UnknownLanguage(Language):
#     def __init__(self, code):
#         Language.__init__(self, 0)
#         self._code = code
# 
#     # FIXME: better name for & check generic logic
# 
#     @classmethod
#     def create_generic(cls):
#         """
#         Return a UnknownLanguage instance..
#         :return: UnknownLanguage instance.
#         """
#         return cls('unknown')  # NO internationalization!
# 
#     def name(self):
#         """
#         Return readable name of Language. Contains info about the unknown Language.
#         :return: Readable name as string
#         """
#         return _(self._code)
# 
#     def generic_name(self):
#         """
#         Return readable name of Language. Contains no info about the unknown Language.
#         :return: Readable name as string
#         """
#         return Language.name(self)
# 
#     def is_generic(self):
#         return self._code == 'unknown'  # NO internationalization!
# 
#     def __eq__(self, other):
#         """
#         Tests if other has the same type of this and the same unknown language code.
#         :return: True if other is of the same type and has the same unknown language code
#         """
#         if not Language.__eq__(self, other):
#             return False
#         return self._code == other._code
# 
#     def __hash__(self):
#         """
#         Return hash of this object.
#         :return: hash integer
#         """
#         return hash((self._id, self._code))
# 
#     def __repr__(self):
#         """
#         Return representation of this instance
#         :return: string representation of self
#         """
#         return '<UnknownLanguage:code={code}>'.format(code=self._code)
# 
# Path: subdownloader/subtitle2.py
# class SubtitleFileCollection(object):
#     def __init__(self, parent):
#         self._parent = parent
#         self._networks = []
#         self._candidates = []
# 
#     def get_parent(self):
#         return self._parent
# 
#     def get_subtitle_networks(self):
#         return self._networks
# 
#     def add_subtitle(self, subtitle, priority=False):
#         for network in self._networks:
#             if network.equals_subtitle_file(subtitle):
#                 network.add_subtitle(subtitle, priority=priority)
#                 return
#         for candidate in self._candidates:
#             if candidate.equals_subtitle_file(subtitle):
#                 network = SubtitleFileNetwork(parent=self, subtitle_file=subtitle)
#                 network.add_subtitle(candidate.get_subtitles()[0])
#                 if priority:
#                     self._networks.insert(0, network)
#                 else:
#                     self._networks.append(network)
#                 self._candidates.remove(candidate)
#                 return
#         network = SubtitleFileNetwork(parent=self, subtitle_file=subtitle)
#         if priority:
#             self._networks.insert(0, network)
#         else:
#             self._networks.append(network)
# 
#     def add_candidates(self, subtitles):
#         for subtitle in subtitles:
#             for candidate in self._candidates:
#                 if candidate.equals_subtitle_file(subtitle):
#                     candidate.add_subtitle(subtitle, reparent=False)
#                     break
#             new_candidate = SubtitleFileNetwork(parent=self, subtitle_file=subtitle, reparent=False)
#             self._candidates.append(new_candidate)
# 
#     def iter_local_subtitles(self):
#         for network in self._networks:
#             for subtitle in network.iter_local_subtitles():
#                 yield subtitle
# 
#     def get_nb_subtitles(self):
#         return sum(len(network) for network in self._networks)
# 
#     def __len__(self):
#         return len(self._networks)
# 
#     def __getitem__(self, item):
#         return self._networks[item]


from subdownloader.identification import MovieMatch
from subdownloader.languages.language import UnknownLanguage
from subdownloader.subtitle2 import SubtitleFileCollection
        from subdownloader.identification import Identities
# -*- coding: utf-8 -*-
# Copyright (c) 2019 SubDownloader Developers - See COPYING - GPLv3



class VideoSubtitle(object):
    def __init__(self, video=None, subtitle=None):
        self.video = video
        self.subtitle = subtitle

    def check(self):
        if not self.video or not self.video.exists():
            return False
        if not self.subtitle or not self.subtitle.exists():
            return False
        return True


class LocalMovie(object):
    def __init__(self):
        self._movie_name = None
        self._imdb_id = None

# Path: subdownloader/identification.py
# class MovieMatch(Enum):
#     Equal = True
#     NonEqual = False
#     Unknown = None
# 
#     def __and__(self, other):
#         if type(self) != type(other):
#             return MovieMatch.Unknown
# 
#         sv = self.value
#         ov = other.value
# 
#         if sv == MovieMatch.NonEqual or ov == MovieMatch.NonEqual:
#             return MovieMatch.NonEqual
# 
#         if sv == MovieMatch.Equal or ov == MovieMatch.Equal:
#             return MovieMatch.Equal
# 
#         return MovieMatch.Unknown
# 
# Path: subdownloader/languages/language.py
# class UnknownLanguage(Language):
#     def __init__(self, code):
#         Language.__init__(self, 0)
#         self._code = code
# 
#     # FIXME: better name for & check generic logic
# 
#     @classmethod
#     def create_generic(cls):
#         """
#         Return a UnknownLanguage instance..
#         :return: UnknownLanguage instance.
#         """
#         return cls('unknown')  # NO internationalization!
# 
#     def name(self):
#         """
#         Return readable name of Language. Contains info about the unknown Language.
#         :return: Readable name as string
#         """
#         return _(self._code)
# 
#     def generic_name(self):
#         """
#         Return readable name of Language. Contains no info about the unknown Language.
#         :return: Readable name as string
#         """
#         return Language.name(self)
# 
#     def is_generic(self):
#         return self._code == 'unknown'  # NO internationalization!
# 
#     def __eq__(self, other):
#         """
#         Tests if other has the same type of this and the same unknown language code.
#         :return: True if other is of the same type and has the same unknown language code
#         """
#         if not Language.__eq__(self, other):
#             return False
#         return self._code == other._code
# 
#     def __hash__(self):
#         """
#         Return hash of this object.
#         :return: hash integer
#         """
#         return hash((self._id, self._code))
# 
#     def __repr__(self):
#         """
#         Return representation of this instance
#         :return: string representation of self
#         """
#         return '<UnknownLanguage:code={code}>'.format(code=self._code)
# 
# Path: subdownloader/subtitle2.py
# class SubtitleFileCollection(object):
#     def __init__(self, parent):
#         self._parent = parent
#         self._networks = []
#         self._candidates = []
# 
#     def get_parent(self):
#         return self._parent
# 
#     def get_subtitle_networks(self):
#         return self._networks
# 
#     def add_subtitle(self, subtitle, priority=False):
#         for network in self._networks:
#             if network.equals_subtitle_file(subtitle):
#                 network.add_subtitle(subtitle, priority=priority)
#                 return
#         for candidate in self._candidates:
#             if candidate.equals_subtitle_file(subtitle):
#                 network = SubtitleFileNetwork(parent=self, subtitle_file=subtitle)
#                 network.add_subtitle(candidate.get_subtitles()[0])
#                 if priority:
#                     self._networks.insert(0, network)
#                 else:
#                     self._networks.append(network)
#                 self._candidates.remove(candidate)
#                 return
#         network = SubtitleFileNetwork(parent=self, subtitle_file=subtitle)
#         if priority:
#             self._networks.insert(0, network)
#         else:
#             self._networks.append(network)
# 
#     def add_candidates(self, subtitles):
#         for subtitle in subtitles:
#             for candidate in self._candidates:
#                 if candidate.equals_subtitle_file(subtitle):
#                     candidate.add_subtitle(subtitle, reparent=False)
#                     break
#             new_candidate = SubtitleFileNetwork(parent=self, subtitle_file=subtitle, reparent=False)
#             self._candidates.append(new_candidate)
# 
#     def iter_local_subtitles(self):
#         for network in self._networks:
#             for subtitle in network.iter_local_subtitles():
#                 yield subtitle
# 
#     def get_nb_subtitles(self):
#         return sum(len(network) for network in self._networks)
# 
#     def __len__(self):
#         return len(self._networks)
# 
#     def __getitem__(self, item):
#         return self._networks[item]


# Path: subdownloader/movie.py
from subdownloader.identification import MovieMatch
from subdownloader.languages.language import UnknownLanguage
from subdownloader.subtitle2 import SubtitleFileCollection
        from subdownloader.identification import Identities

# -*- coding: utf-8 -*-
# Copyright (c) 2019 SubDownloader Developers - See COPYING - GPLv3



class VideoSubtitle(object):
    def __init__(self, video=None, subtitle=None):
        self.video = video
        self.subtitle = subtitle

    def check(self):
        if not self.video or not self.video.exists():
            return False
        if not self.subtitle or not self.subtitle.exists():
            return False
        return True


class LocalMovie(object):
    def __init__(self):
        self._movie_name = None
        self._imdb_id = None

        self._language = UnknownLanguage.create_generic()