Fixed if torrentsEnabled on the other templates.

This commit is contained in:
Travis McCrea 2024-08-20 18:28:28 +07:00
parent dcd71d0bba
commit 363bace4d8
3 changed files with 8 additions and 7 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@ annastorrents.exe
annastorrents
torrents.db
torrents.db-shm
torrents.db-wal
torrents.db-wal
assets/torrents

12
main.go
View File

@ -1122,7 +1122,7 @@ func getTemplateContent(name string) string {
<td>{{.StatusLabel}}</td>
<td><a href="{{.MagnetLink | urlsafe}}">Magnet</a></td>
<td>
{{if $.Torrents}}
{{if torrentsEnabled}}
<a href="/assets/torrents/{{.BTIH}}.torrent">Torrent</a>
{{else}}
<a href="{{.URL}}">Torrent</a>
@ -1148,11 +1148,11 @@ func getTemplateContent(name string) string {
<tr><td>Size</td><td>{{.FormattedDataSize}}</td></tr>
<tr><td>Magnet Link</td><td><a href="{{.MagnetLink | urlsafe}}">Magnet</a></td></tr>
<tr><td>Torrent Link</td><td>
{{if $.Torrents}}
<a href="/assets/torrents/{{.BTIH}}.torrent">Torrent</a>
{{else}}
<a href="{{.URL}}">Torrent</a>
{{end}}
{{if torrentsEnabled}}
<a href="/assets/torrents/{{.BTIH}}.torrent">Torrent</a>
{{else}}
<a href="{{.URL}}">Torrent</a>
{{end}}
</td></tr>
<tr><td>Last Update</td><td>{{.StatsScrapedAt}}</td></tr>
</table>

Binary file not shown.