Use night mode for http mount, reduce got torrents log

This commit is contained in:
Ben Adrian Sarmiento
2024-07-21 02:47:48 +02:00
parent 8d06ce88d3
commit d0168283c9
2 changed files with 7 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ import (
func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
var buf bytes.Buffer
buf.WriteString("<style>body{background-color:black;color:white}a{color:white}</style>")
buf.WriteString("<ol>")
directories := torMgr.DirectoryMap.Keys()
directories = append(directories, config.DOWNLOADS)
@@ -38,6 +39,7 @@ func ServeGroupDirectory(directory string, torMgr *torrent.TorrentManager) ([]by
}
var buf bytes.Buffer
buf.WriteString("<style>body{background-color:black;color:white}a{color:white}</style>")
buf.WriteString("<ol>")
torrentNames := torrents.Keys()
sort.Strings(torrentNames)
@@ -68,6 +70,7 @@ func ServeTorrentFiles(directory, torrentName string, torMgr *torrent.TorrentMan
}
var buf bytes.Buffer
buf.WriteString("<style>body{background-color:black;color:white}a{color:white}</style>")
buf.WriteString("<ol>")
filenames := tor.SelectedFiles.Keys()
sort.Strings(filenames)
@@ -96,6 +99,7 @@ func ServeTorrentFiles(directory, torrentName string, torMgr *torrent.TorrentMan
func ServeDownloads(_ string, torMgr *torrent.TorrentManager) ([]byte, error) {
var buf bytes.Buffer
buf.WriteString("<style>body{background-color:black;color:white}a{color:white}</style>")
buf.WriteString("<ol>")
filenames := torMgr.DownloadMap.Keys()
sort.Strings(filenames)

View File

@@ -65,7 +65,9 @@ func (rd *RealDebrid) GetTorrents(onlyOne bool) ([]Torrent, int, error) {
}
torrentPages[result.page-1] = result.torrents
totalFetched += len(result.torrents)
rd.log.Debugf("Got %d/%d torrents", totalFetched, result.total)
if i%4 == 0 || i == maxPages {
rd.log.Debugf("Got %d/%d torrents", totalFetched, result.total)
}
}
allTorrents := firstPage.torrents
for _, page := range torrentPages {