[gnome-shell/ebassi/issue-5115: 4/4] screencast: Use the same format for screencasts and screenshot file names




commit 0674042051193533e7954f7da0d083bb86c33888
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri May 20 17:40:35 2022 +0100

    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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2300>

 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 73f6b5595e..6f348c9d9c 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;
                 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]