Fix order of root http route
This commit is contained in:
@@ -17,6 +17,9 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
buf.WriteString("<ol>")
|
||||
directories := torMgr.DirectoryMap.Keys()
|
||||
if torMgr.Config.GetConfig().UseDownloadCache {
|
||||
directories = append(directories, config.DOWNLOADS)
|
||||
}
|
||||
sort.Strings(directories)
|
||||
for _, directory := range directories {
|
||||
if strings.HasPrefix(directory, "int__") {
|
||||
@@ -25,9 +28,6 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||
directoryPath := url.PathEscape(directory)
|
||||
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s/\">%s</a></li>", directoryPath, directory))
|
||||
}
|
||||
if torMgr.Config.GetConfig().UseDownloadCache {
|
||||
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s/\">%s</a></li>", config.DOWNLOADS, config.DOWNLOADS))
|
||||
}
|
||||
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s\">%s</a></li>", version.FILE, version.FILE))
|
||||
|
||||
return buf.Bytes(), nil
|
||||
|
||||
@@ -44,7 +44,7 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, p
|
||||
Api: api,
|
||||
allAccessKeys: mapset.NewSet[string](),
|
||||
latestState: &LibraryState{},
|
||||
requiredVersion: "07.01.2024",
|
||||
requiredVersion: "10.01.2024",
|
||||
workerPool: p,
|
||||
log: log,
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func NewTorrentManager(cfg config.ConfigInterface, api *realdebrid.RealDebrid, p
|
||||
offset += len(downloads)
|
||||
page++
|
||||
if offset >= totalDownloads {
|
||||
t.log.Infof("Fetched %d downloads", t.DownloadCache.Count())
|
||||
t.log.Infof("Compiled into %d downloads", t.DownloadCache.Count())
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user