Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix generate thumbnails in meta folder

sytolked5b4fc8c9cb
diff --git a/src/renderer/hooks/ThumbGenerationContextProvider.tsx b/src/renderer/hooks/ThumbGenerationContextProvider.tsx
index 73d7e7454..caa73b2c1 100644
--- a/src/renderer/hooks/ThumbGenerationContextProvider.tsx
+++ b/src/renderer/hooks/ThumbGenerationContextProvider.tsx
@@ -19,6 +19,7 @@
import React, { createContext, useEffect, useMemo, useRef } from 'react';
import { useSelector } from 'react-redux';
import {
+ cleanTrailingDirSeparator,
extractContainingDirectoryPath,
extractFileName,
normalizePath,
@@ -160,9 +161,13 @@ export const ThumbGenerationContextProvider = ({
function genThumbnailsEnabled(location: CommonLocation): boolean {
if (
currentDirectoryPath === undefined ||
- currentDirectoryPath.endsWith(AppConfig.metaFolder) ||
+ cleanTrailingDirSeparator(currentDirectoryPath) ===
+ AppConfig.metaFolder ||
+ cleanTrailingDirSeparator(currentDirectoryPath).endsWith(
+ AppConfig.dirSeparator + AppConfig.metaFolder,
+ ) ||
currentDirectoryPath.indexOf(
- AppConfig.metaFolder + AppConfig.dirSeparator,
+ AppConfig.dirSeparator + AppConfig.metaFolder + AppConfig.dirSeparator,
) !== -1
) {
return false; // dont generate thumbnails in meta folder