From 8d2ab06fa31b27d79fc9f8041c7a4e366501eabc Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 31 Jul 2022 20:21:00 +0200 Subject: [PATCH 1/8] fix: renaming a .zip file caused extension to become .mp4 Signed-off-by: Dominik Willner --- .../panels/Timelapse/TimelapseFilesPanel.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/panels/Timelapse/TimelapseFilesPanel.vue b/src/components/panels/Timelapse/TimelapseFilesPanel.vue index 113a5bdd8..1c294e9ec 100644 --- a/src/components/panels/Timelapse/TimelapseFilesPanel.vue +++ b/src/components/panels/Timelapse/TimelapseFilesPanel.vue @@ -634,23 +634,24 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) { renameFileAction() { const posLastPoint = this.dialogRenameFile.item.filename.lastIndexOf('.') - const oldNameWithoutExtension = this.dialogRenameFile.item.filename.substr(0, posLastPoint) + const oldNameWithoutExtension = this.dialogRenameFile.item.filename.slice(0, posLastPoint) + const fileExtension = this.dialogRenameFile.item.filename.split('.').pop() this.dialogRenameFile.show = false this.$socket.emit( 'server.files.move', { - source: this.currentPath + '/' + this.dialogRenameFile.item.filename, - dest: this.currentPath + '/' + this.dialogRenameFile.newName + '.mp4', + source: `${this.currentPath}/${this.dialogRenameFile.item.filename}`, + dest: `${this.currentPath}/${this.dialogRenameFile.newName}.${fileExtension}`, }, { action: 'files/getMove' } ) - const fileJpg = this.files.find((file) => file.filename === oldNameWithoutExtension + '.jpg') + const fileJpg = this.files.find((file) => file.filename === `${oldNameWithoutExtension}.jpg`) if (fileJpg) { this.$socket.emit('server.files.move', { - source: this.currentPath + '/' + oldNameWithoutExtension + '.jpg', - dest: this.currentPath + '/' + this.dialogRenameFile.newName + '.jpg', + source: `${this.currentPath}/${oldNameWithoutExtension}.jpg`, + dest: `${this.currentPath}/${this.dialogRenameFile.newName}.jpg`, }) } } From 01cbc3ac26de83bd892e4036c89a100ea67c3df6 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 31 Jul 2022 20:22:20 +0200 Subject: [PATCH 2/8] style: fix weak IDE warnings Signed-off-by: Dominik Willner --- .../panels/Timelapse/TimelapseFilesPanel.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/panels/Timelapse/TimelapseFilesPanel.vue b/src/components/panels/Timelapse/TimelapseFilesPanel.vue index 1c294e9ec..838c18402 100644 --- a/src/components/panels/Timelapse/TimelapseFilesPanel.vue +++ b/src/components/panels/Timelapse/TimelapseFilesPanel.vue @@ -15,7 +15,7 @@