torrent active filename layout

This commit is contained in:
Martti Malmi 2021-04-30 15:03:02 +03:00
parent 380963fe94
commit e3a570f7ab
2 changed files with 14 additions and 2 deletions

View File

@ -419,6 +419,10 @@ header.footer .header-content {
width: 100%;
}
.torrent video {
}
.torrent .details {
background: var(--main-color);
}

View File

@ -34,7 +34,11 @@ class Torrent extends Component {
if (this.state.activeFilePath === file.path) {
return base.find('video, audio').get(0).play();
};
this.setState({activeFilePath: file.path});
let splitPath;
if (!isVideo(file)) {
splitPath = file.path.split('/');
}
this.setState({activeFilePath: file.path, splitPath});
let autoplay, muted;
if (clicked) {
autoplay = true;
@ -78,7 +82,11 @@ class Torrent extends Component {
<a href="" onClick=${e => this.openTorrentClicked(e)}>Show attachment</a>
`:''}
${s.torrenting && !s.torrent ? html`<p>Loading attachment...</p>`:''}
<p class="info">${s.activeFilePath}</p>
<div class="info">
${s.splitPath ? s.splitPath.map(
(str, i) => i === s.splitPath.length - 1 ? html`<p><b>${str}</b></p>` : html`<p>${str}</p>`
):''}
</div>
<div class="player"></div>
<a href=${this.props.torrentId} style="margin-right:7px;">Magnet link</a>
${t && t.files ? html`