fixed wrong bool using check_if_already_transcribed
This commit is contained in:
@@ -364,7 +364,7 @@ class AutoTranscribe:
|
|||||||
if not "/" in audiofile:
|
if not "/" in audiofile:
|
||||||
audiofile = os.path.join(self.audiopath, audiofile)
|
audiofile = os.path.join(self.audiopath, audiofile)
|
||||||
|
|
||||||
if not self.check_if_allready_transcribed(audiofile):
|
if not self.check_if_already_transcribed (audiofile):
|
||||||
|
|
||||||
audio = AudioProcessor(audiofile)
|
audio = AudioProcessor(audiofile)
|
||||||
|
|
||||||
@@ -463,14 +463,18 @@ class AutoTranscribe:
|
|||||||
|
|
||||||
return currentpath, audiopath, transcriptionpath, audiofiles
|
return currentpath, audiopath, transcriptionpath, audiofiles
|
||||||
|
|
||||||
def check_if_allready_transcribed(self, filename: str):
|
def check_if_already_transcribed (self, filename: str):
|
||||||
"""
|
"""
|
||||||
Check if all audio files are already transcribed
|
Check if all audio files are already transcribed
|
||||||
:param filename: audio file name
|
:param filename: audio file name
|
||||||
:return: bool
|
:return: bool
|
||||||
"""
|
"""
|
||||||
purefilename = filename.split('/')[-1][:-4] + '.txt'
|
purefilename = filename.split('/')[-1][:-4]
|
||||||
if purefilename in os.listdir(self.transcriptionpath):
|
_files = os.listdir(self.transcriptionpath)
|
||||||
|
for i,f in enumerate(_files):
|
||||||
|
_files[i] = f[:-4]
|
||||||
|
|
||||||
|
if purefilename in _files:
|
||||||
print(f'File {purefilename[:-4]} already transcribed')
|
print(f'File {purefilename[:-4]} already transcribed')
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user