mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-06 02:32:44 +02:00
Fix uploader check if item already exists in a subdirectory #4146
This commit is contained in:
@@ -362,10 +362,14 @@ export default {
|
||||
for (const item of items) {
|
||||
const filepath = Path.join(this.selectedFolder.fullPath, item.directory)
|
||||
const exists = await this.$axios
|
||||
.$post(`/api/filesystem/pathexists`, { filepath })
|
||||
.$post(`/api/filesystem/pathexists`, { filepath, directory: item.directory, folderPath: this.selectedFolder.fullPath })
|
||||
.then((data) => {
|
||||
if (data.exists) {
|
||||
this.$toast.error(`Filepath "${filepath}" already exists on server`)
|
||||
if (data.libraryItemTitle) {
|
||||
this.$toast.error(this.$getString('ToastUploaderItemExistsInSubdirectoryError', [data.libraryItemTitle]))
|
||||
} else {
|
||||
this.$toast.error(this.$getString('ToastUploaderFilepathExistsError', [filepath]))
|
||||
}
|
||||
}
|
||||
return data.exists
|
||||
})
|
||||
|
||||
@@ -1086,6 +1086,8 @@
|
||||
"ToastUnknownError": "Unknown error",
|
||||
"ToastUnlinkOpenIdFailed": "Failed to unlink user from OpenID",
|
||||
"ToastUnlinkOpenIdSuccess": "User unlinked from OpenID",
|
||||
"ToastUploaderFilepathExistsError": "Filepath \"{0}\" already exists on server",
|
||||
"ToastUploaderItemExistsInSubdirectoryError": "Item \"{0}\" is using a subdirectory of the upload path.",
|
||||
"ToastUserDeleteFailed": "Failed to delete user",
|
||||
"ToastUserDeleteSuccess": "User deleted",
|
||||
"ToastUserPasswordChangeSuccess": "Password changed successfully",
|
||||
|
||||
Reference in New Issue
Block a user