Spaces:
Sleeping
Sleeping
fabiogra
commited on
Commit
•
1245f2e
1
Parent(s):
7c6c604
fix: session_state page errors, log when delete files
Browse files- app/header.py +1 -2
- app/helpers.py +1 -0
app/header.py
CHANGED
@@ -31,8 +31,7 @@ def header(logo_and_title=True):
|
|
31 |
if "search_results" not in st.session_state:
|
32 |
st.session_state.search_results = []
|
33 |
if "page" not in st.session_state:
|
34 |
-
|
35 |
-
switch_page(st.session_state.page)
|
36 |
|
37 |
st.set_page_config(
|
38 |
page_title="Moseca - Music Separation and Karaoke - Free and Open Source alternative to lalal.ai, splitter.ai or media.io vocal remover.",
|
|
|
31 |
if "search_results" not in st.session_state:
|
32 |
st.session_state.search_results = []
|
33 |
if "page" not in st.session_state:
|
34 |
+
switch_page("Separate")
|
|
|
35 |
|
36 |
st.set_page_config(
|
37 |
page_title="Moseca - Music Separation and Karaoke - Free and Open Source alternative to lalal.ai, splitter.ai or media.io vocal remover.",
|
app/helpers.py
CHANGED
@@ -194,6 +194,7 @@ def _remove_file_older_than(file_path: str, max_age_limit: float):
|
|
194 |
# If the file is older than the age limit, delete it
|
195 |
if os.path.getmtime(file_path) < max_age_limit:
|
196 |
try:
|
|
|
197 |
os.remove(file_path)
|
198 |
except OSError as e:
|
199 |
log.warning(f"Error: Could not delete {file_path}. Reason: {e.strerror}")
|
|
|
194 |
# If the file is older than the age limit, delete it
|
195 |
if os.path.getmtime(file_path) < max_age_limit:
|
196 |
try:
|
197 |
+
log.info(f"Deleting {file_path}")
|
198 |
os.remove(file_path)
|
199 |
except OSError as e:
|
200 |
log.warning(f"Error: Could not delete {file_path}. Reason: {e.strerror}")
|