Skip to content

Commit

Permalink
/np: exclude uploader ip and trim dot-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
9001 committed Feb 7, 2024
1 parent f0cdd9f commit ed524d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions copyparty/web/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1813,19 +1813,21 @@ function MPlayer() {
}


function ft2dict(tr) {
function ft2dict(tr, skip) {
var th = ebi('files').tHead.rows[0].cells,
rv = [],
rh = [],
ra = [],
rt = {};

skip = skip || {};

for (var a = 1, aa = th.length; a < aa; a++) {
var tv = tr.cells[a].textContent,
tk = a == 1 ? 'file' : th[a].getAttribute('name').split('/').pop().toLowerCase(),
vis = th[a].className.indexOf('min') === -1;

if (!tv)
if (!tv || skip[tk])
continue;

(vis ? rv : rh).push(tk);
Expand All @@ -1838,7 +1840,7 @@ function ft2dict(tr) {

function get_np() {
var tr = QS('#files tr.play');
return ft2dict(tr);
return ft2dict(tr, { 'up_ip': 1 });
};


Expand Down Expand Up @@ -1899,7 +1901,7 @@ var widget = (function () {
np = npr[0];

for (var a = 0; a < npk.length; a++)
m += (npk[a] == 'file' ? '' : npk[a]) + '(' + cv + np[npk[a]] + ck + ') // ';
m += (npk[a] == 'file' ? '' : npk[a]).replace(/^\./, '') + '(' + cv + np[npk[a]] + ck + ') // ';

m += '[' + cv + s2ms(mp.au.currentTime) + ck + '/' + cv + s2ms(mp.au.duration) + ck + ']';

Expand Down

0 comments on commit ed524d8

Please sign in to comment.