Compare commits

...

11 Commits
0.2.9 ... main

Author SHA1 Message Date
31b373b34a Bump version: 0.2.13 → 0.2.14 2025-07-10 17:12:23 +01:00
8665ab431c rework version 2025-07-10 17:12:14 +01:00
1b528a4277 new version 2025-07-10 17:11:09 +01:00
6210b5de7d updated toml 2025-07-10 17:10:00 +01:00
ab32c8032c add and update version to docker image 2025-07-10 17:08:58 +01:00
43ce8e1b89 Bump version: 0.2.10 → 0.2.11 2025-07-10 16:59:03 +01:00
826e91e7e2 Bump version: 0.2.9 → 0.2.10 2025-07-10 16:58:56 +01:00
98f7a87005 revert to 0.2.9 2025-07-10 16:58:50 +01:00
bc933c2308 Bump version: 0.2.9 → 0.2.10 2025-07-10 16:25:14 +01:00
d5c4d54041 Bump version: 0.2.8 → 0.2.9 2025-07-10 16:25:09 +01:00
ba9b4b8bd4 fix(favorites): preserve favorite status after image rename
Previously, if a user favorited a newly generated image (named 'image.png'), the favorite status would be lost once the image was automatically renamed to its final timestamped filename.

This change modifies the renaming logic to check the `favourites.json` file. If 'image.png' is found, its entry is updated with the new filename, ensuring the favorite status is preserved.
2025-07-10 16:24:57 +01:00
3 changed files with 29 additions and 8 deletions

View File

@ -1,19 +1,24 @@
[tool.bumpversion]
current_version = "0.2.8"
current_version = "0.2.14"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = true
sign_tags = false
tag_name = "{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
tag_name = "{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
[[tool.bumpversion.files]]
filename = ".bumpversion.toml"
search = 'current_version = "{current_version}"'
replace = 'current_version = "{new_version}"'
[[tool.bumpversion.files]]
filename = "Dockerfile"
search = 'ARG VERSION="{current_version}"'
replace = 'ARG VERSION="{new_version}"'
moveable_tags = []
commit_args = ""
setup_hooks = []

View File

@ -3,10 +3,14 @@ FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Set version label
ARG VERSION="0.2.14"
LABEL version=$VERSION
# Copy project files into the container
COPY . /app
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

View File

@ -51,10 +51,22 @@ def load_config() -> configparser.ConfigParser:
def rename_image() -> str | None:
"""Renames 'image.png' in the output folder to a timestamped filename if it exists."""
old_path = os.path.join(user_config["comfyui"]["output_dir"], "image.png")
favourites_file = "./favourites.json"
if os.path.exists(old_path):
new_filename = f"{str(time.time())}.png"
new_path = os.path.join(user_config["comfyui"]["output_dir"], new_filename)
# Check if image.png is a favourite
if os.path.exists(favourites_file):
with open(favourites_file, 'r') as f:
favourites = json.load(f)
if "image.png" in favourites:
favourites.remove("image.png")
favourites.append(new_filename)
with open(favourites_file, 'w') as f:
json.dump(favourites, f)
os.rename(old_path, new_path)
generate_thumbnail(new_path)
print(f"Renamed 'image.png' to '{new_filename}'")