mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-15 16:29:37 +00:00
Fix uploader check if item already exists in a subdirectory #4146
This commit is contained in:
parent
ec4f275d52
commit
e16d3d72b6
3 changed files with 49 additions and 6 deletions
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue