Update in db exist checker

This commit is contained in:
2022-09-05 01:34:42 +03:00
parent 911f276bcc
commit 7f003e1216
8 changed files with 94 additions and 84 deletions

View File

@@ -1,6 +1,6 @@
import mimetypes
import os
from typing import Tuple, Optional
from typing import Optional
class ListGenerator:
@@ -36,10 +36,10 @@ class ListGenerator:
class _FileAttrs:
def __init__(self, name, path, type, exc):
def __init__(self, name, path, _type, exc):
self.name = name
self.path = path
self.mimetype = type
self.mimetype = _type
self.exc = exc
def __str__(self):
@@ -63,7 +63,7 @@ class _ListGenerationIter:
return self
@property
def type(self) -> tuple[Optional[str], Optional[str]]:
def _type(self) -> Optional[str]:
guess = mimetypes.guess_type(f'{self._path}/{self._list[self._current_index]}')[0]
return guess