check for file existence before attempting to read the contents.
This commit is contained in:
parent
f76e9b8f77
commit
d837fb7d1b
1 changed files with 6 additions and 5 deletions
11
app/main.py
11
app/main.py
|
|
@ -667,11 +667,12 @@ class Main:
|
||||||
manual_archive = self.config.manual_archive
|
manual_archive = self.config.manual_archive
|
||||||
if manual_archive:
|
if manual_archive:
|
||||||
previouslyArchived = False
|
previouslyArchived = False
|
||||||
with open(manual_archive, 'r') as f:
|
if os.path.exists(manual_archive):
|
||||||
for line in f.readlines():
|
with open(manual_archive, 'r') as f:
|
||||||
if idDict['archive_id'] in line:
|
for line in f.readlines():
|
||||||
previouslyArchived = True
|
if idDict['archive_id'] in line:
|
||||||
break
|
previouslyArchived = True
|
||||||
|
break
|
||||||
|
|
||||||
if not previouslyArchived:
|
if not previouslyArchived:
|
||||||
with open(manual_archive, 'a') as f:
|
with open(manual_archive, 'a') as f:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue