Merge pull request #132 from arabcoders/dev
Log manually archived into separate log file
This commit is contained in:
commit
40d2f83b65
4 changed files with 1444 additions and 1909 deletions
1005
Pipfile.lock
generated
1005
Pipfile.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -18,6 +18,7 @@ class Config:
|
|||
temp_path: str = '{download_path}'
|
||||
temp_keep: bool = False
|
||||
db_file: str = '{config_path}/ytptube.db'
|
||||
manual_archive: str = '{config_path}/archive.manual.log'
|
||||
|
||||
url_host: str = ''
|
||||
url_prefix: str = ''
|
||||
|
|
|
|||
14
app/main.py
14
app/main.py
|
|
@ -664,6 +664,20 @@ class Main:
|
|||
with open(file, 'a') as f:
|
||||
f.write(f"{idDict['archive_id']}\n")
|
||||
|
||||
manual_archive = self.config.manual_archive
|
||||
if manual_archive:
|
||||
previouslyArchived = False
|
||||
if os.path.exists(manual_archive):
|
||||
with open(manual_archive, 'r') as f:
|
||||
for line in f.readlines():
|
||||
if idDict['archive_id'] in line:
|
||||
previouslyArchived = True
|
||||
break
|
||||
|
||||
if not previouslyArchived:
|
||||
with open(manual_archive, 'a') as f:
|
||||
f.write(f"{idDict['archive_id']} - at: {datetime.now().isoformat()}\n")
|
||||
|
||||
LOG.info(f'Archiving item: {data["url"]=}')
|
||||
|
||||
@self.sio.event()
|
||||
|
|
|
|||
2333
frontend/package-lock.json
generated
2333
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue