mirror of
https://gitee.com/viarotel-org/escrcpy.git
synced 2024-11-29 18:01:34 +08:00
perf: 💄 Normalize control window titles and generated file names
This commit is contained in:
parent
952b2a7250
commit
ccc7f0e734
@ -11,16 +11,19 @@ const recordModel = {
|
||||
excludes: [],
|
||||
commands: [],
|
||||
extname: config => config['--record-format'] || 'mp4',
|
||||
label: 'Recording',
|
||||
},
|
||||
audio: {
|
||||
excludes: ['--video-source', '--no-audio', '--mouse'],
|
||||
commands: ['--no-video', '--mouse=disabled'],
|
||||
extname: config => config['--audio-record-format'] || 'opus',
|
||||
label: 'RecordingAudio',
|
||||
},
|
||||
camera: {
|
||||
excludes: ['--video-source', '--turn-screen-off', '--show-touches', '--no-power-on', '--stay-awake', '--power-off-on-close'],
|
||||
commands: ['--video-source=camera'],
|
||||
extname: config => config['--record-format'] || 'mp4',
|
||||
label: 'RecordingCamera',
|
||||
},
|
||||
}
|
||||
|
||||
@ -81,7 +84,7 @@ export default {
|
||||
|
||||
try {
|
||||
const recording = this.$scrcpy.record(row.id, {
|
||||
title: this.$store.device.getLabel(row, 'recording'),
|
||||
title: this.$store.device.getLabel(row, ({ appName, deviceName }) => `${appName}${this.activeModel.label}-${deviceName}`),
|
||||
savePath,
|
||||
args,
|
||||
})
|
||||
@ -114,10 +117,7 @@ export default {
|
||||
|
||||
const extension = this.activeModel.extname(deviceConfig)
|
||||
|
||||
const fileName = `${this.$store.device.getLabel(
|
||||
row,
|
||||
'recorded',
|
||||
)}.${extension}`
|
||||
const fileName = this.$store.device.getLabel(row, ({ currentTime, deviceName }) => `${this.activeModel.label}-${deviceName}-${currentTime}.${extension}`)
|
||||
|
||||
const filePath = this.$path.join(savePath, fileName)
|
||||
|
||||
|
@ -49,14 +49,12 @@ export const useDeviceStore = defineStore({
|
||||
'mirror',
|
||||
'camera',
|
||||
'custom',
|
||||
'recording',
|
||||
'synergy',
|
||||
]
|
||||
.reduce((obj, type) => {
|
||||
obj[type] = createPreset(type)
|
||||
return obj
|
||||
}, {}),
|
||||
recorded: `Record-${deviceName}-${currentTime}`,
|
||||
screenshot: `Screenshot-${deviceName}-${currentTime}`,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user