running codespell #15

This commit is contained in:
simon 2021-09-18 17:28:16 +07:00
parent eafda731c9
commit cbedfe2acb
8 changed files with 15 additions and 15 deletions

View File

@ -72,7 +72,7 @@ class PendingList:
elif isinstance(video, tuple):
youtube_id = video[0]
if youtube_id in all_downloaded:
# skip already downlaoded
# skip already downloaded
continue
video = self.get_youtube_details(youtube_id)
# skip on download error

View File

@ -108,7 +108,7 @@ def get_lock(lock_key):
def monitor_cache_dir(cache_dir):
"""
look at download cache dir directly as alterative progress info
look at download cache dir directly as alternative progress info
"""
dl_cache = os.path.join(cache_dir, 'download')
cache_file = os.listdir(dl_cache)

View File

@ -216,7 +216,7 @@ class YoutubeChannel:
class YoutubeVideo:
""" represents a signle youtube video """
""" represents a single youtube video """
CONFIG = AppConfig().config
ES_URL = CONFIG['application']['es_url']

View File

@ -436,7 +436,7 @@ class ElasticBackup:
return file_content
def write_es_json(self, file_content, index_name):
""" write nd json file for es _bulk API to disk """
""" write nd-json file for es _bulk API to disk """
cache_dir = self.config['application']['cache_dir']
file_name = f'es_{index_name}-{self.timestamp}.json'
file_path = os.path.join(cache_dir, 'backup', file_name)

View File

@ -211,7 +211,7 @@ class FilesystemScanner:
def __init__(self):
self.all_downloaded = self.get_all_downloaded()
self.all_indexed = self.get_all_indexed()
self.missmatch = None
self.mismatch = None
self.to_rename = None
self.to_index = None
self.to_delete = None
@ -296,7 +296,7 @@ class FilesystemScanner:
break
self.missmatch = to_fix
self.mismatch = to_fix
self.to_rename = to_rename
def rename_files(self):
@ -307,11 +307,11 @@ class FilesystemScanner:
new_path = os.path.join(self.VIDEOS, channel, expected_filename)
os.rename(old_path, new_path)
def send_missmatch_bulk(self):
def send_mismatch_bulk(self):
""" build bulk update """
bulk_list = []
for video_missmatch in self.missmatch:
youtube_id, media_url = video_missmatch
for video_mismatch in self.mismatch:
youtube_id, media_url = video_mismatch
action = {"update": {"_id": youtube_id, "_index": 'ta_video'}}
source = {"doc": {"media_url": media_url}}
bulk_list.append(json.dumps(action))
@ -454,8 +454,8 @@ def scan_filesystem():
filesystem_handler.list_comarison()
if filesystem_handler.to_rename:
filesystem_handler.rename_files()
if filesystem_handler.missmatch:
filesystem_handler.send_missmatch_bulk()
if filesystem_handler.mismatch:
filesystem_handler.send_mismatch_bulk()
if filesystem_handler.to_delete:
filesystem_handler.delete_from_index()
if filesystem_handler.to_index:

View File

@ -72,7 +72,7 @@ class SearchHandler:
@staticmethod
def vid_cache_link(hit):
""" download thumbnails into chache """
""" download thumbnails into cache """
vid_thumb = hit['source']['vid_thumb_url']
youtube_id = hit['source']['youtube_id']
channel_id_hit = hit['source']['channel']['channel_id']

View File

@ -9,7 +9,7 @@
<h2>Color scheme</h2>
<div class="settings-item">
<p>Current color scheme: <span class="settings-current">{{ config.application.colors }}</span></p>
<i>Select yout prefered color scheme between dark and light mode.</i><br>
<i>Select yout preferred color scheme between dark and light mode.</i><br>
<select name="application.colors" id="application.colors">
<option value="" disabled selected> -- change color scheme -- </option>
<option value="dark">dark mode</option>

View File

@ -1,7 +1,7 @@
"""
Functionality:
- all views for home app
- process post data recieved from frontend via ajax
- process post data received from frontend via ajax
"""
import urllib.parse
@ -220,7 +220,7 @@ class DownloadView(View):
class ChannelIdView(View):
""" resolves to /chanel/<channel-id>/
""" resolves to /channel/<channel-id>/
display single channel page from channel_id
"""