Skip to content

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

removing the usage of id for tags

Ilian Sapundshieva58bd943bb19
diff --git a/app/reducers/location-index.ts b/app/reducers/location-index.ts
index 81b26e9d3..9e37d2910 100644
--- a/app/reducers/location-index.ts
+++ b/app/reducers/location-index.ts
@@ -417,7 +417,7 @@ export const actions = {
}
if (searchQuery.forceIndexing || !hasIndex) {
console.log('Creating index for : ' + nextPath);
- directoryIndex = await createDirectoryIndex(nextPath, true); // take the last treu from location object
+ directoryIndex = await createDirectoryIndex(nextPath, true); // TODO: take the last treu from location object
if (Pro && Pro.Indexer && Pro.Indexer.persistIndex) {
Pro.Indexer.persistIndex(nextPath, directoryIndex, dirSeparator);
}
diff --git a/app/reducers/tagging-actions.ts b/app/reducers/tagging-actions.ts
index 33ea8bea8..517e6eaea 100644
--- a/app/reducers/tagging-actions.ts
+++ b/app/reducers/tagging-actions.ts
@@ -53,6 +53,9 @@ const actions = {
tags.map(pTag => {
const tag = { ...pTag };
tag.type = 'sidecar';
+ if (tag.id) {
+ delete tag.id;
+ }
if (tag.functionality && tag.functionality.length > 0) {
delete tag.color;
delete tag.textcolor;
@@ -82,7 +85,6 @@ const actions = {
}
} else {
tag.title = generateTagValue(tag);
- tag.id = uuidv1();
delete tag.functionality;
processedTags.push(tag);
}
@@ -144,7 +146,6 @@ const actions = {
} catch (error) {
console.log('No sidecar found ' + error);
}
-
if (!entryProperties.isFile || settings.persistTagsInSidecarFile) {
// Handling adding tags in sidecar
if (fsEntryMeta) {
@@ -287,6 +288,7 @@ const actions = {
delete tag.description;
delete tag.functionality;
delete tag.path;
+ delete tag.id;
// TODO: Handle adding already added tags
if (tag.type === 'plain') {
const fileName = extractFileName(path);
@@ -402,8 +404,7 @@ const actions = {
...tag,
title: newTagTitle,
color: settings.tagBackgroundColor,
- textcolor: settings.tagTextColor,
- id: uuidv1()
+ textcolor: settings.tagTextColor
});
}
if (uniqueTags.length > 0) {
diff --git a/app/reducers/taglibrary-default.ts b/app/reducers/taglibrary-default.ts
index a275e7e5b..d98181f0d 100644
--- a/app/reducers/taglibrary-default.ts
+++ b/app/reducers/taglibrary-default.ts
@@ -106,7 +106,6 @@ export default [
id: uuidv1(),
type: 'plain',
title: 'high',
- description: '',
color: '#ff7537',
textcolor: '#ffffff'
},
diff --git a/app/services/utils-io.ts b/app/services/utils-io.ts
index 857a8203d..b49577491 100644
--- a/app/services/utils-io.ts
+++ b/app/services/utils-io.ts
@@ -72,6 +72,9 @@ export function enhanceEntry(entry: any): FileSystemEntry {
sidecarTags = entry.meta.tags || [];
sidecarTags.map(tag => {
tag.type = 'sidecar';
+ if (tag.id) {
+ delete tag.id;
+ }
return true;
});
}