fix(rss): get text for internal ID if the guid or id is object (#1257)

This commit is contained in:
Ömer Faruk Aydın
2023-09-01 12:10:42 +02:00
committed by GitHub
parent e2dcdd2811
commit 0ad8da097b

View File

@@ -4,9 +4,13 @@ import bcrypt from 'bcrypt';
const getInternalId = async (item: IJSONObject): Promise<string> => {
if (item.guid) {
return item.guid.toString();
return typeof item.guid === 'object'
? (item.guid as IJSONObject)['#text'].toString()
: item.guid.toString();
} else if (item.id) {
return item.id.toString();
return typeof item.id === 'object'
? (item.id as IJSONObject)['#text'].toString()
: item.id.toString();
}
return await hashItem(JSON.stringify(item));