From dbc6a3806c24c5d38e0147c05a2db41cfd6160d2 Mon Sep 17 00:00:00 2001 From: Georg Brantegger Date: Mon, 13 Jul 2026 20:22:00 +0200 Subject: [PATCH] updated rename_files to prefix the filename for better sorting --- Nextcloud Contact Infos/convert_athletes.ipynb | 2 +- Nextcloud Video Files/rename_files.ipynb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Nextcloud Contact Infos/convert_athletes.ipynb b/Nextcloud Contact Infos/convert_athletes.ipynb index f8edd31..fb5c51e 100644 --- a/Nextcloud Contact Infos/convert_athletes.ipynb +++ b/Nextcloud Contact Infos/convert_athletes.ipynb @@ -277,7 +277,7 @@ ], "metadata": { "kernelspec": { - "display_name": ".venv (3.14.4)", + "display_name": ".venv (3.14.4.final.0)", "language": "python", "name": "python3" }, diff --git a/Nextcloud Video Files/rename_files.ipynb b/Nextcloud Video Files/rename_files.ipynb index aeac2f9..0bcfd7d 100644 --- a/Nextcloud Video Files/rename_files.ipynb +++ b/Nextcloud Video Files/rename_files.ipynb @@ -104,7 +104,7 @@ " # 5. Final Rename: Apply the sequential counting names\n", " for index, (temp_path, extension, old_filename) in enumerate(temp_files, start=1):\n", " directory, _ = os.path.split(temp_path)\n", - " new_name = f\"{new_filenames[index-1]}{extension}\"\n", + " new_name = f\"{len(temp_files)-index+1}_{new_filenames[index-1]}{extension}\"\n", " final_path = f\"{directory}/{new_name}\"\n", " \n", " i = 1\n", @@ -112,7 +112,7 @@ " nc.files.move(temp_path, final_path)\n", " print(f\" -> Renamed {old_filename} to {new_name}\")\n", " except:\n", - " new_name = f\"{new_filenames[index-1]}_{i}{extension}\"\n", + " new_name = f\"{new_filenames[index-1]}_{len(temp_files)-i}{extension}\"\n", " final_path = f\"{directory}/{new_name}\"\n", " nc.files.move(temp_path, final_path)\n", " i += 1\n",