mirror of
https://github.com/transmission/transmission
synced 2025-01-30 10:52:00 +00:00
fix: missing date-added field in web torrent inspector (#5386)
This commit is contained in:
parent
8dbf40613a
commit
ce316309e7
1 changed files with 13 additions and 0 deletions
|
@ -115,6 +115,7 @@ export class Inspector extends EventTarget {
|
|||
['hash', 'Hash:'],
|
||||
['privacy', 'Privacy:'],
|
||||
['origin', 'Origin:'],
|
||||
['dateAdded', 'Date added:'],
|
||||
['magnetLink', 'Magnet:'],
|
||||
['comment', 'Comment:'],
|
||||
['labels', 'Labels:'],
|
||||
|
@ -541,6 +542,18 @@ export class Inspector extends EventTarget {
|
|||
}
|
||||
setTextContent(e.info.location, string);
|
||||
|
||||
// dateAdded
|
||||
if (torrents.length === 0) {
|
||||
string = none;
|
||||
} else {
|
||||
const get = (t) => t.getDateAdded();
|
||||
const first = get(torrents[0]);
|
||||
string = torrents.every((t) => get(t) === first)
|
||||
? new Date(first * 1000).toDateString()
|
||||
: mixed;
|
||||
}
|
||||
setTextContent(e.info.dateAdded, string);
|
||||
|
||||
// magnetLink
|
||||
if (torrents.length === 0) {
|
||||
setTextContent(e.info.magnetLink, none);
|
||||
|
|
Loading…
Reference in a new issue