Update dbMigration for old main library ids

This commit is contained in:
advplyr 2023-07-16 16:39:59 -05:00
parent 0829237166
commit 2afd0e2acd

View File

@ -1245,7 +1245,7 @@ async function handleOldUsers(ctx) {
// Convert old library ids to new library ids // Convert old library ids to new library ids
if (user.librariesAccessible?.length) { if (user.librariesAccessible?.length) {
user.librariesAccessible = user.librariesAccessible.map(lid => { user.librariesAccessible = user.librariesAccessible.map(lid => {
if (!lid.startsWith('lib_')) return lid // Already not an old library id so dont change if (!lid.startsWith('lib_') && lid !== 'main') return lid // Already not an old library id so dont change
hasUpdates = true hasUpdates = true
return oldDbIdMap.libraries[lid] return oldDbIdMap.libraries[lid]
}).filter(lid => lid) }).filter(lid => lid)