Skip to content

Commit

Permalink
Ensure info folder exists before trying to save it
Browse files Browse the repository at this point in the history
  • Loading branch information
trickerer01 committed Jul 6, 2024
1 parent 1106dfb commit 5740c7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/iinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from __future__ import annotations
from enum import IntEnum
from os import path, listdir, remove
from os import path, listdir, remove, makedirs
from typing import Dict, Iterable, Union, Tuple, List, Match

from config import Config
Expand Down Expand Up @@ -283,7 +283,10 @@ def export_album_info(info_list: Iterable[AlbumInfo]) -> None:
continue
keys = sorted(sdct.keys())
min_id, max_id = keys[0], keys[-1]
fullpath = f'{normalize_path(f"{Config.dest_base}{subfolder}")}{PREFIX}!{name}_{min_id:d}-{max_id:d}.txt'
info_folder = f'{Config.dest_base}{subfolder}'
fullpath = f'{normalize_path(info_folder)}{PREFIX}!{name}_{min_id:d}-{max_id:d}.txt'
if not path.isdir(info_folder):
makedirs(fullpath)
with open(fullpath, 'wt', encoding=UTF8) as sfile:
sfile.writelines(f'{PREFIX}{idi:d}:{proc_cb(sdct[idi])}' for idi in keys)
[remove(merged_file) for merged_file in merged_files if merged_file != fullpath]
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
APP_NAME = 'RC'
APP_VER_MAJOR = '1'
APP_VER_SUB = '8'
APP_REVISION = '155'
APP_REVISION = '156'
APP_VERSION = f'{APP_VER_MAJOR}.{APP_VER_SUB}.{APP_REVISION}'

#
Expand Down

0 comments on commit 5740c7c

Please sign in to comment.