remove dead code

This commit is contained in:
Jesse Bannon 2022-09-14 13:11:42 -07:00
parent 252f0789b8
commit 4542c316fa
7 changed files with 0 additions and 56 deletions

View file

@ -88,9 +88,6 @@ class BaseEntry(BaseEntryVariables, ABC):
Abstract entry object to represent anything download from ytdl (playlist metadata, media, etc).
"""
# The ytdl extractor type that the entry represents
entry_extractor: str
def __init__(self, entry_dict: Dict, working_directory: str):
"""
Initialize the entry using ytdl metadata

View file

@ -9,5 +9,3 @@ class SoundcloudTrack(SoundcloudVariables, Entry):
Entry object to represent a Soundcloud track yt-dlp that is a single, which implies
it does not belong to an album.
"""
entry_extractor = "soundcloud"

View file

@ -10,8 +10,6 @@ class YoutubeVideo(YoutubeVideoVariables, Entry):
Entry object to represent a Youtube video. Reserved for shared Youtube entry logic.
"""
entry_extractor = "youtube"
@property
def ext(self) -> str:
"""

View file

@ -7,7 +7,6 @@ from ytdl_sub.plugins.plugin import Plugin
from ytdl_sub.plugins.plugin import PluginOptions
from ytdl_sub.utils.file_handler import FileMetadata
from ytdl_sub.validators.string_formatter_validators import DictFormatterValidator
from ytdl_sub.validators.validators import StringValidator
class MusicTagsOptions(PluginOptions):
@ -34,17 +33,12 @@ class MusicTagsOptions(PluginOptions):
"""
_required_keys = {"tags"}
_optional_keys = {"multi_value_separator"}
def __init__(self, name, value):
super().__init__(name, value)
self._tags = self._validate_key(key="tags", validator=DictFormatterValidator)
self.multi_value_separator = self._validate_key_if_present(
key="multi_value_separator", validator=StringValidator
)
@property
def tags(self) -> DictFormatterValidator:
"""

View file

@ -1,4 +1,3 @@
from pathlib import Path
from typing import Dict
from typing import List
from typing import Optional
@ -21,14 +20,6 @@ SUBTITLE_EXTENSIONS: Set[str] = {"srt", "vtt", "ass", "lrc"}
logger = Logger.get(name="subtitles")
def _is_entry_subtitle_file(path: Path, entry: Entry) -> bool:
if path.is_file() and path.name.startswith(entry.uid):
for ext in SUBTITLE_EXTENSIONS:
if path.name.endswith(f".{ext}"):
return True
return False
class SubtitlesTypeValidator(StringSelectValidator):
_expected_value_type_name = "subtitles type"
_select_values = SUBTITLE_EXTENSIONS

View file

@ -244,24 +244,3 @@ class LiteralDictValidator(DictValidator):
def keys(self) -> List[str]:
"""Returns a sorted list of the dict's keys"""
return super()._keys
class UniformDictValidator(DictValidator, Generic[ValidatorT], ABC):
"""DictValidator where all values have the same validator"""
uniform_validator_class: Type[ValidatorT]
def __init__(self, name, value):
super().__init__(name, value)
for key in self._keys:
_ = self._validate_key_if_present(key=key, validator=self.uniform_validator_class)
@property
def validator_dict(self) -> Dict[str, ValidatorT]:
"""
Returns
-------
Dict of name: validator
"""
return self._validator_dict

View file

@ -123,19 +123,6 @@ class DownloadArchive:
file.write(f"{line}\n")
return self
def contains(self, entry_id: str) -> bool:
"""
Parameters
----------
entry_id
Id of the entry
Returns
-------
True if the entry id is within this download archive. False otherwise.
"""
return any(entry_id in line for line in self._download_archive_lines)
def remove_entry(self, entry_id: str) -> "DownloadArchive":
"""
Parameters