add filetype column

This commit is contained in:
ed 2020-11-17 23:43:55 +01:00
parent 1aa1b34c80
commit 9c309b1498
3 changed files with 12 additions and 5 deletions

View file

@ -1077,7 +1077,12 @@ class HttpCli(object):
dt = datetime.utcfromtimestamp(inf.st_mtime) dt = datetime.utcfromtimestamp(inf.st_mtime)
dt = dt.strftime("%Y-%m-%d %H:%M:%S") dt = dt.strftime("%Y-%m-%d %H:%M:%S")
item = [margin, quotep(href), html_escape(fn), sz, dt] try:
ext = "---" if is_dir else fn.rsplit(".", 1)[1]
except:
ext = "%"
item = [margin, quotep(href), html_escape(fn), sz, ext, dt]
if is_dir: if is_dir:
dirs.append(item) dirs.append(item)
else: else:

View file

@ -34,13 +34,14 @@
<th></th> <th></th>
<th>File Name</th> <th>File Name</th>
<th sort="int">File Size</th> <th sort="int">File Size</th>
<th>T</th>
<th>Date</th> <th>Date</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{%- for f in files %} {%- for f in files %}
<tr><td>{{ f[0] }}</td><td><a href="{{ f[1] }}">{{ f[2] }}</a></td><td>{{ f[3] }}</td><td>{{ f[4] }}</td></tr> <tr><td>{{ f[0] }}</td><td><a href="{{ f[1] }}">{{ f[2] }}</a></td><td>{{ f[3] }}</td><td>{{ f[4] }}</td><td>{{ f[5] }}</td></tr>
{%- endfor %} {%- endfor %}
</tbody> </tbody>

View file

@ -617,8 +617,8 @@ function unblocked() {
// show ui to manually start playback of a linked song // show ui to manually start playback of a linked song
function autoplay_blocked(tid) { function autoplay_blocked(tid) {
show_modal( show_modal(
'<div id="blk_play"><a id="blk_go"></a></div>' + '<div id="blk_play"><a href="#" id="blk_go"></a></div>' +
'<div id="blk_abrt"><a id="blk_na">Cancel<br />(show file list)</a></div>'); '<div id="blk_abrt"><a href="#" id="blk_na">Cancel<br />(show file list)</a></div>');
var go = o('blk_go'); var go = o('blk_go');
var na = o('blk_na'); var na = o('blk_na');
@ -627,7 +627,8 @@ function autoplay_blocked(tid) {
fn = decodeURIComponent(fn.replace(/\+/g, ' ')); fn = decodeURIComponent(fn.replace(/\+/g, ' '));
go.textContent = 'Play "' + fn + '"'; go.textContent = 'Play "' + fn + '"';
go.onclick = function () { go.onclick = function (e) {
if (e) e.preventDefault();
unblocked(); unblocked();
mp.au.play(); mp.au.play();
}; };