Use cleaner paths when looking up thumbnails

This commit is contained in:
Přemysl Eric Janouch 2022-08-09 13:54:53 +02:00
parent 4e11970a7e
commit 4697a56760
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -657,8 +657,8 @@ fiv_thumbnail_lookup(const char *uri, gint64 mtime_msec, FivThumbnailSize size)
use = FIV_THUMBNAIL_SIZE_MAX - i; use = FIV_THUMBNAIL_SIZE_MAX - i;
const char *name = fiv_thumbnail_sizes[use].thumbnail_spec_name; const char *name = fiv_thumbnail_sizes[use].thumbnail_spec_name;
gchar *wide = gchar *wide = g_strconcat(thumbnails_dir, G_DIR_SEPARATOR_S "wide-",
g_strdup_printf("%s/wide-%s/%s.webp", thumbnails_dir, name, sum); name, G_DIR_SEPARATOR_S, sum, ".webp", NULL);
result = read_wide_thumbnail(wide, uri, mtime_msec / 1000, &error); result = read_wide_thumbnail(wide, uri, mtime_msec / 1000, &error);
if (error) { if (error) {
g_debug("%s: %s", wide, error->message); g_debug("%s: %s", wide, error->message);
@ -673,8 +673,8 @@ fiv_thumbnail_lookup(const char *uri, gint64 mtime_msec, FivThumbnailSize size)
break; break;
} }
gchar *path = gchar *path = g_strconcat(thumbnails_dir, G_DIR_SEPARATOR_S,
g_strdup_printf("%s/%s/%s.png", thumbnails_dir, name, sum); name, G_DIR_SEPARATOR_S, sum, ".png", NULL);
result = read_png_thumbnail(path, uri, mtime_msec / 1000, &error); result = read_png_thumbnail(path, uri, mtime_msec / 1000, &error);
if (error) { if (error) {
g_debug("%s: %s", path, error->message); g_debug("%s: %s", path, error->message);