mirror of
https://github.com/borgbase/vorta
synced 2025-01-02 21:25:48 +00:00
Use isomtime
instead of mtime
from borg v1.2.2 on.
* src/vorta/borg/list_archive.py (BorgListArchiveJob.prepare) * src/vorta/views/extract_dialog.py (parse_json_lines)
This commit is contained in:
parent
ceb1a3bd3b
commit
0188b753b4
2 changed files with 8 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
|||
from vorta.utils import borg_compat
|
||||
from .borg_job import BorgJob
|
||||
|
||||
|
||||
|
@ -26,8 +27,9 @@ def prepare(cls, profile, archive_name):
|
|||
'--json-lines',
|
||||
'--format',
|
||||
# fields to include in json output
|
||||
"{mode}{user}{group}{size}{mtime}{path}{source}{health}{NL}",
|
||||
f'{profile.repo.url}::{archive_name}',
|
||||
"{mode}{user}{group}{size}{" + 'isomtime'
|
||||
if borg_compat.check('V122')
|
||||
else 'mtime' + "}{path}{source}{health}{NL}",
|
||||
]
|
||||
ret['ok'] = True
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
from PyQt5.QtCore import QDateTime, QLocale, QMimeData, QModelIndex, QPoint, Qt, QThread, QUrl
|
||||
from PyQt5.QtGui import QColor, QKeySequence
|
||||
from PyQt5.QtWidgets import QApplication, QDialogButtonBox, QHeaderView, QMenu, QPushButton, QShortcut
|
||||
from vorta.utils import get_asset, pretty_bytes, uses_dark_mode
|
||||
from vorta.utils import borg_compat, get_asset, pretty_bytes, uses_dark_mode
|
||||
from vorta.views.utils import get_colored_icon
|
||||
from .partials.treemodel import FileSystemItem, FileTreeModel, FileTreeSortProxyModel, path_to_str, relative_path
|
||||
|
||||
|
@ -208,7 +208,9 @@ def parse_json_lines(lines, model: "ExtractTree"):
|
|||
# except ValueError:
|
||||
# modified = datetime.strptime(item["mtime"], "%Y-%m-%dT%H:%M:%S")
|
||||
|
||||
modified = QDateTime.fromString(item["mtime"], Qt.DateFormat.ISODateWithMs)
|
||||
modified = QDateTime.fromString(
|
||||
item['isomtime' if borg_compat.check('V122') else 'mtime'], Qt.DateFormat.ISODateWithMs
|
||||
)
|
||||
|
||||
model.addItem(
|
||||
(
|
||||
|
|
Loading…
Reference in a new issue