Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(Album): [stable31] Do not overwrite album on rename
Signed-off-by: Louis Chmn <[email protected]>
  • Loading branch information
artonge authored and backportbot[bot] committed Nov 13, 2025
commit f5cc512174e763b4d2e93adafa02973f5a66d75d
9 changes: 9 additions & 0 deletions src/store/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ const actions = {
filename: collection.filename.replace(new RegExp(`${collection.basename}$`), newBaseName),
}

try {
await client.stat(newCollection.filename)
logger.error(t('photos', 'Failed to rename {currentCollectionFileName} to {newCollectionFileName}', { currentCollectionFileName: collectionFileName, newCollectionFileName: newCollection.filename }), { error: new Error('Target collection already exists') })
showError(t('photos', 'Failed to rename {currentCollectionFileName} to {newCollectionFileName}', { currentCollectionFileName: collectionFileName, newCollectionFileName: newCollection.filename }))
return collection
} catch (error) {
// If the stat fails, it means that the target does not exist yet, so all good.
}

try {
context.commit('addCollections', { collections: [newCollection] })
context.commit('setCollectionFiles', { collectionFileName: newCollection.filename, fileIds: context.state.collectionsFiles[collectionFileName] })
Expand Down