# Path: trackma/utils.py
# VERSION = '0.8.4'
# DATADIR = os.path.dirname(__file__) + '/data'
#     PASSWD = auto()
#     OAUTH = auto()
#     OAUTH_PKCE = auto()
#     UNKNOWN = 'Unknown'
#     ONGOING = 'Ongoing'
#     FINISHED = 'Finished'
#     NOTYET = 'Not yet started'
#     CANCELLED = 'Cancelled'
#     OTHER = 'Other'
#     AIRING = ONGOING
#     RELEASING = ONGOING
#     PUBLISHING = ONGOING
#     CURRENTLY_AIRING = ONGOING
#     FINISHED_AIRING = FINISHED
#     NOT_YET_AIRED = NOTYET
#     NOT_YET_RELEASED = NOTYET
#     NOT_YET_PUBLISHED = NOTYET
#     UNKNOWN = "Unknown"
#     OTHER = "Other"
#     TV = "TV"
#     MOVIE = "Movie"
#     OVA = "OVA"
#     SPECIAL = "Special"
#     MANGA = "Manga"
#     NOVEL = "Novel"
#     ONE_SHOT = "One Shot"
#     SP = SPECIAL
#     MUSIC = OTHER
#     ONA = OVA
#     NOVIDEO = auto()
#     PLAYING = auto()
#     UNRECOGNIZED = auto()
#     NOT_FOUND = auto()
#     IGNORED = auto()
#     WINTER = 'Winter'
#     SPRING = 'Spring'
#     SUMMER = 'Summer'
#     FALL = 'Fall'
#     KEYWORD = auto()
#     SEASON = auto()
#     KW = KEYWORD
# HOME = os.path.expanduser("~")
# EXTENSIONS = ('.mkv', '.mp4', '.avi', '.ts')
# class Login(Enum):
# class BaseEnum(Enum):
# class Status(BaseEnum):
# class Type(BaseEnum):
# class Tracker(Enum):
# class Season(Enum):
# class SearchMethod(Enum):
# class TrackmaError(Exception):
# class EngineError(TrackmaError):
# class DataError(TrackmaError):
# class APIError(TrackmaError):
# class AccountError(TrackmaError):
# class TrackmaFatal(Exception):
# class EngineFatal(TrackmaFatal):
# class DataFatal(TrackmaFatal):
# class APIFatal(TrackmaFatal):
#     def find(cls, name):
#     def from_int(cls, index):
#     def __int__(self):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __gt__(self, other):
#     def __ge__(self, other):
#     def __add__(self, other):
#     def __str__(self):
# def oauth_generate_pkce() -> str:
# def parse_config(filename, default):
# def save_config(config_dict, filename):
# def load_data(filename):
# def save_data(data, filename):
# def log_error(msg):
# def expand_path(path):
# def expand_paths(paths):
# def is_media(filename):
# def regex_find_videos(subdirectory=''):
# def regex_rename_files(pattern, source_dir, dest_dir):
# def list_library(path):
# def make_dir(path):
# def dir_exists(dirname):
# def file_exists(filename):
# def file_older_than(filename, mtime):
# def try_files(filenames):
# def sync_file(fname, sync_url):
# def copy_file(src, dest):
# def to_config_path(*paths):
# def to_data_path(*paths):
# def to_cache_path(*paths):
# def change_permissions(filename, mode):
# def estimate_aired_episodes(show):
# def guess_show(show_title, tracker_list):
# def redirect_show(show_tuple, redirections, tracker_list):
# def spawn_process(arg_list):
# def get_terminal_size(fd=1):
# def show():


import os.path
import sys
import threading
import time
from trackma import utils

    def get_show_titles(self, show):
        return [show['title']] + show['aliases']

    def get_altnames_map(self):
        return {name.lower(): showid for showid, name in self.altnames_get().items()}

    def autosend(self):
        # Check if we should autosend now
        if self._is_queue_ready():
            self.process_queue()

        # Repeat check only if the settings are still on autosend
        # Note: Hours setting is DEPRECATED!
        if self.config['autosend'] in ('minutes', 'hours'):
            self.autosend_timer = threading.Timer(
                3600 if self.config['autosend'] == 'hours' else 60, self.autosend)
            self.autosend_timer.daemon = True
            self.autosend_timer.start()

    def _load_cache(self):
        self.msg.debug(self.name, "Reading cache...")
        self.showlist = utils.load_data(self.cache_file)

    def _save_cache(self):
        self.msg.debug(self.name, "Saving cache...")
        utils.save_data(self.showlist, self.cache_file)

    def _load_info(self):
        self.msg.debug(self.name, "Reading info DB...")

# Path: trackma/utils.py
# VERSION = '0.8.4'
# DATADIR = os.path.dirname(__file__) + '/data'
#     PASSWD = auto()
#     OAUTH = auto()
#     OAUTH_PKCE = auto()
#     UNKNOWN = 'Unknown'
#     ONGOING = 'Ongoing'
#     FINISHED = 'Finished'
#     NOTYET = 'Not yet started'
#     CANCELLED = 'Cancelled'
#     OTHER = 'Other'
#     AIRING = ONGOING
#     RELEASING = ONGOING
#     PUBLISHING = ONGOING
#     CURRENTLY_AIRING = ONGOING
#     FINISHED_AIRING = FINISHED
#     NOT_YET_AIRED = NOTYET
#     NOT_YET_RELEASED = NOTYET
#     NOT_YET_PUBLISHED = NOTYET
#     UNKNOWN = "Unknown"
#     OTHER = "Other"
#     TV = "TV"
#     MOVIE = "Movie"
#     OVA = "OVA"
#     SPECIAL = "Special"
#     MANGA = "Manga"
#     NOVEL = "Novel"
#     ONE_SHOT = "One Shot"
#     SP = SPECIAL
#     MUSIC = OTHER
#     ONA = OVA
#     NOVIDEO = auto()
#     PLAYING = auto()
#     UNRECOGNIZED = auto()
#     NOT_FOUND = auto()
#     IGNORED = auto()
#     WINTER = 'Winter'
#     SPRING = 'Spring'
#     SUMMER = 'Summer'
#     FALL = 'Fall'
#     KEYWORD = auto()
#     SEASON = auto()
#     KW = KEYWORD
# HOME = os.path.expanduser("~")
# EXTENSIONS = ('.mkv', '.mp4', '.avi', '.ts')
# class Login(Enum):
# class BaseEnum(Enum):
# class Status(BaseEnum):
# class Type(BaseEnum):
# class Tracker(Enum):
# class Season(Enum):
# class SearchMethod(Enum):
# class TrackmaError(Exception):
# class EngineError(TrackmaError):
# class DataError(TrackmaError):
# class APIError(TrackmaError):
# class AccountError(TrackmaError):
# class TrackmaFatal(Exception):
# class EngineFatal(TrackmaFatal):
# class DataFatal(TrackmaFatal):
# class APIFatal(TrackmaFatal):
#     def find(cls, name):
#     def from_int(cls, index):
#     def __int__(self):
#     def __lt__(self, other):
#     def __le__(self, other):
#     def __gt__(self, other):
#     def __ge__(self, other):
#     def __add__(self, other):
#     def __str__(self):
# def oauth_generate_pkce() -> str:
# def parse_config(filename, default):
# def save_config(config_dict, filename):
# def load_data(filename):
# def save_data(data, filename):
# def log_error(msg):
# def expand_path(path):
# def expand_paths(paths):
# def is_media(filename):
# def regex_find_videos(subdirectory=''):
# def regex_rename_files(pattern, source_dir, dest_dir):
# def list_library(path):
# def make_dir(path):
# def dir_exists(dirname):
# def file_exists(filename):
# def file_older_than(filename, mtime):
# def try_files(filenames):
# def sync_file(fname, sync_url):
# def copy_file(src, dest):
# def to_config_path(*paths):
# def to_data_path(*paths):
# def to_cache_path(*paths):
# def change_permissions(filename, mode):
# def estimate_aired_episodes(show):
# def guess_show(show_title, tracker_list):
# def redirect_show(show_tuple, redirections, tracker_list):
# def spawn_process(arg_list):
# def get_terminal_size(fd=1):
# def show():


# Path: trackma/data.py
import os.path
import sys
import threading
import time
from trackma import utils


    def get_show_titles(self, show):
        return [show['title']] + show['aliases']

    def get_altnames_map(self):
        return {name.lower(): showid for showid, name in self.altnames_get().items()}

    def autosend(self):
        # Check if we should autosend now
        if self._is_queue_ready():
            self.process_queue()

        # Repeat check only if the settings are still on autosend
        # Note: Hours setting is DEPRECATED!
        if self.config['autosend'] in ('minutes', 'hours'):
            self.autosend_timer = threading.Timer(
                3600 if self.config['autosend'] == 'hours' else 60, self.autosend)
            self.autosend_timer.daemon = True
            self.autosend_timer.start()

    def _load_cache(self):
        self.msg.debug(self.name, "Reading cache...")
        self.showlist = utils.load_data(self.cache_file)

    def _save_cache(self):
        self.msg.debug(self.name, "Saving cache...")
        utils.save_data(self.showlist, self.cache_file)

    def _load_info(self):
        self.msg.debug(self.name, "Reading info DB...")

        self.infocache = utils.load_data(self.info_file)