diff --git a/__pycache__/torrent_vahti.cpython-311.pyc b/__pycache__/torrent_vahti.cpython-311.pyc
index 969a3c5..e5a79d4 100644
Binary files a/__pycache__/torrent_vahti.cpython-311.pyc and b/__pycache__/torrent_vahti.cpython-311.pyc differ
diff --git a/app.py b/app.py
index a59bcff..98b432b 100644
--- a/app.py
+++ b/app.py
@@ -136,4 +136,4 @@ if __name__ == '__main__':
ajastin_saie.daemon = True
ajastin_saie.start()
- app.run(host='0.0.0.0', port=5000)
+ app.run(host='0.0.0.0', port=5000)
\ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
index a7bd386..36790f9 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -32,7 +32,7 @@
-
+
@@ -114,7 +114,7 @@
const lokit = ['loki-sisalto', 'skripti-loki'];
lokit.forEach(id => {
const el = document.getElementById(id);
- el.scrollTop = el.scrollHeight;
+ if(el) el.scrollTop = el.scrollHeight;
});
}
@@ -133,8 +133,13 @@
lokiDiv.innerHTML = kaikkiRivit
.filter(r => r.toLowerCase().includes(hakuTermi))
.map((r) => {
+ // Suodatetaan magnet-linkin nimi näkyviin (poistetaan 'dn=' alku ja magnet: linkki)
+ let nimi = r;
+ if (r.includes('dn=')) {
+ nimi = decodeURIComponent(r.split('dn=')[1].split('&')[0].replace(/\+/g, ' '));
+ }
return `
- ${r}
+ ${nimi}
`;
}).join('');
diff --git a/torrent_vahti.py b/torrent_vahti.py
index e8cf191..880fd0a 100644
--- a/torrent_vahti.py
+++ b/torrent_vahti.py
@@ -158,4 +158,4 @@ def tarkista_ja_lataa():
print("--- HAKUKIERROS VALMIS ---\n")
if __name__ == "__main__":
- tarkista_ja_lataa()
+ tarkista_ja_lataa()
\ No newline at end of file