From 317fa8222e8941e2e27a0f2df1ab84bac48e2e51 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 20 May 2022 17:40:35 +0100 Subject: [PATCH] screencast: Use the same format for screencasts and screenshot file names Screenshots use `%Y-%m-%d %H-%M-%S` for the timestamp, which has the advantage of allowing proper lexicographical sorting. The screencast file name pattern, on the other hand, uses locale-dependent expansions, which break sorting based on file name, and introduces the chance of potentially invalid characters on different file systems. Fixes: #5115 Part-of: --- js/dbusServices/screencast/screencastService.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/js/dbusServices/screencast/screencastService.js b/js/dbusServices/screencast/screencastService.js index 73f6b5595..6f348c9d9 100644 --- a/js/dbusServices/screencast/screencastService.js +++ b/js/dbusServices/screencast/screencastService.js @@ -308,19 +308,17 @@ var ScreencastService = class extends ServiceImplementation { break; case 'd': { const datetime = GLib.DateTime.new_now_local(); - const datestr = datetime.format('%0x'); - const datestrEscaped = datestr.replace(/\//g, '-'); + const datestr = datetime.format('%Y-%m-%d'); - filename += datestrEscaped; + filename += datestr; break; } case 't': { const datetime = GLib.DateTime.new_now_local(); - const datestr = datetime.format('%0X'); - const datestrEscaped = datestr.replace(/\//g, ':'); + const datestr = datetime.format('%H-%M-%S'); - filename += datestrEscaped; + filename += datestr; break; }