update code level
This commit is contained in:
@@ -323,47 +323,26 @@ function updateAlbumMeta() {
|
||||
|
||||
let chips = [];
|
||||
|
||||
// 添加人名标签
|
||||
if (currentAlbum.person_name_cleaned) {
|
||||
chips.push({
|
||||
text: currentAlbum.person_name_cleaned,
|
||||
type: 'person',
|
||||
category: 'person',
|
||||
query: currentAlbum.person_name_cleaned
|
||||
// 添加人名标签(从 search.db 返回的 persons 数组)
|
||||
if (currentAlbum.persons && Array.isArray(currentAlbum.persons)) {
|
||||
currentAlbum.persons.forEach(name => {
|
||||
chips.push({
|
||||
text: name,
|
||||
type: 'person',
|
||||
category: 'person',
|
||||
query: name
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 添加标签(支持多种格式)
|
||||
if (currentAlbum.tags) {
|
||||
let tagList = [];
|
||||
try {
|
||||
const parsed = JSON.parse(currentAlbum.tags);
|
||||
if (Array.isArray(parsed)) {
|
||||
parsed.forEach(item => {
|
||||
if (Array.isArray(item)) {
|
||||
tagList.push({ text: item[0], category: item[1] || 'default' });
|
||||
} else if (typeof item === 'string') {
|
||||
tagList.push({ text: item, category: getTagCategory(item) });
|
||||
} else if (item.tag || item.name) {
|
||||
const t = item.tag || item.name;
|
||||
const c = item.category || item.type || getTagCategory(t);
|
||||
tagList.push({ text: t, category: c });
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
currentAlbum.tags.split(',').forEach(tag => {
|
||||
const t = tag.trim();
|
||||
if (t) tagList.push({ text: t, category: getTagCategory(t) });
|
||||
});
|
||||
}
|
||||
|
||||
tagList.forEach(t => {
|
||||
// 添加标签(从 search.db 返回的 tags 数组)
|
||||
if (currentAlbum.tags && Array.isArray(currentAlbum.tags)) {
|
||||
currentAlbum.tags.forEach(tag => {
|
||||
chips.push({
|
||||
text: t.text,
|
||||
text: tag,
|
||||
type: 'tag',
|
||||
category: t.category,
|
||||
query: t.text
|
||||
category: getTagCategory(tag),
|
||||
query: tag
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user